% 2017 Differential Equations 2280-2
\documentclass[11pt,leqno]{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}}

\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}}
\def\.#1{\mbox{\bf #1}}
\def\nextpage{\newpage}
\usepackage{linalg}
\newif\ifsolutions
%\solutionstrue
%\solutionsfalse
\ifsolutions
\def\Answer#1{\rule{0.2\linewidth}{0.05em}\\ {\bf Answers and Solution Details}:\\ {\sf #1} \par\rule{\linewidth}{0.1em}}
\else
\def\Answer#1{\relax}
\fi
\def\.#1{\vec{{\boldmath #1}}}
\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.\newpage
\thispagestyle{empty} \hfill  2280 Exam 3 S2017
%\newline{\large\bf Name}.
%\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
}
}
%%% {\bf Time of your class}~\underline{~~~~~~~~~~} }
\def\EJECTEND{\SeparatedPages{\vfill Use this page to start your solution.
\eject}}
%\def\EJECT{}\def\EJECTEND{}

\begin{center}\Large\bf
Differential Equations 2280 \\
\small Midterm Exam 3\\
\small Exam Date: 14 April 2017 at 12:50pm
\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.
\subsection*{Chapter 3}
\begin{exercises}
\prob{1.}{(Linear Constant Equations of Order $n$)} ~\\[1ex]
\BF{(a)} [30\%] Find by variation of parameters a particular solution $y_p$ for the equation
$y''=x+x^2$. Show all steps in variation of parameters. Check the answer
by quadrature.
\nextpage
\subsection*{Chapter 3}
\BF{(b)} [40\%]  Find the {\bf Beats} solution for
the forced undamped spring-mass problem
$$ x'' + 256x = 247\cos(3t),\quad x(0)=x'(0)=0.$$
% de:=diff(x(t),t,t)+256*x(t)=247*cos(3*t), x(0)=0,D(x)(0)=0;
It is known that this solution is the sum of two harmonic oscillations of different frequencies.
{\bf To save time}, please don't convert your answer. 
\nextpage
\subsection*{Chapter 3}
 \BF{(c)} [30\%] Let $f(x)=x^2\cos(x) - x(e^x + 1)$. Find the characteristic equation of a linear 
 homogeneous scalar differential equation of least order such that $y=f(x)$ is a solution.

\bigskip

\ifsolutions
\vfill\eject
\Answer{~\newline
All in progress.\\
\BF{Part (a)} ~~ Answer: $\dd y_p=x^2+x^3$.
\\
\BF{Variation of Parameters}.\newline
 Solve $y''=0$ to get $y_h=c_1y_1+c_2y_2$,
$y_1=1$, $y_2=x$.  Compute the
Wronskian $W=y_1y_2'-y_1'y_2=1$. Then for
$f(x)=2+6x$,
\\
$\dd
 y_p=y_1\int y_2\frac{-f}{W}dx+y_2\int y_1\frac{f}{W}dx,
 $
\\
 $\dd
 y_p=1\int -x(2+6x)dx+x\int 1(2+6x)dx,
 $
\\
  $\dd
 y_p=-1(x^2+2x^3)+x(2x+3x^2),
 $
\\
  $\dd
 y_p=x^2 +x^3.
 $
\\
This answer is checked by quadrature, applied twice to $y'' = 2+6x$ with initial conditions zero.
% de1:=diff(y(x),x,x)=2+6*x; dsolve(de1,y(x));
% y(x) = x^3+_C1*x+x^2+_C2
\\[1ex]
\BF{Part (b)} ~~ It has to be the terms left over after striking out the transient terms, those terms with limit zero at infinity. Then $x_{\mbox{ss}}(t)=5\cos (10t)  -\sqrt{17} \sin (10t) $.
\\[1ex]
\BF{ Part (c)}~~ The answer is $x(t)=-\cos(8t)+\cos(5t)$.\\
% solve(r^2+64=0,r);
% de:=diff(x(t),t,t)+64*x(t)=39*cos(5*t);dsolve(de,x(t));
% dsolve({de,x(0)=0,D(x)(0)=0},x(t));
Use undetermined coefficients trial solution $x=d_1\cos 5t + d_2 \sin 5t$. Then $d_1=1$, $d_2=0$, and finally $x_p(t)=\cos(5t)$. The characteristic equation $r^2+64=0$ has roots $\pm 8i$ with corresponding Euler solution atoms $\cos(8t), \sin(8t)$. Then $x_h(t)=c_1\cos(8t)+c_2\sin(8t)$. The general solution is $x=x_h+x_p$. Now use $x(0)=x'(0)=0$ to determine $c_1=-1, c_2=0$, which implies the particular solution $x(t)=-\cos(8t)+\cos(5t)$.
\\[1ex]
\BF{Part (d)}~~Use the quadratic formula to decide. The number under the radical sign in the formula,
called the discriminant, is $b^2-4ac=2^2-4(5)(2)=-36$, therefore there are two complex conjugate roots
and the equation is {\bf under-damped}. Alternatively, factor $5r^2+2r+2$ to obtain the roots and atoms,
then classify as {\bf under-damped}.
\\[1ex]
\BF{Part (e)}~~
$\dd\omega = \sqrt{\frac{k}{m} - \frac{c^2}{2m^2}} = \sqrt{\frac{151}{8}}$.
}
\fi


