% 2015 Differential Equations 2280-2
\documentclass[11pt]{article}
\setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.4in} \setlength{\textheight}{9.5in}
\setlength{\parskip}{5pt} \setlength{\topmargin}{-90pt}
\setlength{\parindent}{0pt}
\newenvironment{exercises}{\begin{list}{}{}}{\end{list}}
\newenvironment{solution}[1]{\protect\par{\bf Solution to Problem #1}.~\small\rm}{\protect\par\normalsize\rm}
%\long\def\answer#1{\begin{quote}\sf {\large\sf Answer:}\par #1\end{quote}}
\long\def\answer#1{}
\def\SeparatedPages#1{#1}
%\def\SeparatedPages#1{}
\def\prob#1#2{\item[{\normalsize\bf #1}] {\bf #2}}
\def\L{{\cal L}}
\def\dd{\displaystyle}
\def\BF#1{{\large\bf #1}}
\newif\ifsolutions
\solutionstrue
\solutionsfalse

\begin{document}
\thispagestyle{empty} {\large\bf Name}
\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
%{{\bf Time of your class}~\underline{~~~~~~~~~~} }
\def\EJECT{\SeparatedPages{\vfill Use this page to start your solution.
Attach extra pages as needed, then staple.\eject
\thispagestyle{empty} \hfill  2280 Exam 1 S2015
\newline{\large\bf Name}.
\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill}}
%%% {\bf Time of your class}~\underline{~~~~~~~~~~} }
\def\EJECTEND{\SeparatedPages{\vfill Use this page to start your solution.
Attach extra pages as needed, then staple.\eject}}
%\def\EJECT{}\def\EJECTEND{}

\begin{center}\Large\bf
Differential Equations 2280 \\
\small Midterm Exam 1\\
\small Exam Date: Friday, 27 February 2015 at 12:50pm
\ifsolutions
\\[3ex]
Edited Exam 1 with Solutions
\fi
\end{center}

{\bf Instructions}: This in-class exam is 50 minutes. No
calculators, notes, tables or books. No answer check is expected.
Details count 3/4, answers count 1/4.
%The first 5 problems are from
%a midterm exam in 2009, solutions appended to this PDF.
%The last two problems
%have solutions immediately after the problem statement. Last edit 23 Feb.

\begin{exercises}
\prob{1.}{(Quadrature Equations)} ~\newline
     \BF{(a)} [40\%] Solve $y'=\dd\frac{3+x^2}{2+x}$. \newline
%     \BF{(b)} [25\%] Solve $y'=(2\sin x + \cos x)(\sin x - 2\cos x)$.\newline
%     \BF{(c)} [25\%] Solve $y'=\dd \frac{x\tan\left(\ln(1+x^2)\right)}{1+x^2}$, $y(0)=2$.\newline
     \BF{(b)} [60\%] Find the position $x(t)$ from the velocity model $\dd\frac{d}{dt}(e^tv(t))= 2\,e^{2t}$, $v(0)=5$ and the position model $\dd\frac{dx}{dt}=v(t)$, $x(2)=2$.

%de:=diff(exp(t)*v(t),t)=2*exp(2*t);
%                               / d      \
%          exp(t) v(t) + exp(t) |--- v(t)| = 2 exp(2 t)
%                               \ dt     /
%dsolve([de,v(0)=5],v(t));
%                   v(t) = exp(t) + 4 exp(-t)
%vv:=rhs(%);
%                       exp(t) + 4 exp(-t)
%dsolve([D(x)(t)=vv,x(0)=2],x(t));
%                 x(t) = exp(t) - 4 exp(-t) + 5
\ifsolutions
\begin{solution}{1} ~\newline
 \BF{(a)} Answer $y \left( x \right) =\frac12\,{x}^{2}-2\,x+7\,\ln  \left( 2+x \right) + c$.
 The integral of $F(x) = \frac{3+x^2}{2+x}$ is found by substitution $u=2+x$, resulting in
 the new integration problem $\int F\,dx = \int (u-4 + 7/u)du$.


 \BF{(b)} Velocity $v(t) = e^t + 4e^{-t}$ by quadrature. Integrate $x'(t) =e^t + 4e^{-t}$ with
 $x(0)=2$ to obtain position $x(t) = e^t - 4e^{-t} + 5$.


\end{solution}
\fi
\iffalse {\small [Integral tables will be supplied
 for anything other than basic formulas. This sample problem
 would require no integral table. The exam problem will be
 shorter.]}\fi

\end{exercises}
\EJECT


\begin{exercises}
\prob{2.}{(Classification of Equations)} ~\newline
 The differential equation $y'=f(x,y)$ is defined to be {\bf separable} provided
$f(x,y)=F(x)G(y)$ for some functions $F$ and $G$.

% \BF{(a)} [40\%]  Check (\fbox{X}) the problems that can be put into separable form.
% No details expected.
%\begin{center}\large\begin{tabular}{|lp{0.3\linewidth}|lp{0.4\linewidth}|}
%\hline
% \fbox{$\phantom{X}$} & $ y'+xy=y(2x+e^x)+x^2y$ & \fbox{$\phantom{X}$} &   $y'=(x-1)(y+1) + (1-x)y$ \\[2ex]  \hline
%  \fbox{$\phantom{X}$} &  $y'=2e^{2x-y}e^{3y}+3e^{3x+2y}$ & \fbox{$\phantom{X}$} &  $\dd y'+x^2e^y=xy$ \\[2ex] \hline
%  \end{tabular}
%\end{center}

 \BF{(a)} [40\%] The equation $y'+x(y+3)=ye^x+3x$ is separable. Provide formulas for $F(x)$ and $G(y)$.

 %\BF{(c)} [10\%] Give an example of $y'=f(x,y)$ which is separable and linear but not quadrature. No details expected.

  \BF{(b)} [60\%] Apply partial derivative tests to show that $y'=x + y$ is linear but not separable. Supply all details.

\ifsolutions
\begin{solution}{2} ~\newline
 \BF{(a)} The equation is $y'=ye^x-xy=(e^x-x)y$. Then $F(x)=e^x-x$, $G(y)=y$.

 \BF{(b)} Let $f(x,y)=x+y$. Then $\partial f/\partial y = 1$, which is independent of $y$, hence the equation $y'=f(x,y)$ is linear. The negative test is $\frac{\partial f/\partial y}{f}$ depends on $x$. In this case, the fraction is
 $$\frac{\partial f/\partial y}{f}=\frac{1}{f}= \frac{1}{x+y}.$$
  At $y=0$, this reduces to $1/x$, which depends on $x$, therefore the equation $y'=f(x,y)$ is not separable.

\end{solution}
\fi
\end{exercises}
\EJECT

\begin{exercises}
\prob{3.}{(Solve a Separable Equation)} ~\newline
 % u:=x*exp(-x)+sin(x)*cos(x); int(u,x);
 % # -x*exp(-x)-exp(-x)+(1/2)*sin(x)^2
 % w:=(5*y+10)/(y^2+3*y-4);int(w,y);
 % # ans=2*ln(y+4)+3*ln(y-1)
 Given
   $\dd (5y+10)y' = \left( xe^{-x} +
\sin(x)\cos(x) \right)(y^2+3y-4)$.


  Find a non-equilibrium solution in implicit form. ~\newline
 To save time, {\bf do not solve} for $y$ explicitly and {\bf do not
 solve} for equilibrium solutions.

