% LaTex2e
\documentclass[12pt]{article}
%\usepackage{amssymb,latexsym}

%\def\iff{\leftrightarrow}

\oddsidemargin 5pt \evensidemargin 5pt \marginparwidth 68pt
\marginparsep 10pt \topmargin 10pt \headheight 10pt
\headsep 15pt \footskip 35pt
\textheight = 625pt  \textwidth 440pt \columnsep 10pt \columnseprule 5pt

\pagestyle{myheadings}
\def\la{\langle}  \def\ra{\rangle}
\def\header{{\hfill Exam 2\hfill A. Miller \hfill Spring 2004
                                       \hfill Math 222\hfill}}
\markboth\header\header
\newcount\probno
\newcount\total
\newwrite\examTBLFile

\probno=0


\def\prob#1{\advance\probno by 1  \vfill \newpage % \par
    \noindent\the\probno . (#1 pts)\advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}

\def\finishtbl{
    \immediate\write\examTBLFile{Total \string& \the\total
    \string& \qquad \string\\ \string\hline}
     }

%%% \outer\def\answer{ {\par\bigskip Circle your answer.} \par\medbreak

\newwrite\ans
\immediate\openout\ans=answers
\outer\def\answer{\par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\answerx{ \par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\putanswer{\par\medbreak
  \immediate\write\ans{}
  \copytoblankline}
\def\copytoblankline{\begingroup\setupcopy\copyans}
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
     \catcode`\|=12\obeylines}
{\obeylines \gdef\copyans#1
  {\def\next{#1}%
  \ifx\next\empty\let\next=\endgroup%
  \else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
\def\printanswers{\newpage\begin{center} Answers \end{center}
    \immediate\closeout\ans\input answers}

\def\answer{\par\bigskip\bigskip\bigskip\noindent\hrule
\bigskip Answer: \par}


\begin{document}

\bigskip

Show all work.  
Simplify your answers.  
Circle your answer.

No notes, no books, no calculator, no cell phones, no pagers, no
electronic devices. 


\par\vskip .25in
\begin{center}
Name\makebox[3in]{\hrulefill} \\
\end{center}

\bigskip
Hand in to your TA.  Circle your TA's name:

{\large
\begin{tabbing}
xxxxxxxxx \=Ben Ellison xxxxxxxxxxxxxxx \=          Derek Moffitt \kill
\> Adam Berliner \>        Dan McGinn \\
\> Ben Ellison \>          Derek Moffitt \\
\> Jon Godshall \>         Richard Oberlin \\
\> E. Alec Johnson \> \\
\end{tabbing}
}



\bigskip

\begin{center} \Large
 \begin{tabular}{||c|c|c||} \hline\hline
  Problem & Points & Score \\  \hline\hline
   \input{exam.tbl}
  \hline \hline
 \end{tabular}
\end{center}

\immediate\openout\examTBLFile=exam.tbl

\bigskip
 
Solutions will be posted shortly after the exam:
www.math.wisc.edu/$\sim$miller/m222

\setcounter{page}{0}

\newpage 

\prob{5} % 13.1-25
{  Find} $${dy\over dx}\;\;\;\mbox{ and }\;\;\; {d^2y\over dx^2}$$ 
as functions of $t$
for the curve
$$x=1-\cos(t)\;\;\;\; y=1+\sin(t)$$

\answer $${dy\over dx}={{dy/ dt}\over {dx/ dt}}
={\cos(t)\over \sin(t)}={\rm cotan}(t)$$
letting $u={dy\over dx}$ then 
$${d^2y\over dx^2}={du\over dx}={{du/ dt}\over {dx/ dt}}=
{-{\rm cosec}^2(t)\over \sin(t)}=-{\rm cosec}^3(t)$$


\prob{5} % 12.8-9
{ Sketch} the region bounded by the equation 
$$r^2=16\cos(2\theta)$$  which is given
in polar coordinates. 
{ Find} its area.

\answer This is a leminscate see page 546.  One quarter of it occurs
between the angles of 0 and ${\pi\over 4}=45$ degrees and $r$ positive.
$$\mbox{ Area }= 4\int_{0}^{\pi/4} {r^2\over 2}d\theta=
32 \int_{0}^{\pi/4}\cos(2\theta)d\theta=
16\left.\sin(2\theta)\right]^{\pi/4}_0=16$$

\prob{5} % 12.4 - 33
{Find both of the foci}  of the ellipse
$$16(x-1)^2 \;+ \;25(y+2)^2=400$$

\answer The equation is equivalent to:
$${(x-1)^2\over 25}+{(y+2)^2\over 16}=1$$
This is centered at the point $(1,-2)$.  If we let $u=x-1$ and
$v=y+2$ then in the $uv$ coordinates we have
$${u^2\over 25}+{v^2\over 16}=1$$
This has foci at $(\pm 3, 0)$ and is centered at $(0,0)$. Translating
back to $xy$ we have foci at $(1+\pm 3, -2)$ which is 
$(4,-2)$ and $(-2,-2)$.

\prob{5} % 12.3 - ??
{ Transform} the equation $xy=1$ into an equation of $u$ and $v$ by a 
suitable rotation of the axis so that the cross product term,
$buv$, is zero.  

\answer ${\rm cotan}(2\theta_0)={{A-C}\over B}=0$ so $2\theta_0=\pi/2$
and $\theta_0=\pi/4=45$ degrees.
$$x=u\cos(\pi/4)-v\sin(\pi/4)={\sqrt{2}\over 2}(u-v)$$  
$$y=u\sin(\pi/4)+v\cos(\pi/4)={\sqrt{2}\over 2}(u+v)$$
$$ 1=xy={1\over 2}(u^2-v^2)$$

\prob{5} % 12.2 - 17
An ellipse is centered at the origin,
intercepts the $y$-axis at $(0,\pm 3)$, and intercepts the $x$-axis 
at $(\pm5,0)$.  Find its eccentricity and its directrix.

\answer The focus at $(c,0)$ satisfies $a^2=b^2+c^2$ where
$a=5$ and $b=3$.  Hence $c=4$.  The eccentricity satisfies
$ae=c$ so $e={4\over 5}$.  The directrix line satisfies
$k={a\over e}={5\over{4/5}}={25\over 4}$ so the line
is $x={25\over 4}$.


\prob{5}  % 12.1 - 17
{ Find} the equation of the parabola through the point $(6,-5)$ if its
vertex is at the origin and its axis of symmetry is the y-axis.  Make a
{ sketch}.

\answer $y=mx^2$ so $-5=m\cdot 36$ so $y=-{5\over 36}x^2$ which opens out
downward. 

\prob{5}  % 18.2 -9
Solve the differential equation:
$$y^{\prime\prime}+y^{\prime}-2y=-10\sin(x)$$

\answer $r^2+4-2=0$ so $(r+2)(r-1)=0$ so $r=-2$ and $r=1$.  The
associated homogeneous equation has solution
$$y_H=C_1 e^{-2x}+C_2 e^x$$
To find a particular solution to the nonhomogeneous equation
guess
$$y_P=A\sin(x)+B\cos(x)$$ 
Then
$$y_P^{\prime\prime}+y_P^{\prime}-2y_P=(-3A-B)\sin(x)+(A-3B)\cos(x)$$
equating
$$(-3A-B)\sin(x)+(A-3B)\cos(x)=-10\sin(x)$$
gives $A-3B=0$ and $(-3A-B)=-10$ solving gives us $A=3$ and $B=1$.
Hence the general solution is
$$y=C_1 e^{-2x}+C_2 e^x+3\sin(x)+\cos(x)$$ 


\prob{5} % 18.1 - 5
Solve the following differential equation with {initial values}:
$$ y^{\prime\prime}-4y^{\prime}+4y=0
\mbox{ where $y=1$ and $y^{\prime}=1$ when $x=0$}$$

\answer The associated quadratic $(r-2)^2$ gives us the general
solution
$$y=C_1e^{2x}+C_2xe^{2x}$$
then
$$y^\prime=(2C_1+C_2)e^{2x}+2C_2xe^{2x}$$
setting $y(0)=1$ and $y^\prime(0)=1$ gives us
$1=C_1$
and 
$1=2C_1+C_2$.  Solving gives us $C_2=-1$ and so the unique solution is
$$y= e^{2x}-xe^{2x}$$

\prob{5} % 7.6  - 5
Solve the following differential equation
$${dy \over dx}-{y\over x}=xe^x$$

\answer Let 
$$\mu=e^{\int -{1\over x}dx}=e^{-\ln(x)}=
e^{\ln(x^{-1})}=x^{-1}={1\over x}$$ 
$$\int \mu q = \int {1\over x} x e^x=\int e^x=e^x$$
$$y={1\over\mu}(\int\mu q +C)= x (e^x+C)$$

\prob{5} % 11.1 - 5 
{ Find} the Maclaurin polynomial of order 2 for $f(x)=\ln(1+x)$.
Use it to {  approximate} $\ln(1.2)$.  {  Find} an upper bound for the 
absolute value of the error.

\answer $$f(x)=f(0)+f^\prime(0)x+{1\over 2}f^{\prime\prime}(0)x^2+\epsilon$$
where $\epsilon={1\over 6}f^{\prime\prime\prime}(\zeta)x^3$
for some $\zeta$ between $x$ and $0$.  
$$f(x)=\ln(1+x)\;\;\;\;\;\; f(0)=0$$ 
$$f^\prime(x)={1\over 1+x}\;\;\;\;\; f^\prime(0)=1$$
$$f^{\prime\prime}(x)=-{1\over (1+x)^2}\;\;\;\;\; f^{\prime\prime}(0)=-1$$
$$f^{\prime\prime\prime}(x)={2\over (1+x)^3}$$
Hence the Maclaurin polynomial is
$$p(x)=x-{1\over 2}x^2$$
$$p(.2)=(.2)-{1\over 2}(.2)^2=.18$$
The error is bounded by ${1\over 6}M(.2)^3$ where $M$ satisfies
$$0\leq {2\over (1+\zeta)^3} \leq M$$
for $0\leq \zeta\leq .2$.  This is largest when $\zeta=0$ so
$M=2$ and the error is bounded by ${1\over 3}(.2)^3$.
\par\bigskip\hrule\bigskip
Another way to obtain error bound is to use alternating series:
$${1\over (1-x)}=1+x+x^2+x^3+\ldots$$
$${1\over (1+x)}=1-x+x^2-x^3+\ldots$$
$$\ln(1+x)= x-{x^2\over 2}+{x^3\over 3}-{x^4\over 4}+\ldots$$
(by integrating and using $\ln(1+0)=C$).
Since $0<x=.2<1$ this is an alternating series:
$$\ln(1+x)= x-{x^2\over 2}+\epsilon$$
where
$$0<\epsilon={x^3\over 3}-{x^4\over 4}+\ldots \leq {x^3\over 3}={(.2)^3\over 3}
$$


\finishtbl

% \printanswers

\end{document}