\end{exercises}
\EJECT

\subsection*{Chapters 4 and 5}
\begin{exercises}
\prob{6.}{(Systems of Differential Equations)} ~\newline
%\BF{Background}.  Let $A$ be a real $3\times 3$ matrix with eigenpairs
% $(\lambda_1,\.v_1)$,  $(\lambda_2,\.v_2)$,  $(\lambda_3,\.v_3)$.
% The eigenanalysis method says that the $3\times 3$ system
%$\.x' = A\.x$ has general solution
%$$\.x(t)=c_1\.v_1e^{\lambda_1
%t}+c_2\.v_2e^{\lambda_2 t}+c_3\.v_3e^{\lambda_3 t}.$$
%\BF{Background}. Let $A$ be an $n\times n$ real matrix. The method called \BF{Cayley-Hamilton-Ziebur} is based upon the result
%\begin{quote}\sf
%The components of solution $\.x$ of $\.x'(t)=A\.x(t)$ are linear combinations of Euler solution atoms obtained from the roots of the characteristic equation $|A-\lambda I|=0$.
%\end{quote}

 \BF{(a)} [30\%]  Assume a $3\times 3$ matrix $A$ 
has eigenvalues $\lambda=3,4,5$. State the Cayley-Hamilton-Ziebur theorem for this example. Then display a solution 
formula for the vector solution $\vec{u}(t)$ to system $\frac{d}{dt}\vec{u} = A\vec{u}$, inserting what is known what is known from the eigenvalue information (supplied above).
\nextpage
\subsection*{Chapters 4 and 5}
\BF{(b)} [40\%]   A linear cascade, typically found in brine tank models, satisfies  $\frac{d}{dt}\vec{x}(t)=A\vec{x}(t)$ where the $4\times 4$ triangular matrix is
$$A=\left(\begin{array}{rrrr}
 1 & 1 &  0  & 0\\
 0 & 1 &  0  & 0\\
 0 & 0 &  3  & 1\\
 0 & 0 &  0  & 3
 \end{array}\right).$$


 \begin{quote}\sf
 \BF{Part 1}. Use the linear integrating factor method to find the vector general solution $\vec{x}(t)$ of $\frac{d}{dt}\vec{x}(t)=A\vec{x}(t)$.
\end{quote}
\nextpage

\subsection*{Chapters 4 and 5}
\BF{(b)} [40\%]   A linear cascade, typically found in brine tank models, satisfies  $\frac{d}{dt}\vec{x}(t)=A\vec{x}(t)$ where the $4\times 4$ triangular matrix is
$$A=\left(\begin{array}{rrrr}
 1 & 1 &  0  & 0\\
 0 & 1 &  0  & 0\\
 0 & 0 &  3  & 1\\
 0 & 0 &  0  & 3
 \end{array}\right).$$


 \begin{quote}\sf
   \BF{Part 2}. Laplace's method applies to this example. Explain in a paragraph of text how to apply Laplace's method
 to this $4\times 4$ system. Don't use Laplace tables and don't find the solution! The explanation can use scalar equations or the vector-matrix equation $\frac{d}{dt}\vec{x}(t)=A\vec{x}(t)$.