\ifsolutions
\begin{solution}{3} ~\newline
The solution by separation of variables identifies the separated equation $y'=F(x)G(y)$ using
$$F(x)= xe^{-x} + \sin(x)\cos(x),\quad G(y) = \frac{y^2+3y-4}{5y+10}.$$
The integral of $F$ is done by parts and also by $u$-substitution.
$$
\begin{array}{lcl}
\int Fdx &=& \int xe^{-x}\, dx + \int \sin(x)\cos(x)\, dx\\[2ex]
         &=& I_1 + I_2 .\\[3ex]
I_1 &=& \int xe^{-x}\, dx \\[2ex]
         &=& -xe^{-x} - \int e^{-x}\, dx,\quad \mbox{parts}\quad u=x, dv=e^{-x}dx,\\
         &=& xe{-x} - e^{-x} + c_1 \\
I_2 &=& \int \sin(x)\cos(x)\, dx\\[2ex]
         &=& \int u\,du,\quad u=\sin(x), du=\cos(x)dx,\\
         &=& u^2/2+c_2 \\
         &=& \frac12\sin^2(x)+c_2
\end{array}
$$
Then
$\dd\int Fdx = xe{-x} - e^{-x} + \frac12\sin^2(x)+c_3$.

The integral of $1/G(y)$ requires partial fractions. The details:
$$
\begin{array}{lcl}
\dd\int\frac{dx}{G(y(x))} &=& \dd\int \frac{5u+10}{u^2+3u-4}\, du,\quad u=y(x), du=y'(x)dx,\\[2ex]
         &=& \dd\int \frac{5u+10}{(u+4)(u-1)}\, du\\[2ex]
         &=& \dd\int \frac{A}{u+4} + \frac{B}{u-1}\, du,\quad A,B\quad\mbox{determined later},\\[2ex]
         &=& A\ln|u+4|+B\ln|u-1|+c_4
