% exam 2 sample, for Friday 17 March 2015
\documentclass[11pt]{article}
\newif\ifsolutions\solutionstrue
%\solutionsfalse
\setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.8in} \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 Notes on Problem #1}.~\small\rm}{\protect\par\normalsize\rm}
\ifsolutions
\long\def\Answer#1{\begin{quote}\sf {\large\sf Answer:}\par #1\end{quote}}
\else
\long\def\Answer#1{\relax}
\fi
%\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{{\large\bf #1}}
\def\checkbox{\fbox{$\phantom{X}$}~}
\def\SPAN{\mathop{\bf span}\nolimits}
\usepackage{linalg}
\begin{document}
\thispagestyle{empty}
%{\large\bf Name}
%\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
%{\bf Lecture Meets at}~\underline{~~~~~~~~~~}
%\par
%~\hfill\makebox[0.2in][t]{\begin{tabular}[t]{@{}|l|@{}}
%\hline
%\BF{Scores}~~~ \\
%\hline
%1. \\
%2. \\
%3. \\
%4.\\
%5. \\
%\hline
%\end{tabular}}
%{{\bf Lecture Meets at}~\underline{~~~~~~~~~~} }
\def\EJECT{\SeparatedPages{\vfill Use this page to start your solution.
Attach extra pages as needed.\eject \thispagestyle{empty} \hfill
2250 Sample Midterm Exam 2
 S2015 [17April]\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.\eject}}
%\def\EJECT{}\def\EJECTEND{}
\vspace{-5pc}
\begin{center}\Large\bf
Differential Equations and Linear Algebra 2250 \\
\small Sample Midterm Exam 2 \\
\small Exam Date: 17 April 2015 at 7:25am
\end{center}

\bigskip

{\bf Instructions}: This in-class exam is designed to be completed in 80
minutes. No calculators, notes, tables or books. No answer check is
expected. Details count 3/4, answers count 1/4. This sample contains extra
sample problems. The actual exam is certainly much shorter, tested for 80 minutes.




\subsection*{Chapter 4}
\begin{exercises}
\prob{3.}{(Chapter 4)} Do {\bf all parts}.
\newline
 \BF{(a)} State a dependence test for $3$ vectors in $\Rr^4$. Write the hypothesis and conclusion, not just the name of the test.\newline
 \Answer{The Rank Test is the first choice: {\sf Let $A$ be the augmented matrix of the $3$ vectors. Then the vectors are independent if and only if the rank of $A$ equals $3$.}}
 (\BF{(b)}  State fully an independence test for $3$ polynomials. It should apply to show that $1$, $1+x$, $x(1+x)$ are independent.\newline
 \Answer{Either the Wronskian test or the Sampling Test applies. {\bf The Wronskian Test}: {\sf Let $W(x)$ be the Wronskian matrix of the three polynomials. If $|W(x_0)|\ne 0$ for some $x=x_0$, then the polynomials are independent.}}
 \BF{(c)}  For any matrix $A$, $\rank(A)$ equals the number of lead
 variables for the problem $A\vec{x}=\vec{0}$. How many non-pivot
 columns in an $8\times 8$ matrix $A$ with $\rank(A)=6$?
  \newline
  \Answer{The number of pivot columns is the number of leading ones in the reduced row echelon form of $A$. The number of leading ones is the rank. So, $A$ has rank $6$ means there are $6$ pivot columns and $2$ non-pivot columns.}
 \BF{(d)}  Let $\.v_1$, $\.v_2$, $\.v_3$, $\.v_4$ denote the rows
of the matrix
$$A=\left( \begin{array}{rrrrr}
       0 &-2 & 0 & -6 & 0 \\
       0 & 2 & 0 & 5 & 1 \\
        0 & 1 & 0 & 2 & 1 \\
       0 & 1 & 0 & 3 & 0
    \end{array}\right).
$$
 Decide if the four rows $\vec{v}_1$, $\vec{v}_2$, $\vec{v}_3$, $\vec{v}_4$ are independent and display the details of the chosen independence test.
%  C2:=Matrix([[0,-2,0,-6,0],[0,2,0,5,1],[0,1,0,2,1],[0,1,0,3,0]]); linalg[rref](C2^+);
 \newline
 \Answer{The rows of $A$ are independent if and only if the columns of the transpose matrix $A^T$ are independent. Columns $1,2$ of $A^T$ are the pivot columns, therefore the columns of $A^T$ are not independent. This means that the four rows of $A$ are not independent. In the details, show the swap, combo, multiply steps for the last frame (reduced row echelon form) and box the pivot columns, as in the display below.
 $$\rref\left(A^T\right) = \left( \begin{array}{rrrrr}
       \fbox{1} &0 & \frac12 & -\frac12 \\
       0 & \fbox{1} & 1 & 0 \\
       0 & 0 & 0 & 0  \\
       0 & 0 & 0 & 0  \\
       0 & 0 & 0 & 0
    \end{array}\right).$$}
 \BF{(e)}  Extract from the list below a
 largest set of independent vectors.

 $\vec{v_1} = \colvector{0\\ 0 \\ 0\\ 0 \\ 0 \\  0}$,
 $\vec{v_2} = \colvector{0\\ 2 \\ 2\\ -2 \\ 0 \\  2}$,
 $\vec{v_3} = \colvector{0\\ 1 \\ 1\\ -1 \\ 0 \\  1 }$,
 $\vec{v_4} = \colvector{0\\ 3 \\ 3\\ -1 \\ 0 \\  5}$,
 $\vec{v_5} = \colvector{0\\ 1 \\ 1\\  1 \\ 0 \\  3}$,
 $\vec{v_6} = \colvector{0\\ 0 \\ 0\\  2 \\ 0 \\  2}$.

% C3:=Matrix([[0,0,0,0,0,0],[0,2,2,-2,0,2],
% [0,1,1,-1,0,1],[0,3,3,-1,0,5],[0,1,1,1,0,3],[0,0,0,2,0,2]])^+;
% linalg[rref](C3);

\Answer{One answer is $\vec{v}_2, \vec{v}_4$, using the {\bf Pivot Theorem}.
Form the augmented matrix $A$ of the vectors and find the pivot columns of $A$. The pivot columns form a largest subset of independent vectors. The non-pivot columns are linear combinations of the pivot columns (they are redundant columns). In the details, compute $\rref(A)$ and box the leading ones, which marks pivot columns 2, 4:
$$\rref(A)=\rref\langle \vec{v}_1,\vec{v}_2,\vec{v}_3,\vec{v}_4,\vec{v}_5,\vec{v}_6 \rangle =
 \left( \begin {array}{cccccc} 0&\fbox{1}&\frac12&0&-1&-\frac32\\ \noalign{\medskip}0
&0&0&\fbox{1}&1&1\\ \noalign{\medskip}0&0&0&0&0&0\\ \noalign{\medskip}0&0&0&0
&0&0\\ \noalign{\medskip}0&0&0&0&0&0\\ \noalign{\medskip}0&0&0&0&0&0
\end {array} \right)
$$
}
%\checkbox~
\BF{(e)}
Check the independence tests which apply to prove that vectors $x,x^{7/3},e^x$ are independent in the vector space of all continuous functions on $-\infty < x < \infty$. Demerits are given for missing a box, and also for checking a box that does not apply.
\begin{center}\begin{tabular}{llp{0.6\textwidth}}
 \checkbox~ & \bf Wronskian test & Wronskian of functions $f,g,h$ nonzero at $x=x_0$ implies independence of $f,g,h$. \\
 \checkbox~ & \bf Rank test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their augmented matrix has rank 3. \\
 \checkbox~ & \bf Determinant test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their square augmented matrix has nonzero determinant. \\
 \checkbox~ & \bf Atom test & Any finite set of distinct Euler solution atoms is independent.\\[1ex]
 \checkbox~ & \bf Pivot test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their augmented matrix $A$ has 3 pivot columns. \\
 \checkbox~ & \bf Sampling test & Let samples $a,b,c$ be given and for functions $f,g,h$ define $$A=\threebythree{f(a)&g(a)&h(a)}{f(b)&g(b)&h(b)}{f(c)&g(c)&h(c)}.$$ Then $\det(A)\ne0$ implies
 independence of $f,g,h$.
\end{tabular}\end{center}

\Answer{Tests 2, 3, 5 fail to apply, because these tests are about fixed vectors, not functions. Details for the other tests can be given: let $f(x)=x, g(x)=x^{7/3}, h(x)=e^x$. These are not atoms, so the atom test does not apply. The Wronskian test applies directly, using $x_0=1$ to obtain Wronskian determinant value $W=4e/3$. The sampling test applies using samples $a=0$, $b=1$, $c=2$ because then
% [[0, 0, 1], [1, 1, exp(1)], [2, 4*2^(1/3), exp(2)]]
$A=\threebythree{0&0&1}{1&1&e}{2&4\sqrt[3]{2}&e^2}$ and $\det(A)=4\sqrt[3]{2}-2\ne 0$.\newline
A {\tt maple} answer check can be done as follows:
}
\ifsolutions
\begin{verbatim}
# Wronskian test
v:=<x,x^(7/3),exp(x)>;
W:=linalg[wronskian](v,x);
subs(x=1,linalg[det](W)); # positive test if nonzero
# Sampling test
F:=x-><x,x^(7/3),exp(x)>;
A:=<F(0)|F(1)|F(2)>^+;
linalg[det](A); # positive test if nonzero
\end{verbatim}
\fi

%v:=x-> <x,x^(7/3),exp(x)>;
%W:=<v(x)|map(f->diff(f,x),v(x))|map(f->diff(f,x,x),v(x))>^+;
%subs(x=1,W);
%linalg[det](%);

%v:=x-> <x,x^(7/3),exp(x)>;
%A:=<v(0)|v(1)|v(2)>^+;
%linalg[det](%);
%evalf(%);

%\checkbox~
\BF{(f)}
Consider the homogenous system $A\vec{x}=\vec{0}$. The nullity of $A$ equals the number of free variables. Give an example of a matrix $A$ with three pivot columns that has nullity 2.

\Answer{Let $\vec{v}_1$, $\vec{v}_2$, $\vec{v}_3$ be any three columns of the identity and let $\vec{v}_4=\vec{v}_5$ each be the zero vector. Define $A$ to be the augmented
matrix of these four vectors. Then $A$ has 5 columns. There are three pivot columns and two free variables $x_4,x_5$, hence $A$ has 3 pivots and nullity 2.}

%\checkbox~
\BF{(g)}
Let $V$ be the vector space of all continuously differentiable vector functions $\vec{v}(t)=\colvector{x(t) \\ y(t)}$.
Let $S$ be the set  of all vector solutions $\vec{v}(t)=\colvector{x(t) \\ y(t)}$ of the dynamical system
 $$\left\{\begin{array}{lcl} x'(t) &=&2x(t) \\ y'(t) &=& 4y(t)\end{array}\right.$$
Find two independent solutions $\vec{v}_1, \vec{v}_2$ such that $S=\SPAN(\vec{v}_1,\vec{v}_2)$.
{\small\it This calculation proves that $S$ is a subspace of $V$ by Picard's theorem and the
Span Theorem, hence $S$ is a vector space}.


\Answer{The dynamical system is diagonal, therefore it can be solved by the method of linear cascades (Section 1.5, linear integrating factor method).
The general solution is $x=c_1e^{2t}$, $y=c_2e^{4t}$. Then two independent vector solutions are found by taking partial derivatives on the symbols $c_1,c_2$, obtaining $\vec{v}_1=\colvector{e^{2t} \\ 0}$ and $\vec{v}_2=\colvector{0\\ e^{4t}}$.
Then any solution of the dynamical system is given by $\vec{v}=c_1\vec{v}_1 + c_2 \vec{v}_2$.
}


\BF{(h)}
The $4\times 6$ matrix $A$ below has some
independent columns. Report the independent columns of $A$, according to
the Pivot Theorem.
$$A=\left(\begin{array}{rrrrrrrr}
0 &  0 &   0 &  0 & 0&  0\\
0 & -3 &  -2 &  1 & 0& -1\\
0 & -1 &   0 &  1 & 0&  0\\
0 &  6 &   6 &  0 & 0&  3
 \end{array}\right)$$

%A:=Matrix([
%  [0,  0,  0,  0 , 0, 0 ],
%  [0, -3, -2,  1 , 0, -1],
%  [0, -1,  0,  1 , 0, 0],
%  [0,  6,  6,  0 , 0, 3]
%    ]);
%  linalg[rref](A);

\Answer{Find {\small $\rref(A)= \left( \begin {array}{ccccccc}
   0&\fbox{1}&0&-1&0&0\\
   0&0&\fbox{1}& 1&0&\frac12\\
   0&0&0& 0&0&0\\
   0&0&0& 0&0&0
\end {array} \right)
$}. The pivot columns are 2 and 3, indicated by boxed leading ones.}

\end{exercises}
\EJECT

\subsection*{Chapter 5}
\begin{exercises}
\prob{5.}{(Chapter 5)} Do all parts.~
\newline
 \BF{(a)}  Solve for the general solution of $15y'' + 8y'+y=0$.
 % solve(15*x^2+8*x+1=0,x);
\newline
\Answer{The roots of $15 r^2+8r+1=0$ are $-\frac15, -\frac13$. The
Euler atoms are $e^{-t/5}, e^{-t/3}$. The general solution is a linear combination of the two atoms.}
 \BF{(b)}  The characteristic equation is $r^2(2r+1)^3(r^2-2r+10)=0$.
Find the general solution $y$ of the linear homogeneous
constant-coefficient differential equation.
\newline
\Answer{The characteristic polynomial factors are $r^2, (2r+1)^3, ((r-1)^2+3^2)$ with roots $0,0;\quad -\frac12,-\frac12,-\frac12;\quad 1\pm 3i$. The Euler atoms are $1,x;\quad e^{-t/2},te^{-t/2},t^2e^{-t/2};\quad e^t\cos(3t),e^t\sin(3t)$. The general solution is a linear combination of this list of atoms.}
 \BF{(c)}  A fourth order linear homogeneous differential equation with
constant coefficients has two particular solutions $2e^{3x}+4x$ and
$xe^{3x}$. Write a formula for the general solution.
\newline
\Answer{
In order for $xe^{3x}$ to be a solution, the general solution must have Euler atoms $e^{3x}, xe^{3x}$. Then the first solution $2e^{3x}+4x$ minus $2$ times the Euler atom $e^{3x}$ must be a solution, therefore $x$ is a solution, resulting in Euler atoms $1,x$. The general solution is then a linear combination of the four Euler atoms: $y = c_1(1)+c_2(x)+c_3\left(e^{3x}\right)+c_4\left(xe^{3x}\right)$.
}
\BF{(d)}  Mark with {\Large\bf X} the functions which {\bf cannot} be a
solution of a linear homogeneous differential equation with constant
coefficients. Test your choices against this theorem:
\begin{quote}{\em The general
solution of a linear homogeneous $n$th order differential equation with
constant coefficients is a linear combination of Euler solution atoms}.
\end{quote}
$$
\begin{array}{|c@{\hspace{3ex}}|c@{\hspace{3ex}}|c@{\hspace{3ex}}|c@{\hspace{3ex}}|c@{\hspace{3ex}}|c@{\hspace{3ex}}|c@{\hspace{3ex}}|}
\hline
\phantom{{\dd\int_0^1}} e^{\ln|2x|} & e^{x^2} & 2\pi + x & \cos(\ln|x|)
\\[2ex]
\hline
\phantom{{\dd\int_0^1}} \cos (x \ln|3.7125| ) & x^{-1}e^{-x}\sin(\pi x)
& \cosh (x) & \sin^2 (x)  \\[2ex]
\hline
\end{array}
$$
\Answer{
Items (1), (2), (4), (6) are marked by {\Large\bf X}.
The functions which are a solution of some linear constant homogeneous differential equation are those items which are a linear combination of Euler atoms. \newline
(1) $e^{\ln|2x|}=|2x|$ is not a linear combination of atoms, because $|2x|$ has no derivative at $x=0$; (2) $e^{x^2}$ is not an atom; (3) $2\pi + x$ is a linear combination of atoms $1,x$; (4) $\cos(\ln|x|)$ is not differentiable at $x=0$, so not a linear combination of atoms; (5) $\cos(x\ln|3.7125|)$ is Euler atom $\cos(bx)$ with $b>0$; (6) $x^{-1}$ times Euler atom $e{-x}\sin(\pi x)$ is a fraction, which is not an Euler atom or linear combination of atoms; (7) $\cosh(x)=\frac12e^x+\frac12e^{-x}$ is a linear combination of Euler atoms; (8) $\sin^2(x)=\frac12-\frac12\cos(2x)$ is a linear combination of Euler atoms $1,\cos(2x)$.
}
\BF{(e)} Find the characteristic equation of a higher
order linear homogeneous differential equation with constant
coefficients, of minimum order, such that $y=3x^2+ 10xe^{-x}+4\cos(2 x)$ is a solution.

% r^3(r+1)(r^2+1)^2

\Answer{The Euler atoms $x^2$, $xe^{-x}$, $\cos(2x)$ correspond to roots $0,0,0;\quad -1, -1;\quad 2i,-2i$. The factor theorem implies the characteristic polynomial should be $r^3(r+1)^2(r^2+4)$.}

%\checkbox~
\BF{(f)} Determine a {\em basis of solutions} of a
homogeneous constant-coefficient linear differential equation, given it has
characteristic equation
$$
(r^4-4r^3)((r-\ln(2))^2+4)^2=0.
$$
 \Answer{The roots are $0,0,0;\quad 4;\quad \ln(2)\pm 2i, \ln(2)\pm 2i$. By Euler's theorem, a basis is the set of corresponding atoms for these roots: $1,x,x^2$;\quad $e^{4x}$;\quad $e^{\ln(2)x}\cos(2 x)$, $xe^{\ln(2)x}\cos(2 x)$, $e^{\ln(2)x}\sin(2 x)$, $xe^{\ln(2)x}\sin(2 x)$. The
 exponential factor $e^{\ln(2)x}$ can be written $2^x$.}


%\checkbox~
\BF{(g)} Find the {\bf Beats} solution for
the forced undamped spring-mass problem
$$ x'' + 64x = 40\cos(4t),\quad x(0)=x'(0)=0.$$
It is known that this solution is the sum of two harmonic oscillations of different frequencies.
% solve(r^2+64=0,r);
% de:=diff(x(t),t,t)+64*x(t)=40*cos(4*t);dsolve(de,x(t));
% dsolve({de,x(0)=0,D(x)(0)=0},x(t));

\Answer{Use undetermined coefficients trial solution $x=d_1\cos 4t + d_2 \sin 4t$. Then $d_1=5/6$, $d_2=0$, and finally $x_p(t)=(5/6)\cos(4t)$. 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=-5/6, c_2=0$, which implies the particular solution $x(t)=-\frac56\cos(8t)+\frac56\cos(4t)$.}


\BF{(h)} Determine the {\bf shortest} trial
solution for $y_p$ according to the method of undetermined
coefficients. {\bf Do not evaluate} the undetermined coefficients!
$$ \frac{d^4y}{dx^4} - 4 \frac{d^2y}{dx^2}= 11x^2+2x+3+ 12\cos 2x + 13xe^{2x}$$
% solve(r^4+9*r^2=0,r);
\Answer{The homogeneous problem has roots $0,0,2,-2$ with atoms $1,x, e^{2x}, e^{-2x}$.\newline
The {\bf trial solution} is constructed by Rule I from $f(x)=11x^2+2x+3+ 12\cos 2x + 13xe^{2x}$,
which has seven atoms in a list of four groups (1) $1,x,x^2$;\quad (2) $\cos 2x$;\quad (3) $\sin 2x$; \quad (4) $e^{2x}, xe^{2x}$.\newline
Rule II is applied. Conflicts with the homogeneous equation atoms causes a repair of groups (1), (4) making the new groups
(1) $x^2,x^3,x^4$;\quad (2) $\cos 2x$;\quad (3) $\sin 2x$;\quad (4) $xe^{2x}, x^2e^{2x}$. Then the shortest trial solution is a linear combination of the seven atoms in the corrected list.}



  \BF{(i)} Find a particular solution $y_p(x)$and the homogeneous solution $y_h(x)$
 for
$\dd\frac{d^4y}{dx^4}-\frac{d^2y}{dx^2}=12x^2$.
%% de:=diff(y(x),x,x,x,x)-diff(y(x),x,x)=12*x^2;dsolve(de,y(x));

\Answer{ $y=-x^4-12x^2$ by the method of undetermined coefficients. Rule I applied to $f(x)=12x^2$ gives trial solution a linear combination of the Euler atom list $1,x,x^2$. The homogeneous problem $\dd\frac{d^4y}{dx^4}-\frac{d^2y}{dx^2}=0$ has Euler atoms $1,x,e^x,e^{-x}$. Rule II is applied. Conflicts with homogeneous Euler atoms $1,x$ cause two $x$-multiplies, giving the corrected list $x^2,x^3,x^4$. Then the trial solution is $y=d_1x^2+d_2x^3+d_3x^4$. Stuff $y$ into $\dd\frac{d^4y}{dx^4}-\frac{d^2y}{dx^2}=12x^2$ and determine $d_1=-12$, $d_2=0$, $d_3=-1$.
}


 \BF{(j)}
The differential equation
$\dd\frac{d^4y}{dx^4}+\frac{d^2y}{dx^2}=12x^2+6x$ has a particular solution $y_p(x)$
of the form $y=d_1x^2+d_2x^3+d_3x^4$. Find $y_p(x)$ by the method of undetermined coefficients (yes, find $d_1,d_2,d_3$).
%%% de:=diff(y(x),x,x,x,x)-diff(y(x),x,x)=12*x^2;dsolve(de,y(x));

\Answer{ Solution $y_h$ is a linear combination of the atoms
$1,x,\cos(x),\sin(x)$. A particular solution is $y_p=x^4+x^3-12x^2$.
\\
The Euler atoms for $y^(4)+y''=0$ are found from $r^4+r^2=0$ with roots
$r=0,0,i,-i$. Rule I: the Euler atoms in $f(x)=12x^2+6x$ are $1,x,x^2$. Rule II: because $1,x$ are
solutions of the homogeneous equation, then the list $1,x,x^2$ from
$f(x)$ is multiplied by $x^2$ to obtain the corrected list
$x^2,x^3,x^4$. Then $y_p=d_1x^2+d_2x^3+d_3x^4$.
\\
Substitute $y_p$ into the equation $y^(4)+y''=12x^2+6x$ to get
$24d_3+2d_1+6d_2x+12d_3x^2 = 12x^2+6x$. Matching coefficients of atoms
gives $24d_3+2d_1=0, 6d_2=6, 12d_3=12$. Then $d_3=1,d_2=1, d_1=-12$.
Finally, $y_p=(-12)x^2+(1)x^3+(1)x^4$.}


% F2009, for ver 2
 \BF{(k)}  Find the steady-state periodic
 solution for the forced spring-mass system $ x'' + 2x' + 2x =
5\sin(t)$.
% de:=diff(y(x),x,x)+2*diff(y(x),x)+2*y(x)=5*sin(x);dsolve(de,y(x));
% subs(y(x)=d1*cos(x)+d2*sin(x),de);collect(%,{cos(x),sin(x)});


\Answer{ $x=\sin t - 2\cos t$ by the method of undetermined coefficients.
Rule I: the trial solution $x(t)$ is a linear combination of the Euler atoms found in $f(x)=5\sin(t)$. Then $x(t)=d_1\cos(t) + d_2\sin(t)$. Rule II does not apply, because solutions of the homogeneous problem contain negative exponential factors (no conflict). Substitute the trial solution into
$ x'' + 2x' + 2x = 5\sin(t)$ to get
$(-2d_1+d_2)\sin(t)+(d_1+2d_2)\cos(t) = 5\sin(t)$. Match coefficients to find the system of equations $(-2d_1+d_2)=5$, $(d_1+2d_2)=0$. Solve for the coefficients $d_1=-2$, $d_2=1$.
}

%\Answer{ The discriminant is $D=10^2-4(4)(3)=52$. Over-damped.}
% solve(4*r^2+10*r+2*w=0,r);

  \BF{(l)} Find by variation
 of parameters an integral formula for a particular solution $x_p$ of
the equation $ x'' + 4x'
 +20x = e^{t^2}\ln(t^2+1)$. To save time, don't try to evaluate
integrals
 (it's impossible).

 \Answer{ Use the variation of parameters formula (33) in section 5.5 of Edwards-Penney. Then
 \\
 $x_p(t) = x_1(t) \int_0^t k_1(u)f(u)du+x_2(t)\int_0^t
k_2(u)f(u)du$,
\\
where $f(t)=e^{t^2}\ln(t^2+1)$. Symbols $x_1, x_2, k_1, k_2$ are defined as follows.  The homogeneous equation $x'' + 4x'
 +20x = 0$ has a basis the Euler atoms
$x_1(t)=e^{-2t}\cos (4t)$, $x_2(t)=e^{-2t}\sin (4t)$. Symbol $k_1(u)=-x_2(u)/W(u)$,
symbol $k_2(u)=x_1(u)/W(u)$, and the Wronskian determinant of $x_1,x_2$ is $W(u)=2e^{-4u}$.}

 \BF{(m)}
 Write the solution $x(t)$ of
 $$x''(t)+25x(t) = 180\sin (4t), \quad x(0)=x'(0)=0,$$ as the sum
 of two harmonic oscillations of different natural frequencies.\newline
 {\bf To save time, don't convert to phase-amplitude form}.

\Answer{ $x(t)= -16\sin(5t)+20\sin(4t)$ by the method of undetermined coefficients. Rule I: $x=d_1\cos(4t)+d_2\sin(4t)$. Rule II does not apply due to natural frequency $\sqrt{25}=5$
not equal to the frequency of the trial solution (no conflict).  Substitute the trial solution into
$x''(t)+25x(t) = 180\sin (4t)$
to get $9d_1\cos(4t)+9d_2\sin(4t) = 180\sin(4t)$. Match coefficients, to arrive at the equations
$9d_1=0$, $9d_2=180$. Then $d_1=0$, $d_2=20$ and $x_p(t)=20\sin(4t)$. Lastly, add the homogeneous solution to obtain $x(t)=x_h+x_p=c_1\cos(5t)+c_2\sin(5t)+20\sin(4t)$. Use the initial condition relations $x(0)=0, x'(0)=0$ to obtain the equations
$\cos(0)c_1+\sin(0)c_2+20\sin(0)=0$, $-5\sin(0)c_1 + 5\cos(0)c_2 +80\cos(0)=0$. Solve for the coefficients $c_1=0$, $c_2=-16$
}
% de:=diff(y(x),x,x)+25*y(x)=180*sin(4*x);dsolve(de,y(x));
% subs(y(x)=d1*cos(4*x)+d2*sin(4*x),de);collect(%,{cos(4*x),sin(4*x)});
% ic:=x(0)=0,D(x)(0)=0;dsolve([de,ic],y(x)); #y(x) = -16*sin(5*x)+20*sin(4*x) % F2010


 \BF{(n)} Given $5x''(t) + 2x'(t) + 4x(t) = 0$, which represents a
 damped spring-mass system with $m=5$, $c=2$, $k=4$, determine if the equation is
 over-damped , critically damped  or
 under-damped.\newline
 {\bf To save time, do not solve for $x(t)$}!

\Answer{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)(4)=(19)(-4)$, therefore there are two complex conjugate roots
and the equation is {\bf under-damped}. Alternatively, factor $5r^2+2r+4$ to obtain roots $(-1\pm\sqrt19 i)/5$
and then classify as {\bf under-damped}.}

 \BF{(o)}
Determine the practical resonance frequency $\omega$ for the electric
current equation
$$2I''+7I'+50I = 100\omega\cos(\omega t).$$

\Answer{ $\omega= 1/\sqrt{LC} = 1/\sqrt{2/50}=\sqrt{25}=5$. The solution uses the theory in the textbook, section EPbvp3.7, which says that electrical resonance occurs for $\omega= 1/\sqrt{LC}$.}

 \BF{(p)} Given the forced spring-mass system $ x'' + 2x' + 17x =
82\sin(5t)$, find the steady-state periodic
 solution.

% de:=diff(x(t),t,t)+2*diff(x(t),t)+17*x(t)=82*sin(5*t);dsolve(de,x(t));
% yp:=A*cos(5*t)+B*sin(5*t);eval(subs(x(t)=yp,de));
% solve({-8*A+10*B=0, -10*A-8*B=82});
\Answer{$x(t)=-5\cos(5t)-4\sin(5t)$ by undetermined coefficients. Rule I: The trial solution is  $x_p(t)=A\cos(5t)+B\sin(5t)$. Rule II:  because
the homogeneous solution $x_h(t)$ has limit zero at $t=\infty$, then Rule II does not apply (no conflict). Substitute the trial solution into the differential equation. Then $-8A\cos(5t)-8B\sin(5t)-10A\sin(5t)+10B\cos(5t) = 82\sin(5t)$. Matching coefficients of sine and cosine gives the equations $-8A+10B=0$, $-10A-8B=82$. Solving, $A=-5, B=-4$. Then $x_p(t)=-5\cos(5t)-4\sin(5t)$ is the unique periodic steady-state solution. }

  \BF{(q)} Consider the variation
 of parameters formula (33) in Edwards-Penney,
$$
y_p(x) = y_1(x)\left( \int \frac{-y_2(x)f(x)}{W(x)}dx\right) + y_2(x)\left( \int \frac{y_1(x)f(x)}{W(x)}dx\right).
 $$
Given the second order equation
$$ 2 y''(x) + 4 y'(x) + 3 y(x) = 17\sin(x^2),$$
write the equations for the variables $y_1$, $y_2$, $f$. \newline
{\bf To save time, do not compute $W$ and do not write out $y_p$. Do not try to evaluate any integrals}!
 \Answer{ To put the differential equation into the correct form for (33), divide by $2$: \\
 $  y''(x) + 2 y'(x) + \frac32 y(x) = \frac{17}{2}\sin(x^2)$\\
 The characteristic equation $r^2+2r+ \frac32 = 0$ has roots $-1\pm i\sqrt2$. Variables are the Euler atoms $y_1(x)=e^{-x}\cos (x/\sqrt2)$,
$y_2(x)=e^{-x}\sin (x/\sqrt2)$, the forcing term $f(x)=\frac{17}{2}\sin(x^2)$ and the Wronskian $W=y_1y_2'-y_1'y_2$.
} % S2012

% solve(2*r^2+4*r+3=0,r);


 \BF{(r)} A homogeneous linear differential equation with
constant coefficients has characteristic equation
of order $6$ with roots $0$, $0$,  $-1$, $-1$, $2i$, $-2i$,
listed according to multiplicity.
The corresponding non-homogeneous equation for unknown $y(x)$ has
right side
$f(x)= 5e^{-x}+4x^2+x\cos 2x + \sin 2x$.
Determine the undetermined coefficients
{\bf shortest} trial solution for $y_p$.\newline
{\bf To save time,  do not evaluate the
 undetermined coefficients and do not find $y_p(x)$!
 Undocumented detail or guessing subtracts credit}.

\Answer{
The Euler solution atoms for roots of the characteristic equation are
$1, x$;\quad $e^{-x}, xe^{-x}$;\quad $\cos 2x, \sin 2x$.
\\
The atom list for $f(x)$ is $e^{-x}$, $1,x,x^2$, $\cos 2x$, $x\cos 2x$, $\sin 2x$, $x \sin 2x$.
This list of 8 atoms is broken into 4 groups, each
group having exactly one base atom: (1) $1,x,x^2$;\quad (2) $e^{-x}$;\quad (3)
 $\cos 2x$, $x\cos 2x$;\quad (4) $\sin 2x$, $x\sin 2x$. Each group contains a solution of the homogeneous equation.
Modification Rule II is applied to groups 1 through 4. The shortest trial solution is a
linear combination of the replacement 8 atoms in the new list
(1*) $x^2,x^3,x^4$;\quad (2*) $x^2e^{-x}$;\quad (3*) $x\cos 2x$, $x^2\cos 2x$;\quad (4*)
$x\sin 2x$, $x^2\sin 2x$.}



 \BF{ (s)} Let $f(x)=x^3e^{1.2x}+x^2e^{-x}\sin(x)$. Find the
characteristic polynomial of a constant-coefficient
linear homogeneous differential equation of least order which has $f(x)$ as a
solution. To save time, do not expand the polynomial and do not find the differential equation.

\Answer{The characteristic polynomial is the expansion $(r-1.2)^4((r+1)^2+1)^3$. Because
$x^3e^{ax}$ is an Euler solution atom for the differential equation if and only if
$e^{ax},xe^{ax},x^2e^{ax},x^3e^{ax}$ are Euler solution
atoms, then the characteristic equation must have roots
$1.2,1.2,1.2,1.2$, listing according to multiplicity. Similarly, $x^2e^{-x}\sin(x)$ is an Euler solution
 atom for the differential equation
if and only if $-1\pm i,-1\pm i,-1\pm i$ are roots of the characteristic
equation. There is a total of 10 roots with product of the
factors $(r-1)^4((r+1)^2+1)^3$ equal to the 10th degree characteristic polynomial.}
\end{exercises}
\EJECT
\subsection*{Chapter 10}
\begin{exercises}
\prob{3.}{(Chapter 10)} Complete all parts.
It is assumed that you have memorized the basic 4-item Laplace
integral table and know the 6 basic rules for Laplace integrals. No
other tables or theory are required to solve the problems below. If
you don't know a table entry, then leave the expression unevaluated
for partial credit.
\end{exercises}


\BF{(a)} Display the details of Laplace's method to solve
 the system for $x(t)$. Don't solve for $y(t)$!
$$
 \begin{array}{lcl}
  x' = x+3y, \\
  y' = -2y, \\
  x(0)=1,\quad y(0)=2.
 \end{array}
$$
%{\bf Lectures}: {\small\em Effort can be saved by using the Laplace
%resolvent shortcut equation $(sI-A)\L(\.u)=\.u(0)$ and Cramer's Rule.
%Notation: $\.u$ is the vector solution of $\.u'=A\.u$ with components
%$x(t)$, $y(t)$. The same credit applies if you don't use this shortcut,
%but solve the problem correctly using Laplace theory.}
\Answer{The Laplace resolvent equation $(sI-A)\L(\.u)=\.u(0)$ can be
written out to find a $2\times 2$ linear system for unknowns $\L(x(t))$,
$\L(y(t))$:
$$(s-1)\L(x)+(-3)\L(y)=1,\quad (0)\L(x)+(s+2)\L(y)=2.$$
Any other method of
arriving at the system of linear algebraic equations is acceptable,
it is not an error to do it another way.
Elimination or Cramer's rule or matrix inversion applies to this system to solve for
$\dd\L(x(t))=\frac{(s+2)+6}{(s-1)(s+2)}=\frac{-2}{s+2}+\frac{3}{s-1}$. Then the
backward table implies $x(t)=-2e^{-2t}+3e^{t}$.
}

% dsolve({diff(x(t),t)=1*x(t)+3*y(t),diff(y(t),t)=0*x(t)+(-2)*y(t),x(0)=1,y(0)=2} , {x(t),y(t)});
% {x(t) = -2*exp(-2*t)+3*exp(t), y(t) = 2*exp(-2*t)}




 \BF{(b)} Find $f(t)$ by partial fractions, the shifting theorem and the backward table,
given
$$\L(f(t))=
\frac{2s^3+3s^2-6s+3}{s^3(s-1)^2}.$$

\Answer{The numerator has degree 3, less than the denominator degree 5. Partial fraction theory
 gives an expansion $\frac{2s^3+3s^2-6s+3}{s^3(s-1)^2} = \frac{a}{s}+\frac{b}{s^2}+\frac{c}{s^3}+\frac{d}{s-1}+\frac{e}{(s-1)^2}$. Clear the fractions and obtain a system of equations for $a,b,c,d,e$. Solve the system: $a=b=0$, $c=3$, $d=0$, $e=2$. Then $\L(f(t))=\frac{3}{s^3}+\frac{2}{(s-1)^2} = \L(3t^2/2+2te^{t})$
implies by Lerch's theorm $f(t)=3t^2/2+2te^{t}$.}
% convert((2*s^3+3*s^2-6*s+3)/((s-1)^2*s^3),parfrac,s); # S2013
% inttrans[laplace](3*t^2/2+2*t*exp(t),t,s);simplify(%); # 2015

 \BF{(c)} Solve for $f(t)$, given
$$\L(e^{2t}f(t))+2\frac{d^2}{ds^2}\L(tf(t))= \frac{s+3}{(s+1)^3}.
$$
%%with(inttrans):diff(laplace((2*t),t,s),s,s)-diff(laplace((2*t)*t,t,s),s);
% ans: f = 2t
\Answer{ Use the $s$-differentiation theorem, partial fractions and the
backward Laplace table plus the shift theorem to get
$\L(e^{2t}f(t))+2\L((-t)^2(t)f(t))=\frac{1}{(s+1)^2}+\frac{2}{(s+1)^3}
=\L(te^{-t}+t^2e^{-t})$. Lerch's
theorem implies $(e^{2t}+2t^3)f(t)=te^{-t}+(t^2)e^{-t}$.
Then $f(t)=(t+t^2)e^{-t}/(e^{2t}+2t^3)$.}

 \BF{(d)}  Solve for $f(t)$, given
$$\L(e^{-3t}f(t))= \frac{s+1}{(s+2)^2}
$$
\Answer{
$\L(e^{-3t}f(t))=\left.\frac{s-1}{s^2}\right|_{s\to(s+2)}=
\left. \left(\frac{1}{s}-\frac{1}{s^2}\right)\right|_{s\to(s+2)}
=\L((1-t)e^{-2t})$.
Then $f(t)=(1-t)e^{-2t}e^{3t}=(1-t)e^t$.}



 \BF{(e)} Fill in the blank spaces in the Laplace table:
%\begin{center}\large\rm
%\def\Ll{{\cal L}}
%\def\Fix#1{\raisebox{-4.0ex}{#1}}
%\begin{tabular}{|l||p{0.4in}|p{0.8in}|p{0.9in}|p{0.9in}|p{0.9in}|}
%\hline \Fix{$f(t)$} &
%\Fix{$t^3$} &   &  & \Fix{$e^{-t}\sin 2 t$} & \Fix{$t^3e^{-t/2}$}\\[8ex]
%\hline \Fix{$\Ll(f(t))$} &
%\Fix{$\dd\frac{6}{s^4}$} & \Fix{$\dd\frac{1}{(3s-2)^3}$} & \Fix{$\dd\frac{s+1}{s^2+2s+17}$} & &
%\\[8ex]
%\hline
%\end{tabular}
%\end{center}
\begin{center}\large\rm
\def\Ll{{\cal L}}
\def\Fix#1{\raisebox{-2.0ex}{#1}}
\def\CC{$\phantom{\dd\frac{s^2+1}{s^2+2s+17}\frac{s^2+1}{s^2+2s+17}}$}
\def\AA{\begin{tabular}{|c|c|}
\hline \Fix{$f(t)$} & \Fix{$\Ll(f(t))$} \\[4ex] \hline
\Fix{$t^3$} &  \Fix{$\dd\frac{6}{s^4}$} \\[4ex] \hline
\Fix{$e^{-t}\cos (4 t)$} & \CC \\[4ex] \hline
\Fix{$(t+2)^2$} & \CC \\[4ex] \hline
\Fix{$t^2 e^{-2t}$} & \CC \\[4ex]
 \hline
\end{tabular}}
\def\BB{\begin{tabular}{|c|c|}
\hline \Fix{$\Ll(f(t))$} & \Fix{$f(t)$}  \\[4ex] \hline
\Fix{$\dd\frac{3}{s^2+9}$} & \Fix{$\sin 3t$}  \\[4ex] \hline
\Fix{$\dd\frac{s-1}{s^2-2s+5}$} & \CC \\[4ex] \hline
 \Fix{$\dd\frac{2}{(2s-1)^2}$} & \CC \\[4ex] \hline
 \Fix{$\dd\frac{s}{(s-1)^3}$} & \CC \\[5ex]
\hline
\end{tabular}}
\begin{tabular}{c@{\hspace{4pc}}c}
\bf Forward Table & \bf Backward Table \\[1ex]
 \AA & \BB \end{tabular}
\end{center}
\Answer{Forward: $\dd\frac{s+1}{(s+1)^2+16}$,\quad $\dd \frac{2}{s^3}+\frac{4}{s^2}+\frac{4}{s}$,\quad
$\frac{2}{(s+2)^3}$.
\newline
Backward: $e^{t}\cos(2t)$,\quad $\dd (1/2)te^{t/2}$,\quad
$te^t+(t^2/2)e^t$.}
%% inttrans[invlaplace](s/(s^2+6*s+18),s,t); inttrans[laplace](t^2*exp(-t/3),t,s);

% \BF{(4b)} [50\%] Solve by Laplace's method for the solution $x(t)$:
%$$x''(t)+4x(t)=10 e^{2t},\quad x(0)=x'(0)=0.$$
%%de2:=diff(x(t),t,t) + 0*diff(x(t),t) + 4*x(t) = 10*exp(2*t);
%%ic:=x(0)=0,D(x)(0)=0;
%% dsolve({de2,ic},x(t));
%
%\Answer{ $x(t) = $.}

\BF{(f)}
\def\u{{\bf u}}
Find $\L(f(t))$ from the Second Shifting theorem, given $\dd f(t)=\sin(2t)\u(t-2)$, where
$\u$ is the unit step function defined by $\u(t)=1$ for $t\ge 0$,
$\u(t)=0$ for $t<0$.

\Answer{
\def\u{{\bf u}}
Use the second shifting theorem
$$\L(g(t)u(t-a))=e^{-as}\L\left(\left.g(t)\right|_{t\to t+a}\right).$$
%$$\L(f(t-a)\u(t-a))=e^{-as}\L(f(t)).$$
Write $g(t) = \sin(2t)$.

 Then $\dd\L(f(t))=\L(g(t)u(t-2))=
 e^{-2s}\L(\left.g(t)\right|_{t->t+2}) =
 e^{-2s}\L(\sin(2t+4))=e^{-2s}\L(\sin(2t)\cos(4)+\sin(4)\cos(2t))$. Then
 the Forward Table implies $\L(f(t))=e^{-2s}\left( \frac{2\cos 4}{s^2+4}+\frac{s\sin(4)}{s^2+4}\right)$.
}

(\BF{g})
\def\u{{\bf u}}
Find $f(t)$ from the Second Shifting Theorem, given $\dd \L(f(t))=\frac{s\,e^{-\pi s}}{s^2+2s+17}$.

\Answer{
\def\u{{\bf u}}
Use the second shifting theorem in backward form
%$$\L(g(t)u(t-a))=e^{-as}\L\left(\left.g(t)\right|_{t\to t+a}\right).$$
$$e^{-as}\L(f(t))=\L(f(t-a)\u(t-a)).$$
 Then $\dd\L(f(t))=\frac{s\,e^{-\pi s}}{(s^2+2s+1)+16}= e^{-\pi s}\L(e^{-t}\cos(4t)) = \L(
 \left.e^{-t}\cos(t)u(t)\right|_{t\to(t-\pi)})=\L(e^{-t+\pi}\cos(t-\pi)u(t-\pi))$. Then Lerch's theorem implies $f(t)=e^{-t+\pi}\left(\cos(t)\cos(\pi)+\sin(t)\sin(\pi)\right)u(t-\pi)$, which reduces to $f(t)= -e^{-t+\pi}\cos(t)u(t-\pi)$.
}
% inttrans[laplace]((sin(2*t-Pi/4))*Heaviside(t-2*Pi),t,s);

\BF{(h)}  Solve for $x(t)$, given
$$\L(x(t))=\frac{d}{ds}\left(\L(e^{2t}\sin 2t)\right)  + \left.\L(t\sin t)\right|_{s\to (s+2)}.
$$
% convert((1+s)/(s^2+5*s),parfrac,s);
\Answer{ $x(t)=-te^{2t}\sin 2t + te^{-2t}\sin t$.
The first term on the right is replaced by $\L(-te^{2t}\sin(2t))$, by the $s$-differentiation theorem. The second term on the right is replaced by $\L(e^{-2t}\,t\sin(t))$, by the first shifting theorem. Lerch's theorem applies to give $x(t) = -te^{2t}\sin(2t) + e^{-2t}\,t\sin(t)$.
}

\BF{(i)}  Solve for $x(t)$, given
$$\L(x(t))=
\frac{s+2}{(s+1)^2} +
\frac{1+s}{s^2+5s}
$$
% convert((1+s)/(s^2+5*s),parfrac,s);
\Answer{The idea is to use the first shifting theorem on the first term on the right, then partial fractions on the second term. Another idea is to use partial fractions on both terms combined. The details:\\
$\L(x(t))=\left.\frac{s+1}{s^2}\right|_{s\to(s+1)}+\frac{1}{5s}+\frac{4}{5(s+4)}$\\
$\L(x(t))=\left.\left(\frac{1}{s} + \frac{1}{s^2}\right)\right|_{s\to(s+1)}+\frac{1}{5s}+\frac{4}{5(s+4)}$\\
$\L(x(t))=\L\left((1+t)e^{-t}+\frac15+\frac45e^{-4t}\right)$\\
Then Lerch's theorem implies $x(t)=(1+t)e^{-t}+\frac15+\frac45e^{-4t}$.
}

\BF{(j)}  Find $\L(f(t))$, given
$\dd
f(t)=e^{2t}\left(\frac{\sin (t)}{t}\right)$.

\Answer{ Let $g(t)=(1/t)\sin t$. Then
$\frac{d}{ds}\L(g(t))=\L(-tg(t))=\L(-\sin t)=-1/(s^2+1)$. Solve the quadrature problem
$\frac{dG(s)}{ds}=\frac{-1}{s^2+1}$, where $G(s)=\L(g(t))$, to get
$G(s)=c-\arctan{s}$. 
Because $\L(g(t))$ has limit zero at $s=\infty$, then $c=\frac{\pi}{2}$.
Then
$L(f(t))=\left.\L(g(t))\right|_{s\to(s-2)}=\frac{\pi}{2}-\arctan(s-2)$. 
}

\BF{(k)}  Apply Laplace's method to find a
formula for $\L(x(t))$. {\bf Do not} solve for $x(t)$! Document
steps by reference to tables and rules.
$$
 \frac{d^4x}{dt^4}+ 4\frac{d^2x}{dt^2} = e^{t}(5t + 4e^t + 3\sin 3t),
 \quad x(0)=x'(0)=x''(0)=0,\quad x'''(0)=-1.
$$
\Answer{ $\L(x(t))=p/q$, $p=1+\L(e^{t}(5t + 4e^t + 3\sin 3t))$,
$q=s^4+4s^2$. Expanding,
$p=1+\left.\left(\frac{5}{s^2}+\frac{4}{s-1}+\frac{9}{s^2+9}\right)\right|_{s\to(s-1)}
=1+\frac{5}{(s-1)^2}+\frac{4}{s-2}+\frac{9}{(s-1)^2+9}$.}

%eq1:=(3*s^3+12*s-5*s^2-4)/((s-2)^2*(s^2+4));
% converted == 2/(s-2)+3/(s-2)^2+s/(s^2+4)
%eq1:=(2+2*s)/(s^2-2*s);convert(eq1,parfrac,s);
%  eq2:=5*(s+3)/((s-2)^2*(s^2+1));convert(eq2,parfrac,s);
%  #ans == -1/s+3/(s-2) -3/(s-2)+5/(s-2)^2+(1+3*s)/(s^2+1)
% eq:=(2+2*s)/(s^2-2*s);convert(eq,parfrac,s);
% eq:=9*(s^2-3)/((s+2)*(s+1)^2);convert(eq,parfrac,s);
% ans == -1/s+9/(s+2)-18/(1+s)^2+3/(s-2)
%$$\L(f(t))=
%\frac{2-2s}{s^2+2s} + \frac{9s^2-27}{(s-1)^2(s+2)}.$$
% eq:=(2-2*s)/(s^2+2*s);convert(eq,parfrac,s);
% eq:=9*(s^2-3)/((s+2)*(s-1)^2);convert(eq,parfrac,s);
% ans:=1/(s+2)-6/((s-1)^2)+8/(s-1);
% eq:=2*(s^2-3)/((s+1)*(s-1)^2);convert(eq,parfrac,s);

\BF{(l)}  Find $\L(f(t))$, given $\dd
f(t)=u(t-\pi)\frac{\sin (t)}{t-\pi}$, where $u$ is the unit step function.

\Answer{ Use the second shifting theorem
$\L(u(t-a)g(t))=e^{-as}\L(g(t+a))$. Then $\L(f(t))=e^{-\pi
s}\L\left(\frac{\sin(t+\pi)}{t-\pi+\pi}\right)=e^{-\pi
s}\L\left(\frac{-\sin t}{t}\right)$. Let $h(t)=\frac{-\sin t}{t}$, then
$\L(th(t))=\frac{-1}{s^2+1}$ implies a first order DE $-\frac{dH}{ds}=
\frac{-1}{s^2+1}$, which can be solved to get
$H(s)=\arctan(s)-\frac{\pi}{2}$. Then $\L(f(t))=e^{-\pi
s}(\arctan(s)-\pi/2)$.}


\BF{(m)}  Find $f(t)$ by partial fraction methods,
given
$$\L(f(t))=\frac{8s^2-24}{(s-1)(s+3)(s+1)^2}.$$
%eq:=8*(s^2-3)/((s-1)*(s+3)*(s+1)^2);convert(eq,parfrac,s);
% ans ==  -1/(s-1)-3/(s+3)+4/((s+1)^2)+4/(s+1)
\Answer{
$\L(f(t))=\frac{-1}{s-1}+\frac{-3}{s+3}+\frac{4}{(s+1)^2}+\frac{4}{s+1}
=\L\left(-e^t-3e^{-3t}+4te^{-t}+4e^{-t}\right)$. Then by Lerch's theorem, 
$f(t)=-e^t-3e^{-3t}+4te^{-t}+4e^{-t}$.
}


\BF{(n)}  Apply Laplace's method to find a
formula for $\L(x(t))$. To save time, {\bf do not} solve for $x(t)$!
Document steps by reference to tables and rules.
$$
 x^{(4)} + x^{(2)} = 3t + 4e^{t} + 5\sin 2t, \quad x(0)=x'(0)=x''(0)=0,\quad x'''(0)=-1.
$$
\Answer{ $\L(x(t))=p/q$, $p=-1+\L(\mbox{RHS})$, $q=s^4+s^2$. Finally
$p=-1+\L(3t+4e^{t}+5\sin 2t)=
-1+\frac{3}{s^2}+\frac{4}{s-1}+\frac{10}{s^2+4}$. Rules: Parts $\L(f')=s\L(f)-f(0)$, Linearity. Tables used to evaluate $\L(\mbox{RHS})$.}


\EJECT
\subsection*{Chapter 6}

%{\Large\sf Further editing is needed in the following problems, to remove errors. Please be patient.}
\begin{exercises}
\prob{5.}{(Chapter 6)} Complete all parts.
\end{exercises}

 \BF{(a)}  Define $E=\left(\begin{array}{rrr}
   4 & 2 & -2 \\ 0 & 3 & 1 \\ 0 & 1 & 3
   \end{array}\right).$ Find
     $E^3\colvector{1\\ 0\\ 0}$ without using matrix multiply.

\Answer{ Define $\.v\equiv\colvector{1\\ 0\\ 0}$. Then $\.v=\.v_2$, where
$\.v_1$, $\.v_2$, $\.v_3$ are the eigenvectors of $E$ for eigenvalues $\lambda_1=2$, $\lambda_2=4$,
$\lambda_3=4$. Then
$E^3\.v=E(E(E\.v_2))=4^3\.v_2=\colvector{64\\ 0\\ 0}$.}


\BF{(b)}  Find the eigenvalues of the matrix $A=\left(\begin{array}{rrrr}
 1 & 4 & 1 & 12 \\
 -4 & 1 & -3 & 15 \\
 0 & 0 &  -1 & 6 \\
 0 & 0 & -2 & 7
 \end{array}\right)$. To save time, {\bf do not} find
 eigenvectors!

%A:=matrix([[1,4,1,12],[-4,1,-3,15],[0,0,-1,6],[0,0,-2,7]]); eigenvals(A);
% 1, 5, 1+4*I, 1-4*I
\Answer{ $1,5,1\pm 4i$}

\BF{(c)}  Given
$A=\left(\begin{array}{rrrr}
 1 & -1 & 1 \\
 1 & 3 & -1  \\
 1 & 1 &  1
 \end{array}\right)$, which has eigenvalues $1,2,2$, find all eigenvectors for eigenvalue $2$.

%% A:=matrix([[1, -1, 1], [1, 3, -1], [1, 1, 1]]); eigenvals(A);
% #[2, 2, {vector([-1, 1, 0]), vector([1, 0, 1])}], [1, 1, {vector([-1, 1, 1])}]
\Answer{ One frame sequence is required for $\lambda=2$.
The sequence starts with $\left(\begin{array}{rrrr}
-1 & -1 & 1 \\
 1 & 1 & -1  \\
 1 & 1 &  -1 \end{array}\right)$, the last frame having two rows of zeros. There are two
 invented symbols $t_1$, $t_2$ in the last frame algorithm answer $x_1=-t_1+t_2$, $x_2=t_1$, $x_3=t_2$. Taking $\partial_{t_1}$ and
 $\partial_{t_2}$
 gives two eigenvectors, $\colvector{-1\\ 1\\ 0}$ and $\colvector{1\\ 0\\ 1}$.
}


 \BF{(d)} Given
$A=\left(\begin{array}{rrrr}
 1 & 1 & -1 \\
 0 & 0 & 1  \\
 0 & 1 &  0
 \end{array}\right)$, which has eigenvalues $1,1,-1$, assume
 there exists an invertible matrix $P$ and a diagonal matrix $D$ such that
 $AP=PD$. Circle those vectors from the list below which are possible columns of $P$.
 $$\colvector{1\\ -1\\ 2},\quad
 \colvector{1\\ 1\\ 1},\quad
 \colvector{1\\ 1\\ -1}.
$$
\Answer{ Matrix $P$ must contain eigenvectors of $P$ corresponding to
eigenvalues $1$, $1$, $-1$, in some order. For each given vector $\.v$, multiply out $A\.v$
and see if it equals $\lambda\.v$ for some $\lambda$. The first fails. The second works for
$\lambda=1$. The third fails.}

 %with(linalg):A:=matrix([[1,1,-1],[0,0,1],[0,1,0]]); eigenvects(A);
% ans== [1, 2, {Vector[row](3, {(1) = 0, (2) = 1, (3) = 1}),
%   Vector[row](3, {(1) = 1, (2) = 0, (3) = 0})}],
% [-1, 1, {Vector[row](3, {(1) = 1, (2) = -1, (3) = 1})}]

 \BF{(e)}  Find the remaining eigenpairs of
$$E=\left(\begin{array}{rrr}
    6 & 2 & -2 \\ 0 & 5 & 1 \\ 0 & 1 & 5
    \end{array}\right)$$
provided we already know one eigenpair
% A:=matrix([[6,2,-2],[0,5,1],[0,1,5]]); eigenvects(A);
% ans ==  [4, 1, {vector([2, -1, 1])}],
% [6, 2, {vector([1, 0, 0]), vector([0, 1, 1])}]
$$\left(6 ,  \colvector{0\\ 1\\ 1}\right).$$
\Answer{ Eigenvalues are $4$, $6$, $6$ with corresponding eigenvectors
$\colvector{2\\ -1\\ 1}$, $\colvector{1\\ 0\\ 0}$, $\colvector{0\\ 1\\
1}$.\\
There are two linear algebra problems: (1) $(A-4I)\vec{v}=\vec{0}$;\quad (2) $(A-6I)\vec{v}=\vec{0}$.
\\
(1) For $\lambda=4$, there is only one eigenvector $\vec{v}_1$ found from the general solution by taking the partial derivative on free variable symbol $t_1$.
\\
(2) For $\lambda=6$, there are two free variables with invented symbols $t_1,t_2$. The eigenvectors $\vec{v}_2, \vec{v}_3$ are found from the general solution by taking partials on symbols $t_1,t_2$. 
These vectors are Strang's Special Solutions.
}



 \BF{(f)}  Suppose a $3\times 3$ matrix $A$ has eigenpairs
 $$\left(2,\colvector{1\\ 2\\ 0}\right),\quad
 \left(2,\colvector{1\\ 1\\ 0}\right),\quad \left(0,\colvector{0\\ 0\\ 1}\right).$$
Display an invertible matrix $P$ and a
 diagonal matrix $D$ such that $AP=PD$.

\Answer{ Define $P=\threebythree{1 & 1 &0}{2 & 1 & 0}{0 &0&1}$, $D=\threebythree{2&0&0}{0&2&0}{0&0&0}$.
Then $AP=PD$.}


 \BF{(g)}  Assume the vector general solution $\.x(t)$ of the linear
 differential system $\.x' = A\.x$ is given by
$$\.x(t) = c_1 \colvector{3\\ 1\\ 1} + c_2e^{2t}\colvector{-1\\ 2\\ 0}+c_3e^{2t}\colvector{0\\ 0\\ 1}.$$
Display Fourier's model for the $3\times 3$ matrix $A$.

\Answer{ $A\left(c_1 \colvector{3\\ 1\\ 1} + c_2\colvector{-1\\ 2\\
0}+c_3\colvector{0\\ 0\\ 1}\right) =0c_1 \colvector{3\\ 1\\ 1} +
2c_2\colvector{-1\\ 2\\ 0}+2c_3\colvector{0\\ 0\\ 1}$.}

 \BF{(h)}  Find the eigenvalues of the matrix $A=\left(\begin{array}{rrrr}
 -2 & 7 & 1 & 27 \\
 -1 & 6 & -3 & 62 \\
 0 & 0 &  3 & 2 \\
 0 & 0 & -1 & 0
 \end{array}\right)$. To save time, {\bf do not} find
 eigenvectors!
%A:=matrix([[-2,7,1,27],[-1,6,-3,62],[0,0,3,2],[0,0,-1,0]]); eigenvals(A);
%                            -1, 1, 2, 5

\Answer{ Expand $|A-\lambda I|$ by cofactors along column 1. The eigenvalues are
$-1,1,2,5$.}

 \BF{(i)}  Assume $A$ is $2\times 2$ and Fourier's model holds:
 $$A\left(c_1\colvector{1 \\ 1} + c_2\colvector{1 \\ -1}\right) =2 c_2\colvector{1 \\ -1}.$$
 Find $A$.

 % A:=matrix([[1,-1],[-1,1]]); eigenvects(A);
 % ans == [0, 1, {vector([1, 1])}], [2, 1, {vector([-1, 1])}]
\Answer{ $AP=PD$ implies
$A=PDP^{-1}=\twobytwo{1&1}{1&-1}\twobytwo{0&0}{0&2}
\twobytwo{.5&.5}{.5&-.5}=\twobytwo{1&-1}{-1&1}$.}

 \BF{(j)}  Let
$A=\left(\begin{array}{rrrr}
 3 & 0 & -1 \\
 0 & 3 & 0  \\
 0 & 0 &  3
 \end{array}\right)$.  Circle the possible eigenvectors of $A$ in the list below.
 $$\colvector{-4\\ 2\\ 0},\quad
 \colvector{1\\ 0\\ 0}, \quad
 \colvector{0\\ 0\\ 1}.
$$

% A:=matrix([[3,0,-1],[0,3,0],[0,0,3]]); eigenvects(A);
% ans== [3, 3, {vector([1, 0, 0]), vector([0, 1, 0])}]
\Answer{ The first and second are eigenvectors for $\lambda=3$. The third is not an eigenvector. \\
The matrix is triangular, therefore the eigenvalues are on the diagonal, $\lambda_1=\lambda_2=\lambda_3=3$. The problem should be solved by testing the equation $A\.v=3\.v$ for each of
the 3 vectors $\,v$ in the list, not by doing the eigenanalysis of $A$. 
\\
{\bf Remarks}. Fourier's model does not hold [$A$ is not diagonalizable]
because there are only two eigenvectors $\colvector{1\\ 0\\ 0}$ and
$\colvector{0\\ 1\\ 0}$ for eigenvalue $\lambda=3$. The first is a
linear combination of these eigenvectors, hence itself an eigenvector.
The second is among the eigenvectors just reported. The third is not an eigenvector.}

 \BF{(k)}  Consider the $3\times 3$ matrix
$$E=\left(\begin{array}{rrr}
    4 & 2 & -2 \\ 0 & 3 & 1 \\ 0 & 1 & 3
    \end{array}\right).$$
Show that matrix $E$ has a Fourier model:
$$E\left(c_1\colvector{1\\ 0\\ 0}+c_2\colvector{0\\ 1\\ 1} + c_3\colvector{2\\ -1\\ 1}\right)=
4c_1\colvector{1\\ 0\\ 0}+4c_2\colvector{0\\ 1\\ 1} + 2c_3\colvector{2\\ -1\\ 1}.$$

\Answer{ Do the eigenanalysis of $A$. Alternate: verify that the
eigenpairs extracted from Fourier's model actually work, which involves
3 matrix multiplies. The alternate method is substantially less work.}

% A:=matrix([[4,2,-2],[0,3,1],[0,1,3]]); eigenvects(A);
% ans == [4, 2, {vector([1, 0, 0]), vector([0, 1, 1])}], [2, 1, {vector([2, -1, 1])}]


 \BF{(l)}  Let $P=\twobytwo{3 & 1}{1 & -1}$, $D=\twobytwo{3 & 0}{0 & -2}$ and define $A$ by $AP=PD$.
 Display the eigenpairs of $A$.

 \Answer{ $\left(3,\colvector{3\\ 1}\right)$, $\left(-2,\colvector{1\\
-1}\right)$}


 \BF{(m)}  Assume the vector general solution $\vec{\.u}(t)$ of the $2\times 2$ linear
 differential system $\vec{\.u}' = C\vec{\.u}$ is given by
$$\vec{\.u}(t) = c_1 e^{2t} \colvector{1\\ -1} + c_2 e^{2t}\colvector{2\\ 1}.$$
Find the matrix $C$.

%%P:=matrix([[1,2],[-1,1]]); DD:=diag(2,2);C:=evalm(P&*DD&*inverse(P));
%% ans: matrix([[-2, -4], [2, 4]])

 \Answer{ The eigenvalues come from the exponents in the
exponentials, $2$ and $2$. The eigenpairs are $\left(2,\colvector{1\\
-1}\right)$, $\left(2,\colvector{2\\ 1}\right)$. Then
 $P=\twobytwo{1&2}{-1&1}$, $D=\twobytwo{2&0}{0&2}$. Solve $CP=PD$ to find $C=\twobytwo{2&0}{0&2}$. The usual eigenpairs for $C$ are the columns of the identity. But the eigenvalues are equal, therefore any linear combination of the two eigenvectors is also an eigenvector. This justifies the correctness of the strange eigenpairs given in the problem.}

 \BF{(n)}  Find all eigenpairs for the matrix $A=\twobytwo{1 & 1 }
 {2 & 2}$. Then display Fourier's model for $A$.

 % A:=matrix([[1,1],[2,2]]); eigenvects(A);
 % ans == [0, 1, {Vector[row](2, {(1) = -1, (2) = 1})}], [3, 1, {Vector[row](2, {(1) = 1, (2) = 2})}]
 \Answer{ Eigenpairs are $\left(0,\colvector{-1\\ 1}\right)$, $\left(3,\colvector{1\\
2}\right)$. Then $A\left(c_1\colvector{-1\\ 1}+c_2\colvector{1\\
2}\right)=3c_2\colvector{1\\ 2}$. }

\EJECTEND
\end{document}
\endinput


