\documentclass[leqno,11pt]{article}
 \setlength{\textheight}{10.4in}
 \setlength{\topmargin}{-1in}
 \setlength{\headheight}{0in}
 \setlength{\topsep}{0in}
 \setlength{\marginparwidth}{0in}
 \setlength{\marginparsep}{0in}
 \setlength{\oddsidemargin}{0in}
 \setlength{\evensidemargin}{0in}
 \setlength{\textwidth}{6.4in}
 \setlength{\parskip}{4pt}
 \setlength{\parindent}{0pt}
\usepackage{quiz}
\usepackage{alltt}
\usepackage{../../email}
\usepackage{hyperref}
\usepackage{graphicx}
\def\L{{\cal L}}
\begin{document}
\section*{Sample Quiz 8}
\rule{\textwidth}{0.5ex}
{\bf Sample Quiz 8, Problem 1}. {\bf Solving Higher Order Constant-Coefficient Equations}

\begin{quote}\sf
{\bf The Algorithm} applies to constant-coefficient homogeneous linear differential equations of order $N$, for example equations like
$$ y'' + 16y=0, \quad y'''' + 4y'' = 0, \quad \frac{d^5y}{dx^5} + 2y''' + y'' = 0.$$
\begin{itemize}
\item[{\bf 1}.] Find the $N$th degree characteristic equation by Euler's substitution $y=e^{rx}$. For instance, $y'' + 16y=0$ has characteristic equation $r^2+16=0$, a polynomial equation of degree $N=2$.
\item[{\bf 2}.] Find all real roots and all complex conjugate pairs of roots satisfying the characteristic equation. List the $N$ roots according to multiplicity.
\item[{\bf 3}.] Construct $N$ distinct Euler solution atoms from the list of roots. Then the general solution of the differential equation is a linear combination of the Euler solution atoms with arbitrary coefficients $c_1,c_2,c_3,\ldots$.

    The solution space $S$ of the differential equation is given by
    $$S=\SPAN(\mbox{the $N$ Euler solution atoms}).$$
\end{itemize}

{\bf Examples}: Constructing Euler Solution Atoms from roots.

Three roots $0,0,0$ produce three atoms $e^{0x}, xe^{0x}, x^2e^{0x}$ or $1,x,x^2$.

Three roots $0,0,2$ produce three atoms $e^{0x},xe^{0x},e^{2x}$.

Two complex conjugate roots $2\pm3i$ produce two atoms $e^{2x}\cos(3x),e^{2x}\sin(3x)$.\footnote{The Reason: $\cos(3x)=\frac12e^{3xi}+\frac12e^{-3xi}$ by Euler's formula $e^{i\theta}=\cos\theta+i\sin\theta$. Then $e^{2x}\cos(3x)=\frac12e^{2x+3xi}+\frac12e^{2x-3xi}$ is a linear combination of exponentials $e^{rx}$ where $r$ is a root of the characteristic equation. Euler's substitution implies $e^{rx}$ is a solution, so by superposition, so also is $e^{2x}\cos(3x)$. Similar for $e^{2x}\sin(3x)$.}

Four complex conjugate roots listed according to multiplicity as $2\pm3i,2\pm3i$ produce four atoms $e^{2x}\cos(3x),e^{2x}\sin(3x)$, $xe^{2x}\cos(3x),xe^{2x}\sin(3x)$.

Seven roots $1,1,3,3,3,\pm3i$ produce seven atoms $e^x,xe^x,e^{3x},xe^{3x}, x^2e^{3x}, \cos(3x),\sin(3x)$.

Two conjugate complex roots $a\pm bi$ ($b>0$) arising from roots of $(r-a)^2+b^2=0$ produce two atoms $e^{ax}\cos(bx),e^{ax}\sin(bx)$.
\end{quote}

\section*{The Problem}
Solve for the general solution or the particular solution satisfying initial conditions.

(a) \quad $y'' + 16y' = 0$

(b) \quad $y'' + 16y=0$

