% 2016 Differential Equations 2280-2
\documentclass[12pt,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{\vec{\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}}
%\def\SeparatedPages#1{\relax}
\else
\def\Answer#1{\relax}
\fi

\begin{document}
\thispagestyle{empty}
{\large\bf Name}
\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
%{{\bf Time of your class}~\underline{~~~~~~~~~~} }
\def\EJECT{\SeparatedPages
{\vfill Start your solution on this page.
\newpage
\thispagestyle{empty} \hfill  2280 Exam 2 S2016
%\newline{\large\bf Name}.
%\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
}
}
%%% {\bf Time of your class}~\underline{~~~~~~~~~~} }
\def\EJECTEND{\SeparatedPages{\vfill Start your solution on this page.
\eject}}
%\def\EJECT{}\def\EJECTEND{}

\begin{center}\Large\bf
Differential Equations 2280 \\
\small Midterm Exam 2\\
\small Exam Date: 1 April 2016 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 1)} ~\newline
\BF{(a)} [30\%] Solve $y'+2y=3$.

\BF{(b)} [30\%] Solve $y'+2xy=0$.

\BF{(c)} [40\%] Solve $y'+y=2e^x$.

\ifsolutions
\Answer{~\newline
\BF{(a)} Solution by superposition shortcut for constant cefficient equations: $y_h=c/e^{2x}$, $y_p=3/2$, $y=y_h+y_p$.
\\
\BF{(b)} Solution by homogeneous equation shortcut: $y=c/e^{x^2}$.
\\
\BF{(c)} Solution by the integrating factor method: $Q=e^x$ is the integrating factor. Then $(yQ)'/Q=2e^x$ implies
$yQ=\int 2Qe^xdx=\int 2e^{2x}dx=e^{2x}+c$. The answer is $y=e^x + c/e^x$.
}
\fi

\end{exercises}
\EJECT
\begin{exercises}
\prob{2.}{(Chapter 3)} ~\newline

\BF{(a)} [30\%] 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 + 5xe^{x}\sin (x)+xe^{-x}.$$

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

\BF{(c)} [30\%] Find
the steady-state periodic solution for the spring-mass equation
$$
\dd\frac{d^2x}{dt^2} + 2\frac{dx}{dt} + 17x = 130\cos(t),$$
given a particular solution
$$
x( t) =4{{\rm e}^{-t}}\sin \left( 4\,t \right) +
5{{\rm e}^{-t}}\cos \left( 4\,t \right)+\sin \left( t
 \right) +8\,\cos \left( t \right)
$$

