% 2017 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}
\usepackage{graphicx}
\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 Sample Exam 1 S2017
\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 Sample Midterm Exam 1\\
\small Exam Date: Friday, 17 February 2017 at 12:50pm
\end{center}

{\bf Instructions}: This in-class exam is designed for 50 minutes. No
calculators, notes, tables or books. No answer check is expected.
Details count 3/4, answers count 1/4.

\begin{exercises}
\prob{1.}{(Quadrature Equations)} ~\newline
     \BF{(a)} [40\%] Solve $y'=\dd\frac{2x^3}{1+x^2}$. \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^{-t}v(t))= 2\,e^{t}$, $v(0)=5$ and the position model $\dd\frac{dx}{dt}=v(t)$, $x(2)=2$.
% F:=(2*x^3)/(1+x^2); int(F,x);
% x^2-ln(x^2+1)
%
%de:=diff(exp(-t)*v(t),t)=2*exp(t);
%dsolve([de,v(0)=5],v(t));
%vv:=rhs(%);
%dsolve([D(x)(t)=vv,x(0)=2],x(t))
%                                 / d      \
%         -exp(-t) v(t) + exp(-t) |--- v(t)| = 2 exp(t)
%                                 \ dt     /
%                  v(t) = (2 exp(t) + 3) exp(t)
%                     (2 exp(t) + 3) exp(t)
%                 x(t) = exp(2 t) + 3 exp(t) - 2
\ifsolutions
\begin{solution}{1} ~\newline
 \BF{(a)} Answer $y = {x}^{2}-\ln  \left( {x}^{2}+1 \right)  + c$.
 The integral of $F(x) = \frac{2x^3}{1+x^2}$ is found by substitution $u=1+x^2$, resulting in
 the new integration problem $\int F\,dx = \int \frac{u-1}{u}du= \int (1)du - \int \frac{du}{u}$.


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


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

\begin{exercises}
\prob{2.}{(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}{2} ~\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{3.}{(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  $\dd \frac{dy}{dx}-(\cos(x))y=0$ using the homogeneous linear equation shortcut.
\newline
 \BF{(c)} [20\%] Solve $\dd 5\frac{dy}{dx}-7y=10$ using the superposition principle $y=y_h+y_p$ shortcut. Expected are answers for $y_h$ and $y_p$.

\ifsolutions
\begin{solution}{3} ~\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{4.}{(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 portrait 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}{4} ~\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, UNSTABLE

\end{solution}

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

(a) [40\%] Find a constant coefficient 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)(r^2+2r+37)=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 equation as
over-damped, critically damped or under-damped. Illustrate
in a spring-mass-dashpot drawing the assignment of physical
constants $m$, $c$, $k$ and the initial conditions $x(0)=1$, $x'(0)=0$.


% ((r+1/2)^2+32=0 -->4 4r^2+4r+129=0
\ifsolutions
\begin{solution}{5} ~\newline
{\bf 5(a)}\newline
Multiply the first solution by $2$ and add it to the second solution. Then Euler atom $xe^{-x}$ is a solution, which implies
that $r=-1$ is a double root of the characteristic equation. Then the characteristic equation should be
$(r-(-1))(r-(-1))=0$,
or $r^2+2r+1=0$. The differential equation is $y''+2y'+y=0$.

{\bf 5(b)}\newline
The characteristic equation factors into $r^2(r-2)(r^2+4)((r+1)^2+36)=0$ with roots $r=0,0;  2; \pm 2i; -1\pm 6i $.
Then $y$ is a linear combination of the Euler solution atoms:
 
 $1,x,e^{2x},\cos(2x), \sin(2x); e^{-x}\cos(6x),e^{-x}\sin(6x)$.

{\bf 5(c)}\newline
Use $4r^2+4r+129=0$ and the quadratic formula to obtain roots
$r=-1/2+4\sqrt2 i,-1/2-4\sqrt2 i$ and Euler solution atoms $e^{-x/2}\cos 4\sqrt2 t, e^{-x/2}\sin 4\sqrt2 t$. Then $y$ is a linear combination of these two solution atoms, and it oscillates, therefore the classification is
{\bf under-damped}. The illustration shows a spring, a
dashpot and a mass with labels $k$, $c$, $m$. Initial conditions mean mass elongation $x=1$, at rest. 

A {\bf dashpot} is represented as a cylinder and piston with rod, the rod attached to the mass. Variable $x$ is positive in the down direction and negative in the up direction. The equilibrium position is $x=0$.

\end{solution}
\fi

\end{exercises}
\EJECTEND

\end{document}
\endinput