(c) \quad $y'''' + 16y''=0$

(d) \quad $y'' + 16y=0$, $y(0)=1$, $y'(0)=-1$

(e) \quad $y'''' + 9y''=0$, $y(0)=y'(0)=0$, $y''(0)=y'''(0)=1$

(f) \quad The characteristic equation is $(r-2)^2(r^2-4)=0$.

(g) \quad The characteristic equation is $(r-1)^2(r^2-1)((r+2)^2+4)=0$.

(h) \quad The characteristic equation roots, listed according to multiplicity, are $0,0,0,-1,2,2,3+4i,3-4i$.

\rule{\textwidth}{0.5ex}
\vfill\newpage
\section*{Solutions to Problem 1}

(a) \quad $y'' + 16y' = 0$ upon substitution of $y=e^{rx}$ becomes $(r^2+16r)e^{rx}=0$. Cancel $e^{rx}$ to find the {\bf characteristic equation} $r^2+16r=0$. It factors into $r(r+16)=0$, then the two roots $r$ make the list $r=0,-16$. The Euler solution atoms for these roots are $e^{0x},e^{-16x}$. Report the general solution $y=c_1 e^{0x} + c_2 e^{-16x} = c_1+c_2e^{-16x}$, where symbols $c_1,c_2$ stand for arbitrary constants.

(b) \quad $y'' + 16y=0$ has characteristic equation $r^2+16=0$. Because a quadratic equation $(r-a)^2+b^2=0$ has roots $r=a\pm bi$, then the root list for $r^2+16=0$ is $0+4i,0-4i$, or briefly $\pm 4i$. The Euler solution atoms are $e^{0x}\cos(4x),e^{0x}\sin(4x)$. The general solution is $y=c_1\cos(4x)+c_2\sin(4x)$, because $e^{0x}=1$.

(c) \quad $y'''' + 16y''=0$ has characteristic equation $r^4+4r^2=0$ which factors into $r^2(r^2+16)=0$ having root list $0,0,0\pm 4i$. The Euler solution atoms are $e^{0x},xe^{0x},e^{0x}\cos(4x),e^{0x}\sin(4x)$. Then the general solution is $y=c_1+c_2x + c_3\cos(4x)+c_4\sin(4x)$.

(d) \quad $y'' + 16y=0$, $y(0)=1$, $y'(0)=-1$ defines a particular solution $y$. The usual arbitrary constants $c_1,c_2$ are determined by the initial conditions. From part (b), $y=c_1\cos(4x)+c_2\sin(4x)$. Then $y'=-4c_1\sin(4x)+4c_2\cos(4x)$. Initial conditions $y(0)=1,y'(0)=-1$ imply the equations $c_1\cos(0)+c_2\sin(0)=1,-4c_1\sin(0)+4c_2\cos(0)=-1$. Using $\cos(0)=1$ and $\sin(0)=0$ simplifies the equations to $c_1=1$ and $4c_2=-1$. Then
the particular solution is $y=c_1\cos(4x)+c_2\sin(4x)=\cos(4x)-\frac14\sin(4x)$.

(e) \quad $y'''' + 9y''=0$, $y(0)=y'(0)=0$, $y''(0)=y'''(0)=1$ is solved like part (d). First, the characteristic equation $r^4+9r^2=0$ is factored into $r^2(r^2+9)=0$ to find the root list $0,0,0\pm 3i$. The Euler solution atoms are $e^{0x},xe^{0x},e^{0x}\cos(3x),e^{0x}\sin(3x)$, which implies the general solution $y=c_1+c_2x+c_3\cos(3x)+c_4\sin(3x)$. We have to find the derivatives of $y$:
$y'=c_2-3c_3\sin(3x)+3c_4\cos(3x)$, $y''=-9c_3\cos(3x)-9c_4\sin(3x)$, $y'''=27c_3\sin(3x)-27c_4\cos(3x)$. The initial conditions give four equations in four unknowns $c_1,c_2,c_3,c_4$:
$$\begin{array}{rcrcrcrcl}
c_1 &+& c_2(0) &+& c_3\cos(0) &+& c_4\sin(0)&=&0, \\
    & & c_2    &-& 3c_3\sin(0) &+& 3c_4\cos(0) &=&0,\\
    & &        &- & 9c_3\cos(0) &-& 9c_4\sin(0) &=& 1,\\
    & &        & & 27c_3\sin(0) &-& 27c_4\cos(0) &=& 1,
\end{array}
$$
which has invertible coefficient matrix
$\fourbyfour{1&0&1&0}{0&1&0&3}{0&0&-9&0}{0&0&0&-27}$ and right side vector $\colvector{0\\ 0\\ 1\\ 1}$. The solution is $c_1=c_2=1/9$, $c_3=-1/9,c_4=-1/27$. Then the particular solution is $y=c_1+c_2x+c_3\cos(3x)+c_4\sin(3x)=\frac19+\frac19x -\frac19\cos(3x) - \frac{1}{27}\sin(3x)$
% A:=<1,0,1,0|0,1,0,3|0,0,-9,0|0,0,0,-27>^+;b:=<0,0,1,1>;A^(-1).b;