\end{quote}
\nextpage
\subsection*{Chapters 4 and 5}
\BF{Background for (c)}. Let $A$ be an $n\times n$ real matrix. An augmented matrix $\Phi(t)$ of $n$ independent solutions of $\.x'(t)=A\.x(t)$ is called a
 \BF{fundamental matrix}. It is known that the general solution is $\.x(t)=\Phi(t)\.c$, where $\.c$ is a column vector of arbitrary constants $c_1, \ldots, c_n$. An alternate and widely used definition of fundamental matrix is  $\Phi'(t) = A\Phi(t)$, $|\Phi(0)| \ne 0$.

   \BF{(c)} [30\%] The Cayley-Hamilton-Ziebur shortcut  applies especially to the system
   $$ x' = x + 5y,\quad y' = -5x + y,$$
   which has complex eigenvalues $\lambda = 1\pm 5i$.

\begin{quote}\sf
   \BF{Part 1}. Show the details of the method, finally displaying formulas for $x(t), y(t)$.

    \BF{Part 2}. Report a fundamental matrix $\Phi(t)$.
    
    \BF{Part 3}. Use \BF{Part 2} to find the exponential matrix $e^{At}$.
 \end{quote}
\ifsolutions
\vfill\eject
\Answer{~\newline
% unfinished
\BF{Part (a)}~~ in progress
\\[1ex]
\BF{Part (b)} The answer: 
% {w(t) = _C4*exp(3*t), x(t) = (_C2*t+_C1)*exp(t), y(t) = _C2*exp(t), z(t) = (_C4*t+_C3)*exp(3*t)}

% de:=diff(x(t),t)=1*x(t)+y(t),diff(y(t),t)=1*y(t),diff(z(t),t)=3*z(t)+w(t),diff(w(t),t)=3*w(t);dsolve([de],[x(t),y(t),z(t),w(t)]);
% AA:=<1,1,0,0|0,1,0,0|0,0,3,1|0,0,0,3>^+;LinearAlgebra[Eigenvectors](AA);
\BF{Solution b(1)}~~ in progress
\\
Write the system in scalar form
$$\begin{array}{lcl}
x' &=& x + y, \\
y' &=& 4y+z,\\
z' &=& 5z.
\end{array}
$$
Solve the last equation $z'=5z$ as \\
$z=\frac{\mbox{constant}}{\mbox{integrating factor}} = c_3e^{5t}$. \\
\fbox{$z = c_3e^{5t}$}\\
The second equation is\\
$y' = 4y + c_3e^{5t}$\\
The linear integrating factor method applies.\\
$y' - 4y = c_3e^{-5t}$\\
$\dd\frac{(Wy)'}{W} = c_3e^{5t}$, where $W=e^{-4t}$,\\
$(Wy)' = c_3We^{5t}$\\
$(e^{-4t}y)' = c_3e^{-4t}e^{5t}$\\
$e^{-4t}y = c_3e^t + c_2.$\\
\fbox{$y = c_3e^{5t}+c_2e^{4t}$}\\
Stuff the expression into the first differential equation:\\
$x' = 4x + y  = 4x + c_3e^{5t}+c_2e^{4t}$\\
Then solve with the linear integrating factor method. \\
$x' - 4x = c_3e^{5t}+c_2e^{4t}$\\
$\dd\frac{(Wx)'}{W} = c_3e^{5t}+c_2e^{4t}$, where $W=e^{-4t}$. Cross-multiply:\\
$(e^{-4t}x)' = c_3e^{5t}e^{-4t}+c_2e^{4t}e^{-4t}$, then integrate:\\
$e^{-4t}x = c_3e^{t}+c_2\,t+c_1$\\
Then divide by $e^{-4t}$:\\
\fbox{$x = c_3e^{5t}+c_2te^{4t}+c_1e^{4t}$}\\
\BF{Solution b(2)}. \\
The matrix of coefficients is not diagonalizable, therefore the eigenanalysis method fails to apply.
\\[1ex]
\BF{Part (c)}~~ in progress
\\
The equations
   $$ x' = 5x + 4y,\quad y' = -4x + 5y$$
have coefficient matrix $A=\twobytwo{5&4}{-4&5}$ with characteristic equation $(\lambda-5)^2+16=0$. The roots are $5\pm 4i$. The Euler atoms are $e^{5t}\cos(4t), e^{5t}\sin(4t)$. \\
% AAA:=<5,4|-4,5>^+;LinearAlgebra[Eigenvalues](AAA);
\BF{Solution c(1)}.\\
By C-H-Z, $x=c_1e^{5t}\cos(4t)+c_2e^{5t}\sin(4t)$. Isolate $y$ from the first differential equation $x'=5x+4y$, obtaining the formula $4y=x'-5x=5x+e^{5t}\left(-4c_1\sin(4t) + 4c_2\cos(4t)\right)-5x = -4c_1e^{5t}\sin(4t)+4c_2e^{5t}\cos(4t)$. Then the solution formulas are
$$
x=c_1e^{5t}\cos(4t)+c_2e^{5t}\sin(4t),\quad y(t)=-c_1e^{5t}\sin(4t)+c_2e^{5t}\cos(4t).
$$
\BF{Solution c(2)}\\
A fundamental matrix $\Phi(t)$ is found by taking partial derivatives on the symbols $c_1,c_2$. The answer is exactly the Jacobian matrix of $\colvector{x\\ y}$ with respect to variables $c_1,c_2$.\\
$\dd\Phi(t)=\twobytwo{e^{5t}\cos(4t) & e^{5t}\sin(4t)}{-e^{5t}\sin(t) & e^{5t}\cos(t)}$.
}
\fi
\end{exercises}
\EJECT
\subsection*{Chapter 6}

\begin{exercises}
\prob{1}{(Linear and Nonlinear Dynamical Systems)}
\newline
\BF{(a)} [20\%]
 Determine whether the unique equilibrium $\vec{u}=\vec{0}$ is stable or
unstable. Then classify the equilibrium point $\vec{u}=\vec{0}$ as a
saddle, center, spiral or node. Sub-classification into improper or proper node is not required.
 $$\frac{d}{dt}\vec{u}=\twobytwo{-1&1}{-2&1}\vec{u}$$
\\[2ex]
\BF{(b)} [30\%] Consider the nonlinear dynamical system
  $$\begin{array}{lcl}
  x'&=& x-2y^2-2y+32, \\
   y'&=& 2x(x-2y).
  \end{array}
 $$
 An equilibrium point is $x=-8$, $y=-4$. Compute
 the Jacobian matrix of the linearized system at this
 equilibrium point.
% f:=x-2*y*y-2*y+32;g:=2*x*(x-2*y); solve([f=0,g=0],[x,y]); [-8,4], [8,-4]
 \\[2ex]
\BF{(c)} [30\%] Consider the soft nonlinear spring system
  $\dd\left\{\begin{array}{lcl}
  x'&=& y, \\
   y'&=& -5x-2y+\frac54x^3.
  \end{array}\right.$\\
 %At equilibrium point $x=0$, $y=0$, the Jacobian matrix is
 %$A=J(0,0)=\left.\twobytwo{0&1}{-5+\frac{15}{4}x^3&-2}\right|_{x=0}=\twobytwo{0&1}{-5+\frac{15}{4}x^2&-2}$.
 %$\dd A=J(0,0)=\twobytwo{0&1}{-5&-2}$.
 \begin{quote}
   {\bf (1)}~~
  Determine the stability at $t=\infty$ and the phase portrait
  classification saddle, center, spiral
  or node at $\vec{u}=\vec{0}$ for the {\bf linear dynamical system} $\frac{d}{dt}\vec{u}=A\vec{u}$, where $A$ is the Jacobian matrix of this system at $x=2$, $y=0$.

   {\bf (2)}~~
  Apply the Pasting Theorem to classify $x=2$, $y=0$ as a saddle, center, spiral
  or node for the {\bf nonlinear dynamical system}. Discuss all details of the application of the theorem.
  {\em Details count 75\%}.

  % {\bf (3)}~~ Repeat the classification details of the previous two parts (1), (2) for the other two equilibrium points $(2,0), (-2,0)$, for which the Jacobian is
%$A=J(\pm2,0) = \twobytwo{0&1}{10&-2}$.
  \end{quote}

 \medskip

\BF{(d)} [20\%]  State the hypotheses and the conclusions of the {\em Pasting Theorem} used in part (c) above. Accuracy and completeness expected.

\bigskip
\ifsolutions
\vfill\eject
\Answer{~\\
in progress
\BF{Part (a)}~~ Answer: {\bf unstable saddle}.\\
It is an unstable saddle. Details: The eigenvalues of $A$ are roots of $r^2+2r-1=0$, which are real roots
$a=\sqrt2-1, b=-\sqrt2-1$ having opposite signs.
No rotation eliminates the center and spiral.
Finally, the atoms $e^a{t}$, $e^{bt}t$ have limit infinity, zero at $t=\infty$, therefore the system cannot be a node [nodes have limit $(0,0)$ at one of $t=\infty$ ot $t=-\infty$].
So it must be a saddle.
%A:=<-1,1|-2,1>^+;LinearAlgebra[Eigenvectors](A);
\\[2ex]
\BF{Part (b)}~~
% f:=x-2*y*y+2*y+32;g:=2*x*(x+2*y); solve([f=0,g=0],[x,y]); [-8,4], [8,-4]
% linalg[jacobian]([f,g],[x,y]);subs(x=-8,y=4,%);
The Jacobian is $J(x,y)=\twobytwo{0&1}{-5+\frac{15}{4}x^3&-2}$. Then $A=J(-8,4)=\twobytwo{0&1}{-5&-2}$.
\\[1ex]
\BF{Part (c)}~~\\
\BF{Solution (1)}~~\\
 The Jacobian is $J(x,y)=\twobytwo{0&1}{-5+\frac{15}{4}x^2&-2}$. Then
$A=J(0,0)=\twobytwo{0 & 1}{-5&-2}$. The eigenvalues of $A$ are found
from $r^2+2r+5=0$, giving complex conjugate roots
$-1\pm 2i$. Because trig functions appear in the Euler solution atoms,
then rotation happens, and the classification must be a center or a spiral. The Euler solution
atoms limit to zero at $t=\infty$, therefore it is a spiral and we report
a {\bf stable spiral} for the linear problem $\vec{u}'=A\vec{u}$ at
equilibrium $\vec{u}=\vec{0}$.
\\[2ex]
\BF{Solution (2)}~~\\ Theorem 2 in Edwards-Penney section 6.2 applies to say that
the same is true for the nonlinear system. Report: {\bf stable spiral} at $x=0$,
$y=0$. \\[2ex]
\BF{Solution (3)}~~\\
 The Jacobian is $J(x,y)=\twobytwo{0&1}{-5+\frac{15}{4}x^2&-2}$. Then
$A=J(\pm 2,0)=\twobytwo{0 & 1}{10&-2}$. The eigenvalues of $A$ are found
from $r^2+2r-10=0$, roots = $-1\pm\sqrt{11}$.  The Euler atoms are $e^{at}, e^{bt}$ where $a,b$ have opposite sign.
No rotation implies a node or a saddle. Because the atoms limit to $(\infty,0)$ at $t=\infty$, then the node is eliminated and the equilibrium is a saddle. The Pasting Theorem implies the saddle is transferred to the nonlinear phase portrait. Report: unstable saddle.
}
\fi
\end{exercises}
\EJECTEND
\end{document}
\endinput