\end{array}
$$
The partial fraction problem
$$\frac{5u+10}{(u+4)(u-1)} = \frac{A}{u+4} + \frac{B}{u-1}$$
can be solved in a variety of ways, with answer $A=\frac{-20+10}{-5}=2$ and $B=\frac{15}{5}=3$.
The final implicit solution is obtained from $\int \frac{dx}{G(y(x))} = \int F(x)dx$, which gives the equation
$$2\ln|y+4|+3\ln|y-1| = xe{-x} - e^{-x} + \frac12\sin^2(x)+c.$$
\end{solution}
\fi
\end{exercises}
\EJECT

\begin{exercises}
\prob{4.}{(Linear Equations)} ~\newline
% v:='v':de:=2*diff(v(t),t)=-64+(10/(3*t+2))*v(t); ic:=v(0)=32;
% dsolve({de,ic},v(t));
% #                        v(t) = 32+48*t

 \BF{(a)} [60\%] Solve the linear model $\dd 2x'(t)= - 64 + \frac{10}{3t+2}x(t)$, $x(0)=32$. Show
 all integrating factor steps.
 % int( (5*u+10)/(u^2+3*u-4),u); int(x*exp(-x)+sin(x)*cos(x),x);
 \newline
 \BF{(b)} [20\%]  Solve the homogeneous equation $\dd \frac{dy}{dx}-(\cos(x))y=0$.
\newline
 \BF{(c)} [20\%] Solve $\dd 5\frac{dy}{dx}-7y=10$ using the superposition principle $y=y_h+y_p$. Expected are answers for $y_h$ and $y_p$.

\ifsolutions
\begin{solution}{4} ~\newline
 \BF{(a)} The answer is $v(t)=32+48t$. The details:
 $$\begin{array}{l}
 v'(t) = -32 + \dd\frac{5}{3t+2}\,v(t),\\[2ex]
 v'(t) + \dd\frac{-5}{3t+2}\, v(t) = -32,\quad\mbox{standard form $v'+p(t)v=q(t)$}\\[2ex]
 p(t) = \dd\frac{-5}{3t+2},\\[2ex]
 W = e^{\int p\,dt},\quad \mbox{integrating factor} \\[2ex]
 W = e^u,\quad u = \int p\,dt = -\frac{5}{3}\ln|3t+2|= \ln\left(|3t+2|^{-5/3}\right)\\[2ex]
 W = (3t+2)^{-5/3},\quad\mbox{Final choice for $W$}.
 \end{array}
 $$
 Then replace the left side of $v'+pv=q$ by $(vW)'/W$ to obtain
 $$\begin{array}{l}
 v'(t) + \dd\frac{-5}{3t+2}\, v(t) = -32,\quad\mbox{standard form $v'+p(t)v=q(t)$}\\[2ex]