(f) \quad The characteristic equation is $(r-2)^2(r^2-4)=0$. Then $(r-2)^3(r+2)=0$ with root list $2,2,2,-2$ and Euler atoms $e^{2x},xe^{2x},x^2e^{2x},e^{-2x}$. The general solution is a linear combination of these four atoms.

(g) \quad The characteristic equation is $(r-1)^2(r^2-1)((r+2)^2+4)=0$. The root list is $1,1,1,-1,-2\pm 2i$ with Euler atoms $e^x,xe^x,x^2e^x,e^{-x},e^{-2x}\cos(2x),e^{-2x}\sin(2x)$. The general solution is a linear combination of these six atoms.

(h) \quad The characteristic equation roots, listed according to multiplicity, are $0,0,0,-1,2,2,3+4i,3-4i$. Then the Euler solution atoms are $e^{0x},xe^{0x},x^2e^{0x}, e^{-x}, e^{2x},xe^{2x}, e^{3x}\cos(4x),e^{3x}\sin(4x)$. The general solution is a linear combination of these eight atoms.
\vfill\newpage
\rule{\textwidth}{0.5ex}
{\bf Sample Quiz 8, Problem 2}. {\bf Laplace Theory}

\begin{quote}\Large\sf
Laplace theory implements the {\em method of quadrature} for higher order differential equations, linear systems of differential equations, and certain partial differential equations.

Laplace's method {\bf solves differential equations}.
\end{quote}

{\bf The Problem}. Solve by table methods or Laplace's method.

\begin{itemize}
\item[{\bf (a)}]
Forward table. Find $\L(f(t))$ for $f(t)= te^{2t} + 2t\sin(3t)+ 3e^{-t}\cos(4t)$.

\item[{\bf (b)}]
Backward table. Find $f(t)$ for $$\L(f(t))= \dd\frac{16}{s^2+4} + \frac{s+1}{s^2 - 2s + 10} + \frac{2}{s^2+16}.$$

\item[{\bf (c)}]
Solve the initial value problem $x''(t) + 256 x(t) = 1$, $x(0)=1$, $x'(0)=0$.

\end{itemize}

{\bf Solution (a)}.

$$\begin{array}{lcll}
\L(f(t))&=& \L(te^{2t} + 2t\sin(3t)+ 3e^{-t}\cos(4t)) & \\
        &=& \L(te^{2t}) + 2\L(t\sin(3t))+ 3\L(e^{-t}\cos(4t)) & \mbox{Linearity} \\
        &=& -\frac{d}{ds}\L(e^{2t}) - 2\frac{d}{ds}\L(\sin(3t))+ 3\L(e^{-t}\cos(4t)) & \mbox{Differentiation rule} \\
        &=& -\frac{d}{ds}\L(e^{2t}) - 2\frac{d}{ds}\L(\sin(3t))+ 3\left.\L(\cos(4t))\right|_{s=s+1} & \mbox{Shift rule} \\
        &=& -\frac{d}{ds}\frac{1}{s-2} - 2\frac{d}{ds}\frac{3}{s^2+9}+ 3\left.\frac{s}{s^2+16}\right|_{s=s+1} & \mbox{Forward table} \\
        &=& \frac{1}{(s-2)^2} + \frac{12s}{(s^2+9)^2}+ 3\frac{s+1}{(s+1)^2+16} & \mbox{Calculus}
        \end{array}
        $$

{\bf Solution (b)}.

