\documentclass[12pt]{article}
 
\setlength{\parindent}{0pt}
\everymath={\displaystyle}
%\pagestyle{empty}
\newcommand{\answerspace}{\vfill}
\setlength{\textwidth}{6in}
\setlength{\oddsidemargin}{.30in}
\topmargin=-0.5in
\textheight=9in
\usepackage{maple2e}
 \def\emptyline{\vspace{12pt}}
\DefineParaStyle{Maple Output}
\DefineParaStyle{Maple Plot}
\DefineParaStyle{Warning}
\DefineCharStyle{2D Math}
\DefineCharStyle{2D Output}
 
\begin{document}
 
\textbf{Math 325: Differential Equations}
\hfill\makebox[2.5in][r]{Name:\hrulefill}
 
\textbf{Midterm}\quad \textsl{March 8, 2000}
 
\bigskip


You may  use your own calculator.
You may not use anything else.  You may not pass a calculator 
to another person.

\bigskip

Show all your work.  Erase or cross out any work you do not want
graded.
There are four questions on 8 pages plus the
bonus question page.

\bigskip

1. (25 points)
a) Solve
\begin{displaymath}
  y'''-3y''-4y'=0, \qquad  y(0)=2,\
 y'(0)=5,\   y''(0)=15.
\end{displaymath}

\answerspace

\ 
\answerspace

b) 
 Write a sequence of Maple commands designed to solve the initial
value problem in a) and to determine the floating point value of
$y(17)$.


\answerspace

\newpage

2. (20 points)
Solve
\begin{displaymath}
  {\mathbf x} '=
\left [\begin{array}{rr}
-11&1\\0&-11\end{array}\right]{\mathbf
x}, \qquad {\mathbf x}(0)=\left[\begin{array}{r} \sqrt {371}\\ 5^{19}
\end{array}
\right].
\end{displaymath}

\newpage

3.  (25 points)
Consider this snapshot of Doug's Maple session.  Then answer the
questions on the next page.

%% Created by Maple V Release 5.1 (SUN SPARC SOLARIS)
%% Source Worksheet: midterm3.mws
%% Generated: Fri Mar  3 11:32:58 2000



\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{with(linalg):}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
Warning, new definition for norm
\end{maplettyout}

\begin{maplettyout}
Warning, new definition for trace
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{ivp := \{diff(x(t),t)=-2*x(t)+y(t),
   diff(y(t),t)=  x(t)-2*y(t),x(0)=a,y(0)=b\}:}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{solivp := dsolve(ivp,\{x(t),y(t)\});
}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{solivp := \{x(t) =
1/2*a*exp(-3*t)+1/2*a*exp(-t)+1/2*b*exp(-t)-1/2*b*exp(-3*t), y(t) =
1/2*a*exp(-t)-1/2*a*exp(-3*t)+1/2*b*exp(-3*t)+1/2*b*exp(-t)\};}{%
\maplemultiline{
\mathit{solivp} := \{\mathrm{x}(t)={\displaystyle \frac {1}{2}} 
\,a\,e^{( - 3\,t)} + {\displaystyle \frac {1}{2}} \,a\,e^{( - t)}
 + {\displaystyle \frac {1}{2}} \,b\,e^{( - t)} - {\displaystyle 
\frac {1}{2}} \,b\,e^{( - 3\,t)},  \\
\mathrm{y}(t)={\displaystyle \frac {1}{2}} \,a\,e^{( - t)} - 
{\displaystyle \frac {1}{2}} \,a\,e^{( - 3\,t)} + {\displaystyle 
\frac {1}{2}} \,b\,e^{( - 3\,t)} + {\displaystyle \frac {1}{2}} 
\,b\,e^{( - t)}\} }
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{parasol := unapply(subs(solivp,[x(t),y(t),t=trange]),a,b,trange):}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{ plot(\{seq(seq(parasol(a,b,-1..1),a=-2..2),b=-2..2)\},color=black);}{%
}
\end{mapleinput}
\bigskip
\ 
\bigskip
\mapleresult
\begin{center}
\mapleplot{midterm301.eps}
\end{center}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}

%% End of Maple V Output

\newpage

a)  What system of ODE is he studying?




\answerspace

b) What are the eigenvalues and corresponding eigenvectors of the
matrix
\begin{eqnarray*}
A=
 \left[
{\begin{array}{rr}
-2 & 1 \\
\ &\ \\
1& -2
\end{array}}
\right]?
\end{eqnarray*}

\answerspace

c) On the plot on the previous page,
identify eigenvectors (if relevant) and the direction
of increasing time on the trajectories.

\bigskip

d)  What is the type and stability of the origin as a critical point
of the system under study?

\answerspace



\newpage

4. Ellen decided to use Maple to study the initial value problem
\begin{eqnarray*}
y'=y^2-x, \qquad y(0)=2.
\end{eqnarray*}
Here is a snapshot of her Maple session.


\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{with(plots):}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{eqn := diff(y(x),x)=y(x)^2-x;}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{eqn := diff(y(x),x) = y(x)^2-x;}{%
\[
\mathit{eqn} := {\frac {\partial }{\partial x}}\,\mathrm{y}(x)=
\mathrm{y}(x)^{2} - x
\]
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{phi[0] := dsolve(\{diff(y(x),x)=y(x)^2,y(0)=2\},y(x));
}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{phi[0] := y(x) = -1/(x-1/2);}{%
\[
{\phi _{0}} := \mathrm{y}(x)= - {\displaystyle \frac {1}{x - 
{\displaystyle \frac {1}{2}} }} 
\]
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{phi[1] := simplify(dsolve(\{diff(y(x),x)=y(x)^2-1,y(0)=2\},y(x)));}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{phi[1] := y(x) = -(3+exp(2*x))/(exp(2*x)-3);}{%
\[
{\phi _{1}} := \mathrm{y}(x)= - {\displaystyle \frac {3 + e^{(2\,
x)}}{e^{(2\,x)} - 3}} 
\]
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{evalf(ln(3)/2);
}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{.5493061445;}{%
\[
.5493061445
\]
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{soln := dsolve(\{eqn,y(0)=2\},y(x),numeric);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{soln := proc (rkf45_x) local i, rkf45_s, outpoint, r1, r2; global
loc_control, loc_y0, loc_y1; option `Copyright (c) 1993 by the
University of Waterloo. All rights reserved.`; outpoint :=
evalf(rkf45_x); if abs(-outpoint) < abs(loc_control[2]-outpoint) or
not member(loc_control[6],\{-1, 1, -2, 2, 2., -1., -2., 1.\}) then
loc_control := copy(array(1 ..
26,[(10)=0,(5)=.1e-7,(19)=0,(24)=0,(17)=0,(14)=0,(11)=0,(9)=1000,(21)=
0,(4)=.1e-7,(26)=0,(23)=0,(15)=0,(12)=0,(18)=0,(2)=0,(25)=0,(8)=30000,
(22)=0,(13)=0,(16)=0,(1)=1,(20)=2.,(3)=0,(6)=1,(7)=.1e-8])); loc_y0 :=
copy(array(1 .. 1,[(1)=2.])); loc_y1 := copy(array(1 .. 1,[])) fi; if
abs(-outpoint) <> 0 then loc_control[3] := outpoint; if Digits <=
evalhf(Digits) then rkf45_s :=
traperror(evalhf(`dsolve/numeric_solnall_rkf45`(loc_F,var(loc_control)
,var(loc_y0),var(loc_y1),var(loc_F1),var(loc_F2),var(loc_F3),var(loc_F
4),var(loc_F5),var(loc_work)))); if rkf45_s = lasterror then r1 :=
searchtext('evalhf',convert(op(1,[rkf45_s]),name)); r2 :=
searchtext('hardware',convert(op(1,[rkf45_s]),name)); if r1 <> 0 or r2
<> 0 then
`dsolve/numeric_solnall_rkf45`(loc_F,loc_control,loc_y0,loc_y1,loc_F1,
loc_F2,loc_F3,loc_F4,loc_F5,loc_work) else ERROR(rkf45_s) fi fi else
`dsolve/numeric_solnall_rkf45`(loc_F,loc_control,loc_y0,loc_y1,loc_F1,
loc_F2,loc_F3,loc_F4,loc_F5,loc_work) fi fi; [x = rkf45_x,
seq(ord[i+1] = loc_y0[i],i = 1 .. 1)] end;}{%
\[
\mathit{soln} := \textbf{proc} (\mathit{rkf45\_x})\,\ldots \,
\textbf{end} 
\]
%
}
\end{maplelatex}

\emptyline

\end{maplegroup}

\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{sol := u -> subs(soln(u),y(x)):}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plotsol := plot(sol,0..0.5,color=black,numpoints=1000):}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plotphi[0] :=
plot(rhs(phi[0]),x=0..0.495,linestyle=4,color=black,numpoints=1000):}{
%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{plotphi[1] :=
plot(rhs(phi[1]),x=0..0.545,linestyle=7,color=black,numpoints=1000):}{
%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{display(\{plotsol,plotphi[0],plotphi[1]\},title=`Plot
  1`);}{%
}
\end{mapleinput}

\mapleresult
\begin{center}
\mapleplot{midterm401.eps}
\end{center}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{curve := a ->
odeplot(dsolve(\{eqn,y(0)=a
\},y(x),numeric),[x,y(x)],0..0.45,numpoints=1000,color=black);
}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{curve := proc (a) options operator, arrow; odeplot(dsolve(\{eqn, y(0)
= a\},y(x),numeric),[x, y(x)],0 .. .45,numpoints = 1000,color = black)
end;}{%
\maplemultiline{
\mathit{curve} := a\rightarrow \mathrm{odeplot}(\mathrm{dsolve}(
\{\mathit{eqn}, \,\mathrm{y}(0)=a\}, \,\mathrm{y}(x), \,\mathit{
numeric}), \,[x, \,\mathrm{y}(x)], \,0 .. .45,  \\
\mathit{numpoints}=1000, \,\mathit{color}=\mathit{black}) }
%
}
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{display(\{seq(curve(2+0.2*j),j=-1..1)\},title=`Plot
  2`); }{%
}
\end{mapleinput}
\begin{center}
\mapleplot{midterm402.eps}
\end{center}

\end{maplegroup}

%% End of Maple V Output


a) Why does she introduce the functions  $\phi _0\/$
and  $\phi _1\/$?

\answerspace

\  

\answerspace

b) Label the three graphs in Plot 1.

\answerspace

\newpage
c) How does the solution of
of the initial value problem being studied behave as $x$ increases?
Justify your answer.

\answerspace



d)  Suppose the initial value is changed from $2$ to a value near
$2$.  How will the solution change?  Justify your answer.


\answerspace

e)
Label the three graphs in Plot 2.  How does this plot relate to d)?

\bigskip

\

\bigskip

\  

\bigskip

\  


\newpage


\hfill\makebox[2.5in][r]{Name:\hrulefill}

\bigskip
\noindent
{\bf Bonus Problem}(10 points)  In Problem 1b), you wrote a sequence of Maple
commands to  solve the initial value problem
\begin{displaymath}
  y'''-3y''-4y'=0, \qquad  y(0)=2,\
 y'(0)=5,\   y''(0)=15.
\end{displaymath}
and determine the floating point value of $y(17)$.
Write your sequence of Maple commands here,
take this sheet with you, and try the commands to see if they work.
If they do not, figure out what is wrong and correct it.  By the
start of class on Friday, March 10, turn in
this sheet (with an explanation of what is wrong) together with
a  Maple worksheet showing a correct solution.




\end{document}

