\documentclass[12pt]{article}
\usepackage{linalg}
\setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.4in} \setlength{\textheight}{8.5in}
\setlength{\parskip}{5pt} \setlength{\topmargin}{0pt}
\setlength{\parindent}{0pt}
%\newenvironment{exercises}{\begin{list}{}{}}{\end{list}}
\newenvironment{solution}[1]{\protect\par{\bf Notes on 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{{\bf #1}}
\newif\ifsolutions
\solutionsfalse

\begin{document}
\thispagestyle{empty} 
%{\large\bf Name}.
%\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
%\hfill%{\large\bf Section}. \underline{~~~~~~~~~~~~~~~~~}
\def\EJECT{\SeparatedPages{\vfill Use this page to start your solution.
Attach extra pages as needed, then staple.\eject
\thispagestyle{empty} {\large\bf Name}.
\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} \hfill
Midterm 2 2280 4:30}}
\def\EJECTEND{\SeparatedPages{\vfill Use this page to start your solution.
Attach extra pages as needed, then staple.\eject}}

\begin{center}\Large\bf
Differential Equations 2280\\
Midterm Exam 2\\
Thursday, 30 March 2006 
\end{center}

{\bf Instructions}: This in-class exam is 50 minutes. No
calculators, notes, tables or books.
No answer check is expected.
Details count $75$\%. The answer counts $25$\%.

\EJECT

\begin{exercises}
\prob{1.}{(ch3)} ~\newline
(a) Using the {\em recipe} for higher order
constant-coefficient differential equations, write out the general
solutions:

 $ \begin{array}{ll} {\bf (a.1)} ~[25\%] & y'' + 4y' + 4y=0 \end{array}$,

 $\begin{array}{ll} {\bf (a.2)} ~[25\%] & y^{vi} + 4y^{iv} = 0
 \end{array}$,

$\begin{array}{ll} {\bf (a.3)} ~[25\%] & \mbox{Char. eq. ~}
 r(r-3)(r^3-9r)^2(r^2+4)^3=0
 \end{array}$.

(b)  Given $6x''(t) + 7x'(t) + 2x(t) = 0$, which
represents a damped spring-mass system with $m=6$, $c=7$, $k=2$,
solve the differential equation [15\%] and classify the answer as
over-damped, critically damped or under-damped [5\%]. Illustrate
in a physical model drawing the meaning of constants $m$, $c$, $k$
[5\%].

\ifsolutions
\begin{solution}{1} ~\newline
Part (a)\newline
 {\bf 1}: $r^2+r+1=0$, $y=c_1y_1+c_2y_2$, $y_1=e^{-x/2}\cos(\sqrt3
x/2)$, $y_2=e^{-x/2}\sin(\sqrt3 x/2)$.\newline
 {\bf 2}: $r^{iv}+4r^2=0$, roots $r=0,0,2i,-2i$. Then
 $y=(c_1+c_2x)e^{0x}+c_3\cos 2x + c_4\sin 2x$. \newline
 {\bf 3}: Write as $(r-a)^2(r+a)^2(r^2+16)^3=0$ where $a=\sqrt3$.
 Then $y=u_1e^{ax}+u_2e^{-ax}+u_3\cos 4x + u_5\sin 3x$. The
 polynomials are $u_1=c_1+c_2x$, $u_2=c_3+c_4x$,
 $u_3=c_5+c_6x+c_7x^2$, $u_4=c_8+c_9x+c_{10}x^2$.

Part (b)\newline
Use $4r^2+4r+1=0$ and the quadratic formula to obtain roots
$r=-1/2,-1/2$. Case 2 of the recipe gives $y=(c_1+c_2t)e^{-t/2}$.
This is critically damped. The illustration shows a spring,
dampener and mass with labels $k$, $c$, $m$, $x$ and the
equilibrium position of the mass.
\end{solution}
\fi

\end{exercises}
\EJECT

\begin{exercises}
\prob{2.}{(ch3)} ~\newline
Determine for $ y^{vi} + y^{iv} = x+2x^2+ x^3 +
e^{-x}+x\sin x$ the corrected trial solution for $y_p$ according
to the method of undetermined coefficients. Do not evaluate the
undetermined coefficients!

\ifsolutions
\begin{solution}{2} ~\newline
The homogeneous solution is $y_h=c_1+c_2x+c_3e^{3x}+c_4e^{-3x}$,
because the characteristic polynomial has roots $0$, $0$, $3$,
$-3$.

{\bf \fbox{1}~} An initial trial solution $y$ is constructed for
atoms $1$, $x$, $e^{3x}$, $e^{-3x}$, $\cos x$, $\sin x$ giving
$$\begin{array}{lcl}
 y &=& y_1+y_2+y_3+y_4,\\
 y_1 &=& (d_1+d_2x)e^{3x},\\
 y_2 &=& d_3+d_4x+d_5x^2+d_6x^3,\\
 y_3 &=& d_7e^{-3x},\\
 y_4 &=& d_8\cos x + d_9\sin x.
\end{array}
$$
Linear combinations of the listed independent atoms are supposed
to reproduce, by assignment of constants, all derivatives of the
right side of the differential equation.

{\bf \fbox{2}~} The fixup rule 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_1 &=& x(d_1+d_2x)e^{3x},\\
 y_2 &=& x^2(d_3+d_4x+d_5x^2+d_6x^3),\\
 y_3 &=& x(d_7e^{-3x}),\\
 y_4 &=& d_8\cos x + d_9\sin x.
\end{array}
$$
The powers of $x$ multiplied in each case are designed to
eliminate terms in the initial trial solution which duplicate
atoms appearing in the homogeneous solution $y_h$. The factor 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$. By design,
unrelated atoms are unaffected by the fixup rule, and that is why
$y_4$ was unaltered.

{\bf \fbox{3}~} Undetermined coefficient step skipped, according
to the problem statement.

{\bf \fbox{4}~} Undetermined coefficient step skipped, according
to the problem statement.


\end{solution}
\fi

\end{exercises}
\EJECT

\begin{exercises}        
\prob{3.}{(ch3)} ~\newline
(a) [50\%] Find by undetermined
coefficients the steady-state periodic solution for the equation $
x'' + 4x' + 6x = 10\cos(2t)$.
\newline
(b) [50\%] Find by variation of parameters a particular solution $y_p$ for the equation
$y''+3y'+2y=xe^{2x}$.

\ifsolutions
\begin{solution}{3} ~\newline
Solve $x''+2x'+6x=0$ by the recipe to get $x_h=c_1x_1+c_2x_2$,
$x_1=e^{-t}\cos\sqrt5 t$, $x_2=e^{-t}\sin\sqrt5 t$.  Compute the
Wronskian $W=x_1x_2'-x_1'x_2=\sqrt5 e^{-2t}$. Then for
$f(t)=5\cos(3t)$,
$$
 x_p=x_1\int x_2\frac{-f}{W}dt+x_2\int x_1\frac{f}{W}dt.
 $$
 The integrations are horribly difficult, so the
 method of choice is undetermined coefficients.

The trial solution is $x=d_1\cos 3t + d_2\sin 3t$. Substitute the
trial solution to obtain the answers $d_1=-1/3$, $d_2=2/3$. 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). If
$x_p=d_1\cos 3t + d_2\sin 3t = (1/3)(-\cos 3t + 2\sin 3t)$, then
$$
x_{\mbox{ss}}=\frac{-1}{3}\cos 3t + \frac{2}{3}\sin 3t.
$$
\end{solution}
\fi

\end{exercises}
\EJECT

\begin{exercises}
\prob{4.}{(ch5)} ~\newline
 The eigenanalysis method says that the 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}$. In the
solution formula, $(\lambda_i,\.v_i)$, $i=1,2,3$, is an eigenpair
of $A$.  Given
$$A=\left[\begin{array}{rrr}
 5 & 1 &  1  \\
 1 & 5 &  1  \\
 0 & 0 &  7
 \end{array}\right],$$
 then \newline
 (a) [75\%] Display eigenanalysis details for $A$. \newline
 (b) [25\%] Display the solution $\.x(t)$ of $\.x'(t)=A\.x(t)$.


\ifsolutions
\begin{solution}{4} ~\newline
Answer (1): The eigenpairs are
$$
 5,  \colvector{1\\ 1\\ 0};\quad 4, \colvector{-1\\ -1\\ 1};\quad
  3, \colvector{1\\ -1\\ 0}.
$$
Answer (2): The eigenanalysis method implies
$$
\.x(t)=c_1e^{5t}  \colvector{1\\ 1\\ 0}+ c_2e^{ 4t} \colvector{-1\\ -1\\
1}+ c_3e^{3t} \colvector{1\\ -1\\ 0}.
$$
\end{solution}
\fi


\end{exercises}
\EJECT

\begin{exercises}
\prob{5.}{(ch5)} ~\newline
(a) [40\%]  Find the eigenvalues of the matrix
$A=\left[\begin{array}{rrrr}
 4 & 1 & -1 & 0 \\
 1 & 4 & -2 & 1 \\
 0 & 0 &  2 & 0 \\
 0 & 0 &  2 & 4
 \end{array}\right]$.
%with(linalg):
%B:=matrix([[4,1,-1,0],[1,4,-2,1],[0,0,2,0],[0,0,2,4]]);
%eigenvals(B);
%dsolve({diff(y(x),x)=2*y(x),y(0)=1},y(x));
%dsolve({diff(y(x),x)=3*y(x)+exp(2*x),y(0)=0},y(x));
%dsolve({diff(y(x),x)=4*y(x)+(-exp(-x)+1)*exp(3*x),y(0)=0},y(x));
%dsolve({diff(y(x),x)=5*y(x)+(1/2*exp(-2*x)-exp(-x)+1/2)*exp(4*x),y(0)=0},y(x));

(b) [60\%] Display the general solution of $\.u'=A\.u$ according to Putzer's
spectral formula. Don't expand matrix products, in order to save time.
However, do compute the coefficient functions $r_1$, $r_2$, $r_3$, $r_4$.
 The correct answer for $r_4$, using $\lambda$ in increasing magnitude,
is 
$ y(x) = -\frac16 e^{2x}+\frac12 e^{3x}-\frac12 e^{4x}+\frac16 e^{5x}$.

\ifsolutions
\begin{solution}{5} ~\newline
(a) Subtract $\lambda$ from the diagonal elements of $A$ and expand
the determinant $\det(A-\lambda I)$ to obtain the characteristic
polynomial $(1-\lambda)(1-\lambda)(4-\lambda)(1-\lambda)=0$. The
eigenvalues are the roots: $\lambda=1,1,1,4$. Used here was the
{\em cofactor rule} for determinants. Sarrus' rule does not apply
for $4\times 4$ determinants (an error) and the triangular rule
likewise does not directly apply (another error).

% exp(t), t*exp(t), 1/2*t^2*exp(t), 
% 1/27*exp(4*t)-1/27*exp(t)-1/9*t*exp(t)-1/6*t^2*exp(t)])

(b) Let
$$B=\left[\begin{array}{rrrr}
 1 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 \\
 0 & 1 &  1 & 0 \\
 0 & 0 &  1 & 4
 \end{array}\right].$$
Define functions $r_1$, $r_2$, $r_3$, $r_4$ to be the components of the
vector solution $\.r(t)$ to the initial value problem 
$$\.r'=B\.r,\quad \.r(0)=\colvector{1\\ 0\\ 0\\ 0}.$$
Solving, 
$$ r_1=e^t,\quad r_2=te^t, \quad r_3=t^2e^t/2,$$
$$ r_4=\frac{1}{27}e^{4t} - \frac{1}{27}e^t - \frac{1}{9}te^t - \frac{1}{6}t^2e^t.$$
Define
$$P_1=I,\quad P_2=A-I,\quad P_3=(A-I)^2, \quad P_4=(A-I)^3.$$
Then $ \.u=\left(r_1P1+r_2P_2+r_3P_3+r_4P_4\right)\.u_0$ implies
$$ \.u=\left(r_1I+r_2(A-I)+r_3(A-I)^2+r_4(A-I)^3\right)\.u_0$$
\end{solution}
\fi
\end{exercises}
\EJECTEND

\end{document}
\endinput