$$
\begin{array}{lcll}
\L(f(t))&=& \frac{16}{s^2+4} + \frac{s+1}{s^2 - 2s + 10} + \frac{2}{s^2+16} &  \\
        &=& 8\frac{2}{s^2+4} + \frac{s+1}{(s - 1)^2 + 9} + \frac12\frac{4}{s^2+16} & \mbox{Prep for backward table} \\
        &=& 8\L(\sin 2t) + \frac{s+1}{(s - 1)^2 + 9} + \frac12\L(\sin 4t) & \mbox{backward table} \\
        &=& 8\L(\sin 2t) + \left.\frac{s+2}{s^2 + 9}\right|_{s=s-1} + \frac12\L(\sin 4t) & \mbox{shift rule} \\
        &=& 8\L(\sin 2t) + \left.\L(\cos 3t +\frac23\sin 3t)\right|_{s=s-1} + \frac12\L(\sin 4t) & \mbox{backward table} \\
        &=& 8\L(\sin 2t) + \L(e^t\cos 3t +e^t\frac23\sin 3t) + \frac12\L(\sin 4t) & \mbox{shift rule} \\
        &=& \L(8\sin 2t) + e^t\cos 3t +e^t\frac23\sin 3t + \frac12\sin 4t) & \mbox{Linearity} \\
  f(t) &=&  8\sin 2t + e^t\cos 3t +e^t\frac23\sin 3t + \frac12\sin 4t & \mbox{Lerch's cancel rule}      \end{array}
  $$

{\bf Solution (c)}.

$$
\begin{array}{lcll}
\L(x''(t) + 256 x(t)) &=& \L(1) & \mbox{$\L$ acts like matrix mult} \\
s\L(x') -x'(0)+ 256\L(x) &=& \L(1) & \mbox{Parts rule} \\
s(s\L(x)-x(0)) -x'(0)+ 256\L(x) &=& \L(1) & \mbox{Parts rule} \\
s^2\L(x)-s+ 256\L(x) &=& \L(1) & \mbox{Use $x(0)=1,x'(0)=0$} \\
(s^2+ 256)\L(x) &=& s+\L(1) & \mbox{Collect $\L(x)$ left}
\end{array}
$$
$$
\begin{array}{lcll}
\L(x) &=& \frac{s+\L(1)}{(s^2+ 256)} & \mbox{Isolate $\L(x)$ left} \\
\L(x) &=& \frac{s+1/s}{(s^2+ 256)} & \mbox{Forward table} \\
\L(x) &=& \frac{s^2+1}{s(s^2+ 256)} & \mbox{Algebra} \\
\L(x) &=& \frac{A}{s} + \frac{Bs+C}{s^2+ 256} & \mbox{Partial fractions} \\
\L(x) &=& A\L(1) + B\L(\cos 16t)+\frac{C}{16}\L(\sin 16t) & \mbox{Backward table} \\
\L(x) &=& \L(A + B\cos 16t+\frac{C}{16}\sin 16t) & \mbox{Linearity} \\
x(t) &=& A + B\cos 16t+\frac{C}{16}\sin 16t & \mbox{Lerch's rule} \\
\end{array}
$$
The partial fraction problem remains:
$$
\frac{s^2+1}{s(s^2+ 256)}=
\frac{A}{s} + \frac{Bs+C}{s^2+ 256}
$$
This problem is solved by clearing the fractions, then swapping sides of the equation, to obtain
$$
A(s^2+ 256) + (Bs+C)(s) = s^2+1.
$$
Substitute three values for $s$ to find 3 equations in 3 unknowns $A,B,C$:
$$
\begin{array}{llcl}
s=0 &  256A &=& 1 \\
s=1 & 257 A + B + C &=& 2 \\
s=-1 & 257 A + B - C &=& 2
\end{array}
$$
Then $A=1/256, B=255/256, C=0$ and finally
$$x(t)= A + B\cos 16t+\frac{C}{16}\sin 16t = \frac{1+255\cos 16t}{256}$$

\subsection*{Answer Checks}
\begin{verbatim}
# Sample quiz 8
# answer check problem 2(a)
f:=t*exp(2*t)+2*t*sin(3*t)+3*exp(-t)*cos(4*t);
with(inttrans): # load laplace package
laplace(f,t,s);
# The last two fractions simplify to 3(s+1)/((s+1)^2+16).
# answer check problem 2(b)
F:=16/(s^2+4)+(s+1)/(s^2-2*s+10)+2/(s^2+16);
invlaplace(F,s,t);
# answer check problem 2(c)
de:=diff(x(t),t,t)+256*x(t)=1;ic:=x(0)=1,D(x)(0)=0;
dsolve([de,ic],x(t));
# answer check problem 2(c), partial fractions
convert((s^2+1)/(s*(s^2+256)),parfrac,s);
\end{verbatim}

The output appears on the next page

\noindent
\includegraphics[scale=0.95]{quiz-11-answer-check-crop.pdf}


\end{document}
\endinput