\dd\frac{(vW)'}{W} = -32,\quad \mbox{Replace left side by quotient $(vW)'/W$}\\[2ex]
 (vW)' = -32W,\quad\mbox{cross-multiply}\\[2ex]
 vW = -32\int Wdt,\quad\mbox{quadrature step.}
 \end{array}
 $$
The evaluation of the integral is from the power rule:
$$\int -32W\,dt = -32\int (3t+2)^{-5/3}dt=-32\frac{(3t+2)^{-2/3}}{(-2/3)(3)} + c.$$
Division by $W=(3t+2)^{-5/3}$ then gives the general solution
$$v(t) = \frac{c}{W} -\frac{32}{-2}(3t+2)^{-2/3}(3t+2)^{5/3}.$$
Constant $c$ evaluates to $c=0$ because of initial condition $v(0)=32$. Then
$$v(t) =\frac{32}{-2}(3t+2)^{-2/3}(3t+2)^{5/3}=16(3t+2)^{-\frac23+\frac53} = 16(3t+2).$$

 \BF{(b)} The answer is $y=$ constant divided by the integrating factor: $y=\dd\frac{c}{W}$.
 Because $W=e^u$ where $u=\int -\cos(x)dx = -\sin x$, then $y=ce^{\sin x}$.
 % dsolve(diff(y(x),x)-cos(x)*y(x)=0,y(x));

 \BF{(c)} The equilibrium solution (a constant solution) is $y_p = -\frac{10}{7}$. The homogeneous solution is $y_h = c e^{7x/5}$ = constant divided by the integrating factor.
 Then $y=y_p+y_h = -\frac{10}{7} + ce^{7x/5}$.
 % dsolve(5*diff(y(x),x)-7*y(x)=10,y(x));
\end{solution}
\fi
\end{exercises}



\EJECT

\begin{exercises}
\prob{5.}{(Stability)} ~\newline
 %\BF{(a)} [50\%] Draw a phase line diagram for the differential equation
% $$\frac{dx}{dt} = \left(\ln(1+5x^2)\right)^{1/5}\left(|2x-1|-3\right)^3(2+x)^2(4-x^2)(1-x^2)^{3}e^{\cos x}.$$
% Expected in the phase line diagram are equilibrium
% points and signs of $dx/dt$.
% \newline
% \rule{\textwidth}{0.01in}

 %\vspace*{1.5in}

        %\BF{(b)} [50\%]
        Assume an autonomous equation $x'(t)=f(x(t))$. Draw a phase diagram with at least 12 threaded curves, using the phase line diagram given below. Add these labels as appropriate: funnel, spout, node [neither spout nor funnel], stable, unstable.

 \def\AA{\rule{5ex}{0.02in}}
 \def\BB{\rule[-0.1in]{0.4ex}{0.2in}}
 \def\PLUS{\mbox{\Large$+$}}
 \def\MINUS{\mbox{\Large$-$}}
 \begin{center}\begin{tabular}{*{11}{@{}c}}
 \PLUS & & \MINUS & & \PLUS & & \MINUS & & \PLUS & & \PLUS \\
