% Sample exam, 19 Feb 2015
\documentclass[11pt]{article}
\setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.8in} \setlength{\textheight}{9.5in}
\setlength{\parskip}{5pt} \setlength{\topmargin}{-90pt}
\setlength{\parindent}{0pt}
\usepackage{linalg}
\renewenvironment{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{{\large\bf #1}}
%% Some answer checks Feb 13, 2014
%f:=x->ln(1+x^4)*(2-abs(3*x-1))^3*(2+x)*(x^2-4)*(1-x^2)^5;
%plot(f(x),x=-3..3,-1..1);
%solve(f(x)=0,x);
%f(-1/3+0.2);f(-1/3-0.2);
%f(-1+0.2);f(0+0.2);f(1+0.1);f(2-0.1);f(2+0.1);f(-0.1);
%f(-1-0.2);
%f(-1+0.2);
%f(-3);f(-1.5);
%f(-0.9);
%de:=4*diff(v(t),t)=-160+(24/(2*t+3))*v(t); ic:=v(0)=30; dsolve({de,ic},v(t));
%dsolve(diff(y(x),x)-cos(x)*y(x)=0,y(x));
%dsolve(11*diff(y(x),x)+33*y(x)=5,y(x));


\begin{document}
\thispagestyle{empty} {\large\bf Name}
\underline{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}\hfill
\makebox[0.8in][t]{\begin{tabular}[t]{@{}|l|@{}}
\hline
\BF{Scores}~~~ \\
\hline
1. \\
2. \\
3. \\
4.\\
5. \\
6. \\
7. \\
8. \\
\hline
\end{tabular}}
%{{\bf Time of your class}~\underline{~~~~~~~~~~} }
%\def\EJECT{\SeparatedPages
%{\vfill Use this page to start your solution.
% Attach extra pages as needed.\eject
%\thispagestyle{empty} \hfill  2250 Sample Exam 1
%[19Feb2015]\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{-8pc}
\begin{center}\Large\bf
Differential Equations and Linear Algebra 2250 \\
\small Sample Midterm Exam 1 \\
\small Version 1, 19 Feb 2015
\end{center}

\vspace*{4pc}

{\bf Instructions}: This in-class exam is 90 minutes. No
calculators, notes, tables or books. No answer check is expected.
Details count 3/4, answers count 1/4.

\begin{exercises}
\prob{1.}{(Quadrature Equations)} ~\newline
     \BF{(a)} [25\%] Solve $y'=\dd\frac{x^2-2}{1+x}$. \newline % S2013
     \BF{(b)} [25\%] Solve $y'=\dd\frac{1}{(\cos x + 1)(\cos x - 1)}$.\newline % S2013
     \BF{(c)} [25\%] Solve $y'=\dd \frac{(1+e^{2x})^2}{e^{x}}$, $y(0)=1$.\newline % S2013
     \BF{(d)} [25\%] Find the position $x(t)$ from the velocity model
$\dd\frac{d}{dt}\left(e^{2t}v(t)\right)= 20 e^{-t}$,
$v(0)=0$ and the position model $\dd\frac{dx}{dt}=v(t)$,
$x(0)=100$. % S2015

\vspace{2pc}

{\bf Answers}:
 (a) $y(x) = (1/2)x^2-x-\ln(1+x)+C$,
 (b) $y=\cot(x)+C$,
 (c) $y(x) = -e^{-x}+2\, e^x+\frac13\, e^{3x}-\frac13$
  (d) $v(t) = -20\, e^{-3t} + 20\, e^{-2t}$,
 $x(t) = \frac{20}{3}\, e^{-3t}-10\, e^{-2t}+\frac{310}{3}$.
% The sample exam handwritten solution solved a different problem 1(d),
% $\dd\frac{d}{dt}\left(e^{2t}v(t)\right)= 20 e^{-t}$,
%$v(0)=0$ and the position model $\dd\frac{dx}{dt}=v(t)$,
%$x(0)=100$.


% (a) y(x) = (1/2)*x^2-x-ln(1+x)+C
% (b) y=cot(x)+C
% (c) y(x) = -exp(-x)+2*exp(x)+(1/3)*exp(3*x)-1/3
% (d) ans check
% de:=diff(exp(2*t)*v(t),t)=20*exp(t);
% dsolve({de,v(0)=0},v(t)); ans:=rhs(%);
% dsolve({diff(x(t),t)=ans,x(0)=100},x(t));
% v(t) = 20*exp(-t)-20*exp(-2*t)
% x(t) = -20*exp(-t)+10*exp(-2*t)+110


\iffalse {\small [Integral tables will be supplied
 for anything other than basic formulas. This sample problem
 would require no integral table. The exam problem will be
 shorter.]}\fi

\end{exercises}
\EJECT


\begin{exercises}
\prob{2.}{(Classification of Equations)} ~\newline
 The differential equation $y'=f(x,y)$ is defined to be {\bf separable} provided
functions $F$ and $G$ exist such that $f(x,y)=F(x)G(y)$.

 \BF{(a)} [40\%]  Check (\fbox{X}) the problems that can be converted into separable form.
 No details expected.
\begin{center}\large\begin{tabular}{|lp{0.4\linewidth}|lp{0.4\linewidth}|}
\hline
 \fbox{$\phantom{X}$} & $ y'+xy=y^2+xy^2$ & \fbox{$\phantom{X}$} &   $y'=(x-1)(y+1) + (y-xy)y$ \\[2ex]  \hline
  \fbox{$\phantom{X}$} &  $y'=\cos(xy)$ & \fbox{$\phantom{X}$} &  $\dd e^x y'=x\ln|y|+x^2\ln(y^2)$ \\[2ex] \hline
  \end{tabular}
\end{center}

 \BF{(b)} [10\%] State a partial derivative test that concludes $y'=f(x,y)$ is a linear differential equation but not a quadrature differential equation.

 \BF{(c)} [20\%] Apply classification tests to show that $y'=xy^2$ is not a linear differential equation. Supply all details.

  \BF{(d)} [30\%] Apply a test to show that $y'=e^x+y\ln|x|$ is not separable. Supply all details.

\end{exercises}
\EJECT

\begin{exercises}
\prob{3.}{(Solve a Separable Equation)} ~\newline
 % u:=(6*x^2+4)/(x+2); int(u,x);
 % convert((y-1)/((y+1)*(y+2)),parfrac,y);
 % # 3*ln(y+2)-2*ln(y+1)= -exp(1-x)+3 x^2-12*x+14*ln(x+2)+C
 Given
   $\dd (yx+2y)y' = \left( (2+x)\sin(x)\cos(x) +  x \right)(y^2+3y+2)$.


\BF{(a)} [80\%]  Find a non-constant solution in implicit form. ~\newline
 To save time, {\bf do not solve} for $y$ explicitly. No answer check expected.

\BF{(b)} [20\%] Find all constant solutions (also called equilibrium solutions; no answer check expected).
\end{exercises}
\EJECT

\begin{exercises}
\prob{4.}{(Linear Equations)} ~\newline
% v:='v':de:=4*diff(v(t),t)=-160+(24/(2*t+3))*v(t); ic:=v(0)=30; dsolve({de,ic},v(t));
 \BF{(a)} [50\%] Solve the linear model $\dd 4 x'(t)= - 160 + \frac{24}{2t+3}x(t)$, $x(0)=30$. Show
 all integrating factor steps.\newline
 \BF{(b)} [20\%]  Solve the homogeneous equation $\dd \frac{dy}{dx}-(\cos x)y=0$.
 % dsolve(diff(y(x),x)-cos(x)*y(x)=0,y(x));
\newline
 \BF{(c)} [30\%] Solve $\dd 11\frac{dy}{dx}+33y=5$ using the superposition principle $y=y_h+y_p$. Expected are answers for $y_h$ and $y_p$.
 % dsolve(11*diff(y(x),x)+33*y(x)=5,y(x));

\vspace{2pc}

{\bf Answers reported after the exam}:
(a)  $x(t) = 20t+30$, (b) $y(x) = c\, e^{\sin(x)}$, (c) $y(x) = \frac{5}{33} + c\, e^{-3x}$
\end{exercises}



\EJECT

\begin{exercises}
\prob{5.}{(Stability)} ~\newline
 \BF{(a)} [50\%] Draw a phase line diagram for the differential equation
 $$\frac{dx}{dt} = \ln(1+x^4)\left(2-|3x-1|\right)^3(2+x)(x^2-4)(1-x^2)^{5}.$$
 Expected in the phase line diagram are equilibrium
 points and signs of $dx/dt$.
 \newline
 \rule{\textwidth}{0.01in}
 
 \bigskip
 
{\bf Answers}: Roots $-2, -1, -1/3, 0, 1, 2$. Signs left to right are:\newline
MINUS, MINUS, PLUS, MINUS, MINUS, MINUS, PLUS.


 \vspace*{0.5in}

        \BF{(b)} [50\%] Assume an autonomous equation $x'(t)=f(x(t))$. Draw a phase diagram with at least 12 threaded curves, using the phase line diagram given below. Add these labels as appropriate: \BF{funnel}, \BF{spout}, \BF{node} [neither spout nor funnel], \BF{stable}, \BF{unstable}.

 \def\AA{\rule{5ex}{0.02in}}
 \def\BB{\rule[-0.1in]{0.4ex}{0.2in}}
 \def\PLUS{\mbox{\Large$+$}}
 \def\MINUS{\mbox{\Large$-$}}
 \begin{center}\begin{tabular}{*{11}{@{}c}}
 \MINUS & & \PLUS & & \MINUS & & \MINUS & & \PLUS & & \PLUS \\
\AA\AA\AA & \AA & \AA\AA\AA & \AA & \AA & \AA & \AA & \AA & \AA & \AA& \AA\AA\AA \mbox{\Large ~$x$} \\[-3ex]
          & \BB &           & \BB &     & \BB &     & \BB &     & \BB&  \\[1ex]
    & $-8$   &     & $-4$   &     & $-2$    &     & $0$    &     & $1$    &
 \end{tabular}\end{center}
 \rule{\textwidth}{0.01in}
\end{exercises}


\begin{exercises}
\prob{6.}{(The 3 Possibilities with Symbols)} ~
\newline
Let $a$, $b$ and $c$ denote constants and consider the system of
equations
$$
\left(\begin{array}{c@{\hspace{6ex}}r@{\hspace{6ex}}c}
0 & 0 & 0 \\
-2b-4 & 3 & a \\
 b+1 & -1 & 0\\
-1-b &  1 & a
\end{array}\right)
\left(\begin{array}{r} x \\[2ex] y \\[2ex] z
\end{array}\right)
= \left(\begin{array}{c} 0 \\ b^2 \\ b \\ b^2-b
\end{array}\right)
$$
%% [[-2*b-4, 3, a, b^2], [b+1, -1, 0, b], [-1-b, 1, a, b^2-b]]
\begin{itemize}
\item[{\bf (a)}] [40\%] Determine $a$ and $b$ such
that the system has a unique solution.
\newline
\item[{\bf (b)}] [30\%] Explain why $a=0$ and $b \ne 0$ implies no solution. Ignore any other possible no solution cases.
\newline
\item[{\bf (c)}] [30\%] Explain why $a=b=0$ implies infinitely many solutions. Ignore any other possible infinitely many solution cases.
\end{itemize}
%To save time, don't attempt to solve the equations or to produce a complete
%frame sequence.
\end{exercises}
% macro(combo=linalg[addrow]);macro(mult=linalg[mulrow]);
% macro(swap=linalg[swaprow]);
%A:=(a,b,c)->Matrix([[ c-b, -1, 0], [b-c, 1, a], [-2*c+4*b, 3, a]]);
% B:=x-><x, x^2-x, x^2>;
%C:=(a,b,c) -> <A(a,a,c)|B(b)>;
%linalg[det](A(a,a,c));

\EJECT

\begin{exercises}
\prob{7.}{(Determinants)} Do all parts. ~\newline
 (a) [10\%] True or False? The value of a determinant is the product of
 the diagonal elements.
\newline
 (b) [10\%] True or False? The determinant of the negative of the
 $n\times n$ identity matrix is $-1$.
\newline
 (c) [20\%] Assume given $3\times 3$ matrices $A$, $B$. Suppose
 $A^2B=E_2E_1A$ and $E_1$, $E_2$ are
 elementary matrices representing respectively a swap
and a multiply by $-5$. Assume $\det(B)=10$.
 Let $C=2A$. Find all possible values of $\det(C)$.
\newline
(d) [30\%] Determine all values of $x$ for which $(I+C)^{-1}$
fails to exist, where $C$ equals the transpose of the matrix $\left(
\begin{array}{cccc}
2 &   0  & -1 \\
3x &  0 & 1  \\
x-1 & x & x
\end{array}\right)
$.
% A:=<2,0,-1|3*x,0,1|x-1,x,x>^+ + <1,0,0|0,1,0|0,0,1>;
\newline
 (e) [30\%] Let symbols $a, b, c$ denote constants. Apply the adjugate
 [adjoint] formula for the inverse to find the value of the entry in row
 $3$, column $4$ of $A^{-1}$, given $A$ below.
$$ A=\left(\begin{array}{rrrr}
 1 & 1 &  0 & 0  \\
 1 & 0 &  0 & 0 \\
 a & b &  0 & 1 \\
 1 & c &  1 & 2
\end{array}\right)
$$
% C4:=Matrix([[1,1,0,0],[1,0,0,0],[a,b,0,1],[1,c,1,2]]);
% linalg[det](C4);(C4)^(-1);
% C5:=linalg[minor](C4,4,3);linalg[det](C5);
\end{exercises}
\EJECT

\begin{exercises}
\prob{8.}{(Vector Spaces)} Do all parts. Details not required for
(a)-(d).~\newline
  (a) [10\%] True or false: There is a subspace $S$ of $\Rr^3$ containing none of the vectors $\colvector{1\\ 1\\ 1},\colvector{1\\ -1\\ 0}, \colvector{3\\ 1\\ 2} $.
  %% linalg[det](Matrix([[1,1,1],[1,-1,0],[3,1,2]]));
  \newline
  (b) [10\%] True or false: The set of solutions $\vec{u}$ in $\Rr^3$ of a
     consistent matrix equation $A\vec{u}=\vec{b}$ can equal all vectors in the $xy$-plane, that is, all vectors of the form $\vec{u}=(x,y,0)$.
  \newline
  (c) [10\%] True or false: Relations $x^2+y^2=0$, $y+z=0$ define a subspace in $\Rr^3$.
  \newline
  (d) [10\%] True or false: Equations $x=y$, $z=2y$ define a subspace in $\Rr^3$.
  \newline
  (e) [20\%] Linear algebra theorems are able to conclude that the set
    $S$ of all polynomials $f(x)=c_0+c_1x+c_2x^2$ such that
    $f'(x)+\int_0^1 f(x)xdx=0$ is a vector space of functions. Explain
    why $V=\span(1,x,x^2)$ is a vector space, then fully state a linear
    algebra theorem required to show $S$ is a subspace of $V$. To save
    time, do not write any subspace proof details.
  \newline
  (f) [40\%] Find a basis of vectors for the subspace of $\Rr^5$
  given by the system of restriction equations
  $$ \begin{array}{rcrcrcrcrcrcrc}
                       3x_1 &&   &+& 2x_3 &+& 4x_4 &+& 10x_5&=& 0, \\
                       2x_1 &&  &+& x_3 &+& 2x_4 &+& 4x_5&=& 0, \\
                        -2x_1    &&  & &  & &     &+& 4x_5 &=& 0, \\
                       2x_1 &&   &+& 2x_3 &+& 4x_4 &+& 12x_5 &=& 0.
     \end{array}
  $$
% C:=Matrix([[3,0,2,4,10,0],[2,0,1,2,4,0],[-2,0,0,0,4,0],[2,0,2,4,12,0]]);
% linalg[rref](C);p:=linalg[backsub](%);seq(print(p[i]),i=1..5);
%                             2 _t[1]
%                            _t[3]
%                      -2 _t[2] - 8 _t[1]
%                            _t[2]
%                            _t[1]
%
\end{exercises}
\EJECTEND

\end{document}
\endinput






