% 2015 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}}
\usepackage{linalg}
\newif\ifsolutions
\solutionstrue
%\solutionsfalse
\ifsolutions
\def\Answer#1{\rule{0.2\linewidth}{0.05em}\\ {\bf Answer}: {\sf #1} \par\rule{\linewidth}{0.1em}}
\else
\def\Answer#1{\relax}
\fi

\begin{document}
\thispagestyle{empty} 
%{\large\bf Name}
%\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
%%{{\bf Time of your class}~\underline{~~~~~~~~~~} }
{\large\bf Reference Exam 2 from Spring 2015, one year ago.\\ Edits have been made to the original exam.}
\def\EJECT{\SeparatedPages
{\vfill Use this page to start your solution.
Attach extra pages as needed, then staple.\newpage
\thispagestyle{empty} \hfill  2280 Exam 2 S2015 [edited for 2016]
%\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 2 from 2015\\
\small Exam Date: 3 April 2015 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. 

\begin{exercises}
\prob{1.}{(Chapter 3)} ~\newline
\BF{(a)} [70\%] Find 
the steady-state periodic solution for the spring-mass equation 
$$
\dd\frac{d^2x}{dt^2} + 2\frac{dx}{dt} + 10x = 85\cos(t).$$


\BF{(b)} [30\%] Solve for the general solution of the homogeneous constant-coefficient differential equation whose characteristic equation is 
$$r^2(r^2-r)^2(r^2+2r+5)^2=0.$$

\ifsolutions
\Answer{~\newline
\BF{(a)} The answer is $ \dd x_{\mbox{ss}}(t) = 9\cos t+2\sin t.$
\\
{\bf Details}. The trial solution by Rule I is $x(t)=d_1\cos t + d_2\sin t$. The homogeneous solutions
have exponential factors, therefore the Euler atoms in the trial solution cannot be solutions of the homogeneous problem, hence Rule II does not apply.
\\
Substitute the
trial solution into the non-homogeneous equation to obtain the answers $d_1=9$, $d_2=2$. The
unique periodic solution $x_{\mbox{ss}}$ is extracted from the
general solution $x=x_h+x_p$ by crossing out all negative
exponential terms (terms which limit to zero at infinity). Because
$x_p=d_1\cos t + d_2\sin t = 9\cos t + 2\sin t$ and the homogeneous solution $x_h$ has negative exponential terms, then
$$
x_{\mbox{ss}}=9\cos t + 2\sin t.
$$
% de:=diff(x(t),t,t)+2*diff(x(t),t)+10*x(t)=85*cos(t); dsolve(de,x(t));
\BF{(b)}
Write the characteristic equation as $r^4(r-1)^2(r^2+2r+5)^2=0$.
 Then $y$ is a linear combination of the atoms
 $1$, $x$, $x^2$, $x^3$, $e^{x}$, $xe^{x}$,
 $e^{-x}\cos 2x$, $xe^{-x}\cos 2x$,
 $e^{-x}\sin 2x$, $xe^{-x}\sin 2x$.
}
\fi

\end{exercises}
\EJECT
\begin{exercises}
\prob{2.}{(Chapters 1, 2, 3)} ~\newline

\BF{(a)} [40\%] Find the factors of the characteristic equation of a linear homogeneous constant coefficient differential equation of lowest order which has a particular solution 
$$y(x)=10 + 4\cos( 2 x) + 5xe^{x}\sin (x).$$

\BF{(b)} [60\%] Determine for differential equation
$$ \dd\frac{d^2y}{dx^2} + \frac{dy}{dx} =
x^2+xe^{-x}$$
 the shortest trial solution for
$y_p$ according to the method of undetermined coefficients. Do not
evaluate the undetermined coefficients!

\Answer{~\newline
\BF{(a)} The atoms that appear in  $y(x)=10 + 4\cos( 2 x) + 5xe^{x}\sin (x)$ are $1, \cos 2x, xe^{x}\sin x$. Derivatives of these atoms create a longer list:
 $1, \cos 2x, \sin 2x, e^{x}\cos x, e^{x}\sin x, xe^{x}\cos x, xe^{x}\sin x$. These atoms correspond to characteristic equation roots $0$; $2 i$, $-2 i$, $1+i$, $1-i$, $1+i$, $1-i$. Then the characteristic equation has factors $r$; $r^2+4$; $((r-1)^2+1)^2$. The product of these factors is the characteristic equation which corresponds to the differential equation of least order such that $y(x)$ is a solution. 
\newline
\BF{(b)} The homogeneous solution is a linear combination of the atoms $1$, $e^{-x}$
because the characteristic polynomial has roots $0$, $-1$.
\newline
{\bf Rule \fbox{1}~} An initial trial solution $y$ is constructed for
atoms $1$, $x$, $x^2$, $e^{-x}$, $xe^{-x}$ giving 2 groups, each group having the same base atom:
$$\begin{array}{lcl}
 y &=& y_1+y_2,\\
 y_1 &=& d_1+d_2x+d_3x^2,\\
 y_2 &=& d_4e^{-x}+d_5xe^{-x}.
\end{array}
$$
Linear combinations of the listed independent atoms are supposed
to reproduce, by specialization of constants, all derivatives of the
right side of the differential equation.
\newline
{\bf Rule \fbox{2}~} The correction rule is applied individually to each of
$y_1$, $y_2$.\newline
Multiplication by $x$ is done repeatedly, until the replacement atoms do not appear in
atom list for the homogeneous differential equation. The result is the {\bf shortest trial
solution}
$$ y = y_1+y_2=(d_1x+d_2x^2+d_3x^3) + (d_4 xe^{-x}) + (d_5x^2e^{-x}). $$
}
\end{exercises}
\EJECT

\begin{exercises}
\prob{3.}{(Laplace Theory)} ~\newline

\BF{(a)} [60\%] Assume $f(t)$ is of exponential order. Find $f(t)$ in the relation
$$\dd\left.\left(\frac{d^2}{ds^2}\L(f(t))\right)\right|_{s \to (s+4)}=\L(f(t))+\frac{s^2+2}{s^3+s}.$$

 \BF{(b)} [40\%] Find $\L(f)$ given $f(t)=e^{2t}\sin(3t)+(t+1)^2e^t$.


\Answer{~\\[1ex]
\BF{(a)} 
Replace by the shift theorem and the $s$-differentiation theorem the given equation by
$$\dd\L\left((-t)^2f(t)e^{-4t}\right)=\L(f(t))+\frac{s^2+2}{s^3+s}.$$
Partial fractions gives
$$\frac{s^2+2}{s^3+s}= \frac{a}{s} + \frac{bs+c}{s^2+1} = \L(a+b\cos(t)+c\sin(t)).$$
Then
$$\dd\L\left((-t)^2f(t)e^{-4t}\right)=\L(f(t) + a+b\cos(t)+c\sin(t)).$$
Then Lerch's theorem cancels $\L$ to give $t^2e^{-4t}f(t) = f(t)+ a+b\cos(t)+c\sin(t)$. Solve for
$$f(t) = \dd\frac{ a+b\cos(t)+c\sin(t)}{-1+t^2e^{-4t}}.$$
The partial fraction problem is solved by the sampling method: $a=2,b=-1,c=0$. Then
$$f(t) = \dd\frac{ 2-\cos(t)}{-1+t^2e^{-4t}}.$$
% convert((s^2+2)/(s^3+s),parfrac,s);
\\[1ex]
\BF{(b)} Write $f=f_1+f_2$ where $f_1(t)=e^{2t}\sin(3t)$ and $f_2(t)=(t+1)^2e^t$. Then the first shifting theorem implies \\
$\dd\L(f_1) = \left.\L(\sin 3t)\right|_{s:=s-2}$\\
$\dd\phantom{\L(f_1)} =\left.\frac{3}{s^2+9}\right|_{s:=s-2}$\\
$\dd\phantom{\L(f_1)} =\frac{3}{(s-2)^2+9}$.\\
The first shifting theorem also applies to the exponential factor in $f_2$: 
\\
$\dd\L(f_2(t)) = \left.\L((t+1)^2)\right|_{s:=s-1}$\\
$\dd\phantom{\L(f_2(t))} = \left.\L(t^2+2t+1)\right|_{s:=s-1}$\\
$\dd\phantom{\L(f_2(t))}=\left.\left(\frac{2}{s^3}+\frac{2}{s^2}+\frac{1}{s}\right)\right|_{s:=s-1}$\\
$\dd\phantom{\L(f_2(t))}= \frac{2}{(s-1)^3}+\frac{2}{(s-1)^2}+\frac{1}{s-1}$\\
Then \\
$\dd \L(f(t)) = \L(f_1(t))+\L(f_2(t)) = \frac{3}{(s-2)^2+9} + \frac{2}{(s-1)^3}+\frac{2}{(s-1)^2}+\frac{1}{s-1}$.
% inttrans[laplace](exp(2*t)*sin(3*t)+(t+1)^2*exp(t),t,s);
}
\end{exercises}
\EJECT
\begin{exercises}
\prob{4.}{(Laplace Theory)} ~\newline
  \BF{(a)} [40\%] The solution of $x'''+x'=0$, $x(0)=1$, $x'(0)=0$, $x''(0)=0$ is $x(t)=1$. Show the details in
 Laplace's Method for obtaining this answer.

\BF{(b)} [60\%] Solve the system $x'=x-y$, $y'=x+y+2$, $x(0)=0$, $y(0)=0$
 by Laplace's Method.


\Answer{~\newline
\BF{(a)} The answer is $x(t)=1$, by guessing, then checking the answer. Laplace details for Panel 1 end with equation
$\dd (s^3+s)\L(x(t))=s^2+1$. Panel 2 begins with the division $\L(x(t))=\dd\frac{s^2+1}{s(s^2+1)}=\frac{1}{s}$. The backward table supplies $\dd\frac{1}{s}=\L(1)$. Lerch's cancelation theorem implies $x(t)=1$.
% de:=diff(x(t),t,t,t)+diff(x(t),t)=0;ic:=x(0)=1,D(x)(0)=0,D(D(x))(0)=0;dsolve({de,ic},x(t));
\\
\BF{(b)} The transformed system is
$$\begin{array}{rcrcl}
(s-1)\L(x) &+& (1)\L(y) &=& 0,\\
(-1)\L(x) &+& (s-1)\L(y) &=& \L(2).
\end{array}
$$
Then forward table entry $\L(1)=1/s$ and Cramer's Rule gives the formulas
$$\dd \L(x) = \frac{-2}{s((s-1)^2+1)},\quad \L(y) = \frac{2s-2}{(s-1)^2+1}.
$$
% des:=diff(x(t),t)=x(t)-y(t), diff(y(t),t)=x(t)+y(t)+1;ic:=x(0)=0,y(0)=0;
% dsolve({des,ic},{x(t),y(t)})
% # {x(t) = -1+(cos(t)-sin(t))*exp(t), y(t) = -1+(cos(t)+sin(t))*exp(t)}}
After partial fractions and the backward table,
$$ x = -1 + e^t\cos t - e^t\sin t ,\quad y = -1 + e^t\cos t + e^t\sin t.$$
}
\end{exercises}
\EJECT
\begin{exercises}
\prob{5.}{(Laplace Theory)} ~\\[1pc]
  Define $\cosh(u)=\dd\frac12\left(e^u+e^{-u}\right)$ and $\sinh(u)=\dd\frac12\left(e^u-e^{-u}\right)$. \\[1pc]
Compute $\dd\L\left(\frac{\sinh(2t)}{t}\right)$

\Answer{~\newline
Let $f(t) = \dd\frac{\sinh(2t)}{t}$. Then $tf(t)=\sinh(2t)=\dd\frac{e^{2t}-e^{-2t}}{2}$.\\
 Multiply by $2$:\\
$\dd \L(2tf(t))=\L\left(e^{2t}-e^{-2t}\right) = \frac{1}{s-2}-\frac{1}{s+2}$.
\\
The $s$-differentiation theorem implies\\
$\dd -\frac{d}{ds}\L(2tf(t)) = \frac{1}{s-2}-\frac{1}{s+2}$.
\\
Then $F(s)=\L(2f(t))$ satisfies a first order quadrature equation $F'(s) = h(s)$ with solution\\
$F(s)=\ln|s+2|-\ln|s-2|+c=\ln\left| \frac{s+2}{s-2}\right| + c$\\
for some constant $c$. Because $F=0$ at $s=\infty$ (the Final Value Theorem for functions of exponential order) and $\ln|1|=0$, then $c=0$ and \\
$\L(2f(t))=F(s)=\ln|s+2|-\ln|s-2|=\ln\left| \frac{s+2}{s-2}\right| $.\\
The answer is
$$ \dd\L\left(\frac{\sinh(2t)}{t}\right)= \frac12\ln\left| \frac{s+2}{s-2}\right|.$$
}
\end{exercises}
\EJECT



\begin{exercises}
\prob{6.}{(Systems of Differential Equations)}
\newline
Let
$A=\left(\begin{array}{rrrr}
 5 & 1   \\
 1 & 5
 \end{array}\right)$. The eigenvalues of $A$ are $4$, $6$.
%with(linalg):
%C:=matrix([[5,1],[1,5]]); eigenvals(C);

\BF{(a)} [30\%] Find all entries of the $2\times 2$ exponential matrix $e^{At}$ according to Putzer's
spectral formula. {\bf This problem will not be on Exam 2 in 2016}, due to the topic being covered later in the course.

\BF{(b)} [40\%] 
 Display the solution
of $\.u'=A\.u$, $\vec{u}(0) = \colvector{1\\ -1}$, according to the Cayley-Hamilton-Ziebur shortcut.
The scalar form of the system is
$$\left\{
\begin{array}{lcrcl}
x'(t) &=& 5x(t)&+&y(t),\\
y'(t) &=& x(t)&+&5y(t),\\
x(0) &=& 1, \\
y(0) &=& -1.
\end{array}\right.
$$

\BF{(c)} [30\%] The eigenpairs of a $3\times 3$ matrix $C$ are
$$\left(0,\colvector{1\\ 1\\ 0}\right),\quad
\left(1,\colvector{1\\ 1\\ 1}\right),\quad
\left(2,\colvector{0\\ 1\\ 2}\right).$$
Display the general solution of $\.u'=C\.u$ by the eigenanalysis method. Please use symbols $c_1,c_2,c_3$ for the constants that appear in the general solution.

\Answer{~\newline
\BF{(a)}  The Putzer formula details:
$$\dd e^{At}=e^{4t}I + \frac{e^{4t}-e^{6t}}{4-6}(A-4I)$$
% Functions $r_1$, $r_2$ are computed from $r_1'=4r_1$, $r_1(0)=1$, $r_2'=6r_2+r_1$, $r_2(0)=0$.
$$\dd e^{At}=e^{4t}\twobytwo{1&0}{0&1} + \frac{e^{6t}-e^{4t}}{2}\twobytwo{1&1}{1&1}$$
$$ e^{At} =  \frac12\left( \begin {array}{cc} {{\rm e}^{6\,t}}+{{\rm e}^{4\,t}}
&{{\rm e}^{6\,t}}-{{\rm e}^{4\,t}}\\\noalign{\medskip}{
{\rm e}^{6\,t}}-{{\rm e}^{4\,t}}&{{\rm e}^{6\,t}}+{
{\rm e}^{4\,t}}\end {array} \right).$$
% C:=Matrix([[5,1],[1,5]]); linalg[eigenvals](C); LinearAlgebra[MatrixExponential](C,t);
%
\BF{(b)} The Cayley-Hamilton-Ziebur method says that in the scalar system the components $x(t), y(t)$ are linear combinations of the atoms found from the roots of the characteristic equation $|C-rI|=0$. The roots are $r=4,6$ and the atoms are $e^{4t}, e^{6t}$. Then
$$x(t) = c_1 e^{4t} + c_2 e^{6t}.$$
Solve the differential equation $x'=5x+y$ for $y=x'-5x$. Substitute the expression $x(t)=c_1 e^{4t} + c_2 e^{6t}$ to obtain the equation
$$ y(t) = x'-5x = 4c_1 e^{4t} + 6c_2 e^{6t} - 5(c_1 e^{4t} + c_2 e^{6t})= -c_1 e^{4t} + c_2 e^{6t}.$$
Then the answer in terms of symbols $c_1,c_2$ is
$$x(t)=c_1 e^{4t} + c_2 e^{6t},\quad y(t)=-c_1 e^{4t} + c_2 e^{6t}.$$
The equations that determine $c_1,c_2$ are $x(0)=1,y(0)=-1$. Substitution into the solution above (set $t=0$) gives the linear system of equations
$$1=c_1 e^{0} + c_2 e^{0},\quad -1=-c_1 e^{0} + c_2 e^{0}.$$
Then $c_1=1, c_2=0$ and the answer is
$$x(t)=e^{4t},\quad y(t)=- e^{4t}.$$
%des:=diff(x(t),t)=5*x(t)+y(t), diff(y(t),t)=x(t)+5*y(t);ic:=x(0)=1,y(0)=-1;
% dsolve({des,ic},{x(t),y(t)});
%
\BF{(c)}  The eigenanalysis method implies the general solution
$$\vec{u}(t) = c_1e^{0t}\colvector{1\\ 1\\ 0}+
c_2e^t\colvector{1\\ 1\\ 1}+
c_3e^{2t}\colvector{0\\ 1\\ 2}.$$
{\bf Remark}. If given initial condition $\vec{u}(0)=\colvector{1\\ -1\\ 1}$, then symbols $c_1,c_2,c_3$ are determined from the linear algebraic equations (set $t=0$ in the previous display)
$$\colvector{1\\ -1\\ 1} = c_1e^0\colvector{1\\ 1\\ 0}+
c_2e^0\colvector{1\\ 1\\ 1}+
c_3e^0\colvector{0\\ 1\\ 2}.$$
The answer is $c_1=-4,c_2=5,c_3=-2$. Then the solution of $\vec{u}\,' = C\vec{u}$, 
$\vec{u}(0)=\colvector{1\\ -1\\ 1}$ is 
$$\vec{u}(t) = \colvectorC{-4+5e^t \\ -4 + 5e^t - 2e^{2t} \\ 5e^t - 4e^{2t}}.$$
% W:=<1,1,0|1,1,1|0,1,2>;LinearAlgebra[LinearSolve](W,<1,-1,1>);
}
\end{exercises}
\EJECTEND

\end{document}
\endinput