\AA\AA & \AA & \AA\AA\AA & \AA & \AA & \AA & \AA & \AA & \AA & \AA& \AA\AA\AA \mbox{\Large ~$x$} \\[-3ex]
          & \BB &           & \BB &     & \BB &     & \BB &     & \BB&  \\[1ex]
    & $-10$   &     & $-5$   &     & $-3$    &     & $0$    &     & $3$    &
 \end{tabular}\end{center}
 \rule{\textwidth}{0.01in}

 \bigskip
 \ifsolutions
 \begin{solution}{5} ~\newline
 The graphic is drawn using increasing and decreasing curves, which may or may not be depicted with turning points. The rules:

 \begin{quote}\sf
 1. A curve drawn between equilibria is increasing if the sign is PLUS.

 2. A curve drawn between equilibria is decreasing if the sign is MINUS.

 3. Label: FUNNEL, STABLE \newline
 \hspace*{5pc} The signs left to right are PLUS MINUS crossing the equilibrium point.

 4. Label: SPOUT, UNSTABLE \newline
 \hspace*{5pc} The signs left to right are MINUS PLUS crossing the equilibrium point.

 5. Label: NODE, UNSTABLE \newline
 \hspace*{5pc} The signs left to right are PLUS PLUS crossing the equilibrium point, or \newline
 \hspace*{5pc} The signs left to right are MINUS MINUS crossing the equilibrium point.
 \end{quote}

 The answer:

  $x = -10$: FUNNEL, STABLE \newline
  $x = -5$: SPOUT, UNSTABLE \newline
  $x = -3$: FUNNEL, STABLE \newline
  $x = 0$: SPOUT, UNSTABLE \newline
  $x = 3$: NODE, STABLE

\end{solution}

 \fi
\end{exercises}
\EJECT
\begin{exercises}
\prob{6.}{(ch3)} ~\newline
Using Euler's theorem on atoms and the characteristic equation for
higher order constant-coefficient differential equations, solve
(a), (b), (c).

(a) [40\%] Find a differential equation $ay'' + by' + cy=0$ which has
particular solutions $-5e^{-x}+xe^{-x}$, $10e^{-x}+xe^{-x}$.
%
%(b) [25\%] Solve $y^{(6)} + 4y^{(5)}+ 4y^{(4)} = 0$.

(b) [30\%] Given characteristic equation
 $ r(r-2)(r^3+4r)^4(r^2+2r+17)=0$, solve the differential equation.

(c) [30\%] Given $mx''(t) + cx'(t) + kx(t) = 0$, which
represents an unforced damped spring-mass system. Assume $m=4$, $c=4$, $k=129$.
Classify the answer as
over-damped, critically damped or under-damped. Illustrate
in a drawing the assignment of physical
constants $m$, $c$, $k$ and the initial conditions $x(0)=0$, $x'(0)=1$.


