\input homework_macros.tex

%\distiller
\printer
\def\dd #1#2{\frac{d#1}{d#2}}

\SN{\jobname}

\pn3. Check $y=\frac 1x\int_1^x\frac{e^t}{t} dt$
is a solution to $x^2y^\prime + xy=e^x$.
First compute $y^\prime=\br2{\dd{\frac 1x}x}\int_1^x\frac{e^t}{t} dt+
\frac 1x\dd{\int_1^x\frac{e^t}{t} dt}{x}$.
Now $\dd{\frac 1x}{x}=\frac{-1}{x^2}$ and by the Fundamental Theorem
of Calculus, $\dd{\int_1^x\frac{e^t}{t} dt}{x}=\frac{e^x}{x}$.
Plugging in, we see
 $y^\prime=\br2{\frac{-1}{x^2}}\int_1^x\frac{e^t}{t} dt+
\frac 1x\frac{e^x}{x}=\br2{\frac{-1}{x^2}}\int_1^x\frac{e^t}{t} dt+
\frac{e^x}{x^2}$.
Hence $x^2y^\prime=
-\int_1^x\frac{e^t}{t} dt+e^x$ and
$xy=\int_1^x\frac{e^t}{t} dt$ so
$x^2y^\prime + xy=e^x$ as required.


\pn9.
Solve $\dd yx=2(x+y^2x)$.
Since $y^2$ occurs, the equation is not linear.
To separate, notice $x+y^2x=x(1+y^2)$:
$\frac{dy}{1+y^2}=2x\>dx$.
Integrating,
$\int \frac{dy}{1+y^2}=\int 2x\ dx$ or
$\arctan y=x^2+C$ or
$y=\tan(x^2+C)$.

\pn11.Solve $2\sqrt{xy\ }\dd yx=1$, $x, y>0$.
Note $\sqrt{xy\ }=\sqrt x\sqrt y$ so
the equation is separable and
$2\sqrt y\>dy=\frac{dx}{\sqrt x}$.
Integrating we see
$2\int\sqrt y\>dy=\int\frac{dx}{\sqrt x}$
or
$2\frac{y^{3/2}}{3/2}=\frac{x^{1/2}}{1/2}+C$
or
$\frac 43 y^{3/2}=2x^{1/2}+C$.
Hence
$y^{3/2}=\frac 32x^{1/2}+C_1$ or
$y=\root 3\of{(\frac 32x^{1/2}+C_1)^2\ }$

\pn17.Solve $xy^\prime+3y=\frac{\sin x}{x^2}$, $x>0$.
This is linear of the form $y^\prime+Py=Q$ for
$P=\frac{3}{x}$ and $Q=\frac{\sin x}{x^3}$.
Find the integrating factor, $v=e^{\xnt Pdx}$.
$\int \frac{3dx}{x}=3\ln \vert x\vert$ so
$e^{\xnt Pdx}=e^{3\ln\vert x\vert}=\vert x^3\vert$.
We may drop the $\vert\quad\vert$ or observe that since $x>0$
in our problem, $\vert x^3\vert=x^3$.
Hence $\dd{v\cdot y}{x}=
v\br2{\dd yx}+\br1{\dd vx} y=
x^3\br2{\dd yx}+3x^2y=x^2\br2{\dd yx+3y}=
x^2\frac{\sin x}{x^2}=\sin x$.
Hence $v\cdot y=-\cos x + C$ and so
$y=\frac{-\cos x}{x^3}+\frac{C}{x^3}$.
Even thought you were not asked, you can check directly that
$y=\frac{-\cos x}{x^3}+\frac{C}{x^3}$ is also a solution if $x<0$.

\pn23.Solve $e^{2x}y^\prime+2e^{2x}y=2x$.
Linear with $P=2$, $Q=\frac{2x}{e^{2x}}=2xe^{-2x}$.
To find the integrating factor, compute 
$\int 2dx=2x+C$ so we may take $v=e^{2x}$ as
an integrating factor.
Calculate
$\dd{v\cdot y}{x}=v y^\prime+\br2{\dd vx}y=
e^{2x}y^\prime+2e^{2x}y=2x$.
Hence $v\cdot y=x^2+C$ so
$y=\frac{x^2}{e^{2x}}+\frac{C}{e^{2x}}=
x^2e^{-2x}+Ce^{-2x}$.