\Answer{~\newline
\BF{(a)} The atoms that appear in  $y(x)=10 + 5xe^{x}\sin (x) + xe^{-x}$ are $1, xe^{x}\sin x, xe^{-x}$. Derivatives of these atoms create a longer list:
 $1, e^{x}\cos x, e^{x}\sin x, xe^{x}\cos x, xe^{x}\sin x, e^{-x}, xe^{-x}$. These atoms correspond to characteristic equation roots $0$;  $1+i$, $1-i$, $1+i$, $1-i$; $-1$, $-1$. Then the characteristic equation has factors $r$; $((r-1)^2+1)^2; (r+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 the
atoms of $f(x)=x^3+e^{-x}+\cos x$ and its derivatives. The list of Euler solution atoms is $1$, $x$, $x^2$, $x^3$, $e^{-x}$, $\cos x$, $\sin x$ giving 4 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+d_4x^3,\\
 y_2 &=& d_5e^{-x},\\
 y_3 &=& d_6\cos x,\\
 y_4 &=&  d_7 \sin x.
\end{array}
$$
Linear combinations of the listed independent Euler solution 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$, $y_3$, $y_4$.\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_4x^4) + (d_5xe^{-x}) + (d_6\cos x) + (d_7\sin x). $$
{\small\rm The general solution of the differential equation according to Maple is
$$
y \left( x \right) =1/4\,{x}^{4}-{x}^{3}+3\,{x}^{2}+1/2\,\sin \left( x
 \right) -1/2\,\cos \left( x \right) -{{\rm e}^{-x}}x-{{\rm e}^{-x}}
-6\,x+c_1{\rm e}^{-x} + c_2.
$$
}
%
\BF{(c)} The answer is $ \dd x_{\mbox{ss}}(t) = 8\cos t+\sin t.$ This result is obtained by
cross-out of the terms that limit to zero at infinity, namely, all terms with a factor of $e^{-t}$. This finishes the solution steps. Included below is the solution by the method of undetermined coefficients, for the few instances in which that path was taken to solve the problem (not recommended).
\\
{\bf Undetermined Coefficient 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=8$, $d_2=1$ (steps omitted here). 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 = 8\cos t + \sin t$ and the homogeneous solution $x_h$ has negative exponential terms, then
$$
x_{\mbox{ss}}=8\cos t + \sin t.
$$
% de:=diff(x(t),t,t)+2*diff(x(t),t)+17*x(t)=130*cos(t); dsolve(de,x(t));
}
\end{exercises}
\EJECT

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

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

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


\Answer{~\\[1ex]
\BF{(a)}
Replace by the shift theorem and the $s$-differentiation theorem the given equation by
$$\dd\L\left((-t)f(t)e^{-5t}\right)=\frac{1}{s^2}+\frac{1}{(s+2)^2}.$$
Then
$$\dd\L\left((-t)f(t)e^{-5t}\right)=\L(t)+\L(te^{-2t}).$$
Then Lerch's theorem cancels $\L$ to give $(-t)e^{-5t}f(t) = t+te^{-2t}$. Solve for
$$f(t) = -\dd\frac{t+te^{-2t}}{te^{-5t}}.$$
Then
$$f(t) = -e^{5t} - e^{3t}.$$
% 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(t)$ and $f_2(t)=(e^t+e^{-t})^2=e^{2t}+2+e^{-2t}$. Then the first shifting theorem implies \\
$\dd\L(f_1) = \left.\L(\sin t)\right|_{s:=s-2}$\\
$\dd\phantom{\L(f_1)} =\left.\frac{1}{s^2+1}\right|_{s:=s-2}$\\
$\dd\phantom{\L(f_1)} =\frac{1}{(s-2)^2+1}$.\\
The details for $f_2$:
\\
$$\dd\L(f_2(t)) = \L(e^{2t}+\L(2)+\L(e^{-2t})=
\frac{1}{s-2}+\frac{2}{s}+\frac{1}{s+2}.$$
The
$$\dd \L(f(t)) = \L(f_1(t))+\L(f_2(t)) = \frac{1}{(s-2)^2+1} + \frac{1}{s-2}+\frac{2}{s}+\frac{1}{s+2}.$$
% inttrans[laplace](exp(2*t)*sin(t)+(exp(t)+exp(-t))^2,t,s);
}
\end{exercises}
\EJECT
\begin{exercises}
\prob{4.}{(Laplace Theory)} ~\newline
  \BF{(a)} [30\%] The solution of $x''+x'=0$, $x(0)=1$, $x'(0)=0$ is $x(t)=1$. Show the details in Laplace's Method for obtaining this answer.

\BF{(b)} [40\%] Solve the system $x'=x-y$, $y'=y+2$, $x(0)=0$, $y(0)=0$
 by Laplace's Method. Check the answer for $y$ by the superposition shortcut for linear equations with constant coefficients.

\BF{(c)} [30\%] Find the Laplace transform of the convolution of $f(t)=e^t$ and $g(t)=t\cos t$.

\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^2+s)\L(x(t))=s+1$. Panel 2 begins with the division $\L(x(t))=\dd\frac{s+1}{s(s+1)}=\frac{1}{s}$. The backward table implies $\dd\frac{1}{s}=\L(1)$. Lerch's cancelation theorem applies to give $x(t)=1$.
% de:=diff(x(t),t,t)+diff(x(t),t)=0;ic:=x(0)=1,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,\\
(0)\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)},\quad \L(y) = \frac{2s-2}{s(s-1)^2}.
$$
% de:=diff(x(t),t)=x(t)-y(t),diff(y(t),t)=y(t)+2,x(0)=0,y(0)=0;
% dsolve({de},{x(t),y(t)})
% # {x(t) = -2+exp(t)*(-2*t+2), y(t) = -2+2*exp(t)}
Use partial fractions:
$$\dd \L(x) = \frac{a}{s}+\frac{b}{s-1}+\frac{c}{(s-1)^2)},\quad a=-2,b=2,c=-2,$$
$$\L(y) = \frac{2}{s(s-1)}=\frac{a}{s}+\frac{b}{s-1},\quad a=-2, b=2.
$$
The backward table implies
$$ x = -2 + 2(1-t)e^t ,\quad y = -2+2e^t.$$
{\bf Answer check}. The superposition shortcut applied to $y'-y=2$ gives $y=y_h+y+p$ where $y_h=c/e^{-t}$ and $y_p=-2$. Then $c=2$ from $y(0)=0$ and $y=-2+2e^t$.
\\
\BF{(c)} By the convolution theorem, the answer is the product of the Laplace transforms of $f$ and $g$:
$$\mbox{Laplace of the convolution}=\L(e^t)\L(t\cos t)$$
Because the $s$-differentiation theorem applies to give $\L(t\cos t)=-\frac{d}{ds}\L(\cos t)$, then the answer is
$$\frac{1}{s-1}\frac{d}{ds}\frac{-s}{s^2+1}=
\frac {s^2-1}{( s-1)(s^2+1)^2}.
$$
%% inttrans[laplace](exp(t),t,s)*inttrans[laplace](t*cos(t),t,s);
}
\end{exercises}
\EJECT