% ((r+1/2)^2+32=0 -->4 4r^2+4r+129=0
\ifsolutions
\begin{solution}{6} ~\newline
{\bf 6(a)}\newline
Divide the first solution by $2$. Then Euler atom $e^{-x}$ is a solution, which implies
that $r=-1$ is a root of the characteristic equation. Subtract $y_1=e^{-x}$ and
$y_2=e^{-x}-e^{2x/3}$ to justify that $y=y_1-y_2=e^{2x/3}$ is a solution. It is an Euler atom
corresponding to root $r=2/3$. Then the characteristic equation should be $(r-(-1))(r-2/3)=0$,
or $3r^2+r-2=0$. The differential equation is $3y''+y'-2y=0$.

{\bf 6(b)}\newline
The characteristic equation factors into $r^4(r^2+4r+4)=0$ with roots $r=0,0,0,0,-2, -2$.
Then $y$ is a linear combination of the Euler atoms $1,x,x^2,x^3,e^{-2x},xe^{-2x}$.

{\bf 6(c)}\newline
The roots of the fully factored equation $ r^4(r+2)^4(r-2)^3((r+1)^2+4)=0$ are $$r=0,0,0,0, -2,-2,-2,-2, 2,2,2, -1\pm 2i.$$ The solution $y$ is a linear combination of the Euler atoms
$$1,x,x^2,x^3; \quad
e^{-2x},xe^{-2x},x^2e^{-2x},x^3e^{-2x};\quad
e^{2x},xe^{2x},x^2e^{2x}; \quad
e^{-x}\cos(2x), e^{-x}\sin(2x).$$

{\bf 6(d)}\newline
Use $4r^2+4r+65=0$ and the quadratic formula to obtain roots
$r=-1/2+4i,-1/2-4i$ and Euler atoms $\cos 4t, \sin 4t$. Then $y=(c_1\cos 4t+c_2\sin 4t)e^{-t/2}$.
This is under-damped (it oscillates). The illustration shows a spring, a
dashpot and a mass with labels $k$, $c$, $m$. Also shown is mass elongation $x$ and the
equilibrium position $x=0$.

\end{solution}
\fi

\end{exercises}
\EJECT

\begin{exercises}
\prob{7.}{(ch3)} ~\newline
%(a) [25\%] The trial solution $y$ with fewest Euler solution atoms, according to the
%method of undetermined coefficients, contains no solution of the
%homogeneous equation. Explain why, using the example $y'' = 1+x$.

%(b) [75\%]
Determine for $ y^{(4)} + y^{(2)} = x +
2e^{x}+3\sin x$ the corrected trial solution for $y_p$ according
to the method of undetermined coefficients.
{\bf Do not evaluate the
undetermined coefficients}! The trial solution should be the one with
fewest Euler solution atoms.


\ifsolutions
\begin{solution}{7} ~\newline
%{\bf 7(a)}. Rule I says the trial solution is $y=d_1+d_2x$. Rule II says to multiply
%by $x$ until no atom is a solution of $y''=0$. Then $y=d_1x^2+d_2x^3$ contains no terms of the homogeneous solution $y_h=c_1+c_2x$.
%
%{\bf 7(b)}.
The homogeneous equation $ y^{(4)} + y^{(2)}=0$ has solution $y_h=c_1+c_2x+c_3\cos x+c_4\sin x$,
because the characteristic polynomial has roots $0$, $0$, $i$,
$-i$.

{\bf \fbox{1}~} Rule I constructs an initial trial solution $y$ from the list of independent Euler atoms
$$e^{x},\quad 1,\quad x,\quad  \cos x,\quad \sin x.$$
Linear combinations of these atoms are supposed
to reproduce, by assignment of constants, all derivatives of $F(x) =  x +
2e^{x}+3\sin x$, which is the right side of the differential equation.
Each of $y_1$ to $y_4$ in the display below is
constructed to have the same {\bf base atom}, which is the Euler atom
obtained by stripping the power of $x$. For example, $x=xe^{0x}$ strips to base atom $e^{0x}$ or $1$.
$$\begin{array}{lcl}
 y &=& y_1+y_2+y_3+y_4,\\
 y_1 &=& d_1e^{x},\\
 y_2 &=& d_2+d_3x,\\
 y_3 &=& d_4\cos x,\\
 y_4 &=& d_5\sin x.
\end{array}
$$

{\bf \fbox{2}~} Rule II is applied individually to each of
$y_1$, $y_2$, $y_3$, $y_4$ to give the {\bf corrected trial
solution}
$$\begin{array}{lcl}
y &=& y_1+y_2+y_3+y_4,\\
 y_1 &=& d_1e^{x},\\
 y_2 &=& x^2(d_2+d_3x),\\
 y_3 &=& x(d_4\cos x),\\
 y_4 &=& x(d_5\sin x).
\end{array}
$$
The powers of $x$ multiplied in each case are selected to
eliminate terms in the initial trial solution which duplicate
homogeneous equation Euler solution atoms. The factor used is
exactly $x^s$ of the Edwards-Penney table, where $s$ is the
multiplicity of the characteristic equation root $r$ that produced
the related atom in the homogeneous solution $y_h$. The atom in
$y_1$ is not a solution of the homogeneous equation, therefore $y_1$ is unaltered.



\end{solution}
\fi

\end{exercises}
\EJECTEND

\end{document}
\endinput
