%\input test.tex
\magnification1200

\newcount\problemcount
\problemcount=1
\def\problemA{\number\problemcount a.\  }
\def\problemB{\number\problemcount b.\  %
\global\advance\problemcount by 1}

\def\problem{\number\problemcount.\  %
\global\advance\problemcount by 1}
\def\correct{}
\def\wrong{}
\def\answer#1#2#3#4#5{\par%
(a)\ #1\hfill(b)\ #2\hfill(c)\ #3\hfill(d)\ #4\hfill(e)\ #5}

\def\ll#1{%
\hskip10pt#1\quad$\underline{\hskip 1true in}$\vskip10pt%
}
\newtoks\xxfott
\xxfott=\expandafter{\the\footline}
\footline{}
\long\def\boxit#1{\setbox0=\hbox{#1}%
\ifvmode\vskip -\dp0\else\lower\dp0\fi %
\vbox{\hrule\hbox{\vrule\box0 \vrule}\hrule}}

\def\arc{{\rm arc}\hskip-1pt}
\def\frac#1#2{{{\textstyle#1}\over{\textstyle#2}}}
\def\dd#1\wrt#2{\frac{d(#1)}{d{#2}}}
\def\DD#1\wrt#2{\frac{d#1}{d{#2}}}
\long\def\hide#1\endhide{}
\font\big=cmr12 at 16true pt
\font\bigbold=cmbx12 at 16true pt
\parindent=0pt
\def\mcab#1{\hskip 10pt\boxit{\lower .25 true in%
\vbox to .5true in{\vfill\hsize=.5true in\hskip10pt\raise10pt\hbox{#1}\hfill}}}

%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%
\centerline{\bigbold Math 126}
\centerline{\bigbold Fall 1997}
\centerline{\bigbold Test 2}
\centerline{\bigbold Oct. 28, 1997}
\vskip 20true pt

\def\AA{\par\noindent\vrule width\hsize depth.1pt height 0pt\vskip4pt}
\footline={\the\xxfott}
\def\Int{\displaystyle\int}
\def\Vert{\Bigg\vert}
\null\vskip 4true pt
\problem(5pt)
$\Int^1_0 2xe^{x^2}dx=\ ?$
\mcab {d}\answer
{$0$}
{$1$}
{$e$}
{$e-1$}
{$e^2$}


Substitute $u=x^2$ so $du=2x \> dx$.
Then 
$\Int^1_0 2xe^{x^2}dx=\Int^1_0 e^{u}du=e^u\>\Vert^1_0=e^1-e^0=e-1$.
Hence (d) is the correct answer.
\AA

\def\Frac#1#2{\frac{\displaystyle #1}{\displaystyle #2}}
\def\sfrac#1#2{\frac{\scriptstyle #1}{\scriptstyle #2}}
\def\Lim{\displaystyle\lim}
\problem(5pt)
$\Int^4_0\Frac{dx}{(4-x)^{\sfrac32}}=\ ?$
\mcab e\answer
{$1$}
{$2$}
{$3$}
{$4$}
{The integral diverges.}

The integral is improper because the function we are integrating 
is undefined at $4$.
First do the indefinite integral.
Substitute $u=4-x$, $du=-dx$.
$\Int\Frac{dx}{(4-x)^{\sfrac32}}=-\Int\Frac{du}{u^{\sfrac32}}=
-\Int u^{-\sfrac32}\> du=-\Frac{u^{1-\sfrac32}}{{1-\sfrac32}}+C=
\Frac{2}{u^{\sfrac12}}+C=\Frac{2}{(4-x)^{\sfrac12}}+C
$.
Now return to our problem.
$\Int^4_0\Frac{dx}{(4-x)^{\sfrac32}}=
\Lim_{t\to 4^-}\Int^t_0\Frac{dx}{(4-x)^{\sfrac32}}=
\Lim_{t\to 4^-}\biggl(\Frac{2}{(4-t)^{\sfrac12}}-
\Frac{2}{4^{\sfrac12}}\biggr)=\infty - 1
$, so the integral diverges and the answer is (e).

\AA
\problem(15pt) 
Evaluate\quad $\Int^1_0\Frac{dx}{\sqrt{2x-x^2\ }}$.
First note that this integral is improper because the
function we are integrating is undefined at $0$.
First we do the indefinite integral.
There are several ways to do this.
The first way starts by completing the square:
$2x-x^2=1-(x-1)^2$.
Now we can do a trig.~substitution, $x-1=\sin\theta$,
$dx=\cos\theta\>d\theta$ and
$2x-x^2=1-(x-1)^2=1-\sin^2\theta=\cos^2\theta$ and
$\Int\Frac{dx}{\sqrt{2x-x^2\ }}=
\Int\Frac{\cos\theta\>d\theta}{\sqrt{\cos^2\theta}}=
\Int d\theta=\theta+C=\arcsin(x-1)+C$.
A second way to do the integral is to use the substitution
$u=\sqrt{\frac x2}$,  $du=\Frac{dx}{2\sqrt2\sqrt x}$ or
$2\sqrt2\> du=\Frac{dx}{\sqrt x}$.
So $\Int\Frac{dx}{\sqrt{2x-x^2}}=
\Frac{1}{\sqrt{2}}\Int\Frac{1}{\sqrt{1-\frac x2}}\Frac{dx}{\sqrt x}=
\Frac{1}{\sqrt2}\Int\Frac{1}{1-u^2}\>2\sqrt2\> du=
2\Int\Frac{du}{\sqrt{1-u^2}}=2\arcsin u+C=
2\arcsin{\biggl( \sqrt{\frac x2}\>\biggr)}+C
$.
Note that these two answers are the same - you have to show
$\arcsin(x-1)=2\arcsin{\biggl( \sqrt{\frac x2}\>\biggr)}-\frac\pi2$.
Some students really did use this second method.
Yet a third method was used.
Substitute $x=2\sin^2\theta$, 
$dx=4\sin\theta\>\cos\theta\>d\theta$,
$2x-x^2=4\sin^2\theta-4\sin^4\theta=4\sin^2\theta(1-\sin^2\theta)=
4\sin^2\theta\cos^2\theta$.
Hence 
$\Int\Frac{dx}{\sqrt{2x-x^2\ }}=
\Int\Frac{4\sin\theta\>\cos\theta\>d\theta}
{\sqrt{4\sin^2\theta\cos^2\theta}}=
2\Int d\theta=2\theta+C=2\arcsin 
{\biggl( \sqrt{\frac x2}\>\biggr)}+C$.

Now turn to the improper integral.
$\Int^1_0\Frac{dx}{\sqrt{2x-x^2\ }}=
\Lim_{t\to0^+}\Int^1_t\Frac{dx}{\sqrt{2x-x^2\ }}=$\par\noindent$
\Lim_{t\to0^+}\arcsin(x-1)\Vert^1_t=
\Lim_{t\to0^+}\biggl(\arcsin(0)-\arcsin(t-1)\biggr)=
\arcsin(0)-\arcsin(-1)=0-(-\frac\pi2)=\frac\pi2$.
Hence the integral converges and has value $\frac\pi2$.


\AA

\problem(15pt) Evaluate\quad
$\Int^1_0 (x+1)\ln(x+1)\>dx$.

There are several methods here too.
The first method is to begin with an integration by parts:
$u=\ln(x+1)$ $dw=(x+1)dx$.
Hence $du=\Frac{dx}{x+1}$ and $w=\frac{x^2}2+x$.
Then
$\Int^1_0 (x+1)\ln(x+1)\>dx=
\biggl(\frac{x^2}2+x\biggr)\ln(x+1)\Vert^1_0
-\Int^1_0\biggl(\frac{x^2}2+x\biggr)\Frac{dx}{x+1}=
\frac32\ln2-\frac12\Int^1_0\Frac{x^2+2x}{x+1}\>dx=
\frac32\ln2-\frac12\Int^1_0\Biggl(x+1-\Frac{1}{x+1}\Biggr)\>dx=
\frac32\ln2-\frac12\Biggl(\frac{x^2}2+x-\ln(x+1)\Biggr)\Vert^1_0=
\frac32\ln2-\frac12\Biggl(\frac12+1-\ln2\Biggr)=
\frac32\ln2+\frac12\ln2-\frac34=2\ln2-\frac34$.

A second method starts the same way
$u=\ln(x+1)$ $dw=(x+1)dx$.
Hence $du=\Frac{dx}{x+1}$ but use $w=\frac{(x+1)^2}2$.
Then
$\Int^1_0 (x+1)\ln(x+1)\>dx=
\frac{(x+1)^2}2\ln(x+1)\Vert^1_0-\Int^1_0\frac{(x+1)^2}2\Frac{dx}{x+1}=
\frac42\ln2 -0-\frac12\Int^1_0(x+1)\>dx=
2\ln2-\frac12(\frac{x^2}2+x)\Vert^1_0=
2\ln2-\frac12\cdot\frac32=2\ln2-\frac34$.


A third method begins with the substitution
$u=x+1$, $du=dx$ so
$\Int^1_0 (x+1)\ln(x+1)\>dx=\Int^2_1u\ln u\>du$ and attack
$\Int u\ln u\>du$ by parts: $z=\ln u$, $dw=u\>du$ so
$dz=\frac{du}{u}$ $w=\frac12 u^2$ and
$\Int^2_1u\ln u\>du=\frac{u^2}2\ln u\Vert^2_1-
\Int^2_1\frac{u^2}2\frac{du}u=2\ln2-\frac12\Int^2_1u\>du=
2\ln2-\frac12(\frac{u^2}2\Vert^2_1)=
2\ln2-\frac12\cdot(2-\frac12)=2\ln2-\frac12\cdot\frac32=
2\ln2-\frac34$.

A fourth method starts with the formula
$\Int\ln z\>dz=z\ln z-z+C$.
Now do the substitution $u=x+1$, $du=dx$ again.
Do $\Int u\ln u\>du$ by parts again, but now use
$dw=\ln u\>du$, $y=u$, so $w=u\ln u- u$ and $dy=du$ so
$\Int u\ln u\>du=u(u\ln u-u)-\Int u\ln u\>du+\Int u\>du$.
Now solve for $\Int u\ln u\>du$:
$2\Int u\ln u\>du=u^2\ln u -u^2 +\frac{u^2}2+C$ so
$\Int u\ln u\>du=\frac{u^2}2\ln u - \frac{u^2}4+C_1$.
Now evaluate at $2$ and $1$.

\AA
\problem(15pt)
Evaluate\quad
$\Int\Frac{dx}{x^2\sqrt{x^2-1\ }}$.

Trig. substitute; $x=\sec\theta$ so $dx=\sec\theta\>\tan\theta\>d\theta$
and $x^2-1=\sec^2\theta-1=\tan^2\theta$.
Hence
$\Int\Frac{dx}{x^2\sqrt{x^2-1\ }}=
\Int\Frac{\sec\theta\>\tan\theta\>d\theta}{\sec^2\theta\tan\theta}=
\Int\cos\theta\>d\theta=\sin\theta+C$.
Solving the triangle 
\font\lsd=line10
\def\ddll{\hbox{{\lsd\char33}}}
\vskip10pt
\hbox{\hbox to 0pt{\raise15pt\hbox to0pt{\hskip5pt$x$\hss}%
\raise-10pt\hbox to 0pt{\hskip16pt$1$\hss}%
\raise 8pt\hbox to0pt{\hskip40pt$\sqrt{x^2-1}$\hss}%
\hbox to0pt{\vrule width38pt depth.1pt height 0pt
\vrule width.1pt height 16pt depth.1pt\hss}%
\hbox to0pt{\hbox{\hskip1pt\ddll%
\hskip-1pt\raise4pt\ddll%
\hskip-1pt\raise7.8pt\ddll%
\hskip-1pt\raise11.7pt\ddll}%
\hss}\hss}
\hskip80pt
shows $\sin\theta=\Frac{\sqrt{x^2-1}}{x}$ so
$\Int\Frac{dx}{x^2\sqrt{x^2-1\ }}=\Frac{\sqrt{x^2-1}}{x}+C$.}
\vskip4pt

\AA
\problem(15pt)
Evaluate\quad
$\Int\Frac{2dx}{(x-1)^2(x^2+1)}$.

Do partial fractions:
$\Frac{2}{(x-1)^2(x^2+1)}=\Frac A{x-1}+\Frac B{(x-1)^2}+
\Frac{Cx+D}{x^2+1}$ or
$2=A(x-1)(x^2+1)+B(x^2+1)+(Cx+D)(x-1)^2$.
Plug in $x=1$, so $2=B(2)$ or $B=1$.
Hence $2-(x^2+1)=A(x-1)(x^2+1)+(Cx+D)(x-1)^2$ so
$1-x^2=A(x-1)(x^2+1)+C(x-1)^2$ and
$-(1+x)=A(x^2+1)+(Cx+D)(x-1)$.
Plug in $x=1$ so $-2=A(2)$ or $A=-1$.
Hence $-(1+x)+(x^2+1)=(Cx+D)(x-1)$ or
$x^2-x=(Cx+D)(x-1)$ or
$x=Cx+D$ so $C=1$, $D=0$.
Hence
$\Int\Frac{2dx}{(x-1)^2(x^2+1)}=
-\Int\Frac{dx}{x-1}+\Int\Frac{dx}{(x-1)^2}+\Int\Frac{x\>dx}{x^2+1}=
-\ln\vert x-1\vert-\Frac{1}{x-1}+\frac12\ln(x^2+1)+C$.


\AA
\problem(15pt)
Solve the initial value problem:
$(1+x)y^\prime+y=1$; $y(0)=0$.

This equation is both separable and linear.
As a linear problem, the standard form is
$y^\prime+\Frac 1{x+1}\>y=\Frac 1{x+1}$.
The integrating factor is found by integrating
$\Frac 1{x+1}$ to get $\ln\vert x+1\vert+C$ so 
we may take $e^{\ln\vert x+1\vert}$ as the integrating
factor.
Even better, we may use $\vert x+1\vert$ or even $v=x+1$.
Then $(vy)^\prime=v\cdot\Frac1{x+1}$ so
$vy=\Int \>dx=x+C$ or $y=\Frac{x+C}{x+1}$.
Since $y(0)=0$ we also have $\Frac{0+C}{0+1}=0$ so $C=0$
and $y=\Frac{x}{x+1}$.

As a separable problem,
$(x+1)\dd y\wrt x=1-y$ so
$\Frac{dy}{1-y}=\Frac{dx}{x+1}$.
Integrating
$\Int\Frac{dy}{1-y}=\Int\Frac{dx}{x+1}$ and
$-\ln\vert 1-y\vert=\ln\vert x+1\vert+C$.
Clearing the log's,
$\Vert{1-y}\Vert=e^C\Vert\Frac1{x+1}\Vert$
or
$1-y=A\cdot\Frac 1{x+1}$ for some constant $A$.
Hence $y=1-\Frac A{x+1}$.
Since $y(0)=0$, $0=1-\Frac{A}{0+1}$ or $A=1$.
Hence $y=1-\Frac 1{x+1}$ which is the same function as before.


\AA
\problemA(9pt)
Is the integral $\Int^\infty_0\Frac{dx}{e^x}$ convergent or
divergent?
If it is convergent, evaluate it.
\vskip2pt
\problemB(6pt) Is the integral
$\Int^\infty_0\Frac{dx}{1+e^x}$ convergent or
divergent?
Do not evaluate the integral.

First do the indefinite integral $\Int\Frac{dx}{e^x}=
\Int e^{-x}dx=-e^{-x}+C$.

Hence
$\Int^\infty_0\Frac{dx}{e^x}=
\Lim_{t\to\infty}\Int^t_0\Frac{dx}{e^x}=
\Lim_{t\to\infty}\biggl(-e^{-x}\biggr)\Vert^t_0=
\Lim_{t\to\infty}-e^{-t}-(-e^{-0})=1-\Lim_{t\to\infty}e^{-t}=
1-0$ so the improper integral converges and the value is $1$.

For part (b) use either comparison theorem.
To use either, note first that $\Frac 1{1+e^x}>0$.
To use the first comparison theorem note that
$1+e^x>e^x$ so $\Frac1{1+e^x}<\Frac 1{e^x}$ and since
the integral in part (a) converges, so does
$\Int^\infty_0\Frac{dx}{1+e^x}$.
One can even argue that its value is positive and less than $1$.

To use the second comparison theorem compute
$\Lim_{x\to\infty}\Frac{\frac{1}{e^x}}{\frac{1}{1+e^x}}=
\Lim_{x\to\infty}\Frac{1+e^x}{e^x}=
\Lim_{x\to\infty} 1+e^{-x}=1+0=1$ so both
$\Frac{1}{1+e^x}$ and $\Frac1{e^x}$ grow at the same rate.
Since the integral in part (a) converges, so does
$\Int^\infty_0\Frac{dx}{1+e^x}$.

One can actually do the second integral: use the substitution
$u=e^x$, $du=e^xdx$ or $\Frac{du}{u}=dx$ so
$\Int\Frac{dx}{1+e^x}=\Int\Frac{du}{u(1+u)}$.
Now use partial fractions:
$\Frac1{u(u+1)}=\Frac Au+\Frac B{u+1}$ or
$1=A(u+1)+Bu$.
Plug in $u=0$ so $A=1$ and plug in $u=-1$ so $B=-1$
and $\Int\Frac{du}{u(1+u)}=\ln\vert u\vert-\ln\vert u+1\vert+C=
\ln\Vert\Frac u{(u+1)}\Vert+C=\ln\Vert\Frac {e^x}{(e^x+1)}\Vert+C$.
Hence
$\Int^\infty_0\Frac{dx}{1+e^x}=
\Lim_{t\to\infty}\Int^t_0\Frac{dx}{1+e^x}=
\Lim_{t\to\infty}\ln\Vert\Frac {e^t}{(e^t+1)}\Vert-
\ln\Vert\Frac {e^0}{(e^0+1)}\Vert=
\ln\Vert\Lim_{t\to\infty}\Frac {e^t}{(e^t+1)}\Vert-\ln\frac12=
\ln\Vert\Lim_{t\to\infty}\Frac {e^t}{(e^t+1)}\Vert+\ln2=
\ln1+\ln2=\ln2
$.

\end