\begin{exercises}
\prob{5.}{(Systems of Differential Equations)}
\newline
The eigenvalues of
$A=\left(\begin{array}{rrrr}
 4 & 1   \\
 1 & 4
 \end{array}\right)$ are $3$, $5$ with corresponding eigenvectors
 $\colvector{-1\\ 1}$, $\colvector{1\\ 1}$.
%with(LinearAlgebra):C:=Matrix([[4,1],[1,4]]); Eigenvectors(C);

\BF{(a)} [20\%]
Display the general solution of $\.u'=A\.u$ by the eigenanalysis method. Please use symbols $c_1,c_2$ for the constants that appear in the general solution.


\BF{(b)} [50\%]
 Display the details for 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) &=& 4x(t)&+&y(t),\\
y'(t) &=& x(t)&+&4y(t),\\
x(0) &=& 1, \\
y(0) &=& -1.
\end{array}\right.
$$
Please observe that the initial conditions evaluate constants, therefore the answer for (b) does not contain symbols $c_1,c_2$.

\BF{(c)} [30\%] 
A fundamental matrix $\Phi(t)$ for $\.u'=A\.u$ is a $2\times 2$ invertible matrix such that $\Phi'(t)=A\Phi(t)$. Using the answer from either (a) or (b), find one fundamental matrix $\Phi(t)$ for the system $\.u' = \left(\begin{array}{rrrr}
 4 & 1   \\
 1 & 4
 \end{array}\right)\.u$.

\Answer{~\newline
\BF{(a)}  The eigenanalysis method implies the general solution is
$$\vec{u}(t) = c_1e^{3t}\colvector{-1\\ 1}+
c_2e^{5t}\colvector{1\\ 1}.$$
\BF{(b)} The Cayley-Hamilton-Ziebur method says that in the scalar system the components $x(t), y(t)$ are linear combinations of the Euler solution atoms found from the roots of the characteristic equation $|C-rI|=0$. The roots are $r=3,5$ and the atoms are $e^{3t}, e^{5t}$. Then
$$x(t) = c_1 e^{3t} + c_2 e^{5t}.$$
Solve the differential equation $x'=4x+y$ for $y=x'-4x$. Substitute the expression $x(t)=c_1 e^{3t} + c_2 e^{5t}$ to obtain the equation
$$ y(t) = x'-4x = 3c_1 e^{3t} + 5c_2 e^{5t} - 4(c_1 e^{3t} + c_2 e^{5t})= -c_1 e^{3t} + c_2 e^{5t}.$$
Then the answer in terms of symbols $c_1,c_2$ is
$$x(t)=c_1 e^{3t} + c_2 e^{5t},\quad y(t)=-c_1 e^{3t} + c_2 e^{5t}.$$
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^{3t},\quad y(t)=- e^{3t}.$$
%des:=diff(x(t),t)=4*x(t)+y(t), diff(y(t),t)=x(t)+4*y(t);ic:=x(0)=1,y(0)=-1;
% dsolve({des,ic},{x(t),y(t)});
%
\BF{(c)}  The columns of the matrix $\Phi$ are independent solutions of the system $\.u'=A\.u$. These columns can be found from any general solution by differentiation on the symbols $c_1,c_2$. Therefore, by {\bf (a)}, one possible fundamental matrix is
$$\Phi(t)=\twobytwo{-e^{3t}&e^{5t}}{e^{3t}&e^{5t}}.$$
}
\end{exercises}
\EJECTEND

\end{document}
\endinput