\pn29.Solve $(\sec^2\sqrt x)\dd xt=\sqrt x$.
This is NOT linear with the dependent variable $x$ and independent
variable $t$.
It is separable:
$\frac{(\sec^2x)\>dx}{\sqrt x}=dt$.
Integrate: $\int \frac{(\sec^2x)\>dx}{\sqrt x}=\int dt$.
The first integral can be done by a substitution:
$w=\sqrt x$ so $dw=\frac {dx}{2\sqrt x}$ and
$\int \frac{(\sec^2x)\>dx}{\sqrt x}=2\int \sec^2 w\>dw=2\tan w+C=
2\tan(\sqrt x)+C$.
Hence $2\tan(\sqrt x)=t+C$:
$\sqrt x=\arctan(\frac t2+C_1)$ and $x=\br2{\arctan(\frac t2+C_1)}^2$.
\item{} This equation IS linear with $t$ as the dependent variable
and $x$ is the dependent variable since
$\sec^2\sqrt x=\dd tx \sqrt x$ or
$\dd tx=\frac{\sec^2\sqrt x}{\sqrt x}$.
Hence $P=0$ and $Q=\frac{\sec^2\sqrt x}{\sqrt x}$.
When $P=0$ you may take $v=1$ but you just have to integrate $Q$.
This is the same integral we had to do above.


\pn37.Solve $\theta\dd y\theta+y=\sin\theta$, $\theta>0$ subject to
the initial condition $y(\frac\pi2)=1$.
This equation is linear with $P=\frac 1\theta$ and
$Q=\frac{\sin\theta}{\theta}$.
Ignore the initial condition for now and just solve the equation.
The integrating factor is
$v=e^{\xnt P d\theta}=e^{\ln\vert\theta\vert}=\vert\theta\vert$.
We may take $v=\theta$.
Compute $\dd{v\cdot y}{\theta}=
v\dd y\theta+\br2{\dd v\theta}y=
\theta\dd y\theta+y=\sin\theta$ so
$v\cdot y=(-\cos\theta)+C$ and
$y=\frac{(C-\cos\theta)}{\theta}$.
Now we turn to the initial condition, $y(\frac\pi2)=1$.
Recall $\cos(\pi/2)=0$ so
$1=\frac{C-0}{\pi/2}$.
Hence $\frac{\pi}2=C$.
Hence $y=\frac{\frac\pi2-\cos\theta}{\theta}=
\frac{-\cos\theta}{\theta}+\frac{\pi}{2\theta}$.

\pn47.We are told that the differential equation governing
the height of water in the tank is $\dd yt=-k\sqrt y$.
It is the province of physics or engineering to derive this
equation, but we are given it.
The constant $k$ can be determined from experiment, but 
we are given that $k=\frac 1{10}$.
The time needed for the tank to drain is the solution to the
equation $y(t)=0$.
(The tank is empty if and only if the height, $y$, is $0$.)
The fact that the level is $9$ feet at the start means that
$y(0)=9$ if we begin measuring time when we open the valve.

\itemitem{{\bf Step 1.}}
Solve the differential equation.
The equation is separable and
$\frac{dy}{\sqrt y}=-k\>dt$.
Integrating
$\int\frac{dy}{\sqrt y}=-k\int dt$ so
$2y^{1/2}=-kt+C$ or
$y^{1/2}=\frac{-kt}2 +C_1$ and
$y=\br2{C_1-\frac{kt}2}^2$.
\itemitem{{\bf Step 2.}}
Find $C_1$ from the relation
$y(0)=9=\br2{C_1-\frac{k\cdot0}2}^2$ or
$C_1^2=9$ so $C_1=\pm3$.
To decide whether it is plus or minus, recall
$y^{1/2}=\frac{-kt}2 +C_1$.
The square root function is always non{--}negative.
Since $k=\frac 1{10}$ and $t\geq 0$, $\frac{-kt}2$ is negative.
Hence $C_1$ must be positive and so $C_1=3$.
\itemitem{{\bf Step 3.}}
Solve the equation
$y(t)=0$ or
$\br2{3-\frac{t}{20}}^2=0$ (plugging in $k=\frac 1{10}$).
Hence $3-\frac{t}{20}=0$ and hence $t=60$.
Since $t$ is being measured in minutes, the time is 60 min.
or one hour later.

\item{}
Note how sensitive these sorts of equations are to the power of $y$.
If $\dd yt=ky$ you get exponential growth or decay and $y$ grows
(or falls) faster than any power of $t$.
If $\dd yt=ky^r$ for any $r\neq 1$ then $y$ will be some algebraic
function of $t$ and grow (or falls) much more slowly.


\end