\documentclass[12pt]{article}

\usepackage{amsmath,amssymb,amsthm}

\usepackage{color}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
%\tikzstyle{ball} = [circle,shading=ball, ball color=black,
%    minimum size=1mm,inner sep=1.3pt]
%\usetikzlibrary{arrows.meta}
%\tikzset{>={Latex[length=2mm,width=1.5mm]}}

%\usepackage{graphicx}

\usepackage[shortlabels]{enumitem}
\setlist[enumerate]{leftmargin=*,label=(\alph*)}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 322 lecture for Monday, Week 4}
\bigskip

\centerline{\sc linear systems in~$\R^2$}
\medskip

Let~$A\in M_2(\R)$.  The characteristic polynomial has real coefficients and
degree~$2$.  That means that if~$\lambda$ is a complex eigenvalue for~$A$ (with
nonzero imaginary part), then so is its conjugate~$\bar{\lambda}$.
Otherwise,~$A$ either has two distinct real eigenvalues or one real eigenvalue
with multiplicity~$2$.  In order to exponentiate~$A$, it would be nice to
conjugate~$A$ (i.e., apply the mapping~$A\to P^{-1}AP$ for some~$P$) to a matrix
that is close to being diagonal.  We will discuss the Jordan form more carefully
later, but for now it suffices to know that there exists an invertible real
matrix~$P$ such that~$P^{-1}AP$ has one of the three possible forms below:
\[
  \left(\begin{array}{cc}
      u&0\\
      0&v
  \end{array} \right),
  \qquad
  \left(\begin{array}{cc}
      u&1\\
      0&u
  \end{array} \right),
  \quad\text{and}\quad
  \left(\begin{array}{cc}
      a&-b\\
      b&a
  \end{array} \right),
\]
where~$u,v,a,b\in\R$. The first case occurs when~$A$ has eigenvalues~$u$
and~$v$ (including the case where~$u=v$ occurs with multiplicity~$2$)
and~$A$ is diagonalizable.  The second case occurs when~$A$ has the real
eigenvalue~$u$ with multiplicity~$2$ but the corresponding eigenspace only has
dimension~$1$.  The last case occurs when~$A$ has a pair of complex
eigenvalues~$\lambda=a+bi$ and~$\lambda=a-bi$.  (If we were working
over~$\C$, then in this last case~$A$ could be conjugated to the diagonal
matrix~$\diag(\lambda,\bar{\lambda})$, as we will discuss below.)

To solve two-dimensional linear systems, we need to exponentiate matrices with
these forms.
The first is easy:
\[
\exp
  \left(\begin{array}{cc}
      u&0\\
      0&v
  \end{array} \right)
  =
  \left(\begin{array}{cc}
     e^u&0\\
      0&e^v
  \end{array} \right).
\]
For the second, let's exponentiate a slightly more general matrix:
\[
B:=
  \left(\begin{array}{cc}
      u&v\\
      0&u
  \end{array} \right).
\]
Let
\[
C = 
  \left(\begin{array}{cc}
      0&v\\
      0&0
  \end{array} \right),
\]
and note that (i)~$B=uI+C$, (ii)~$C^{k}=0$ for~$k>1$, and (iii)~$uI$
and~$C$ commute. It follows that
\begin{align*}
  e^B&= e^{uI+C}=e^{uI}e^{C}=
  \left(\begin{array}{cc}
      e^{u} & 0 \\
      0 & e^{u}
  \end{array}\right)e^{C}
  =e^{u}Ie^{C}
  =e^{u}e^{C}
  \\[5pt]
  &= e^u\left( I+C+\frac{1}{2}C^2+\frac{1}{3!}C^3+\dots \right)\\[5pt]
  &= e^u\left( I+C\right)\\[5pt]
  &= 
  \left(\begin{array}{cc}
      e^u&ve^u\\
      0&e^{u}
  \end{array} \right).
\end{align*}
Now consider the last case, in which
\[
J = 
\left(\begin{array}{cc}
    a&-b\\b&a
\end{array} \right).
\]
Letting
\[
Q = 
\left(\begin{array}{cc}
    i&-i\\1&1
\end{array} \right)
\]
we have
\begin{align*}
  Q^{-1}JQ
  &= 
  \frac{1}{2i}
\left(\begin{array}{cc}
    1&i\\-1&i
\end{array} \right)
\left(\begin{array}{cc}
    a&-b\\b&a
\end{array} \right)
\left(\begin{array}{cc}
    i&-i\\1&1
\end{array} \right)\\[10pt]
  &= 
  \frac{1}{2i}
\left(\begin{array}{cc}
    1&i\\-1&i
\end{array} \right)
\left(\begin{array}{cc}
    ai-b&-ai-b\\a+bi&a-bi
\end{array} \right)\\[10pt]
  &= 
  \frac{1}{2i}
\left(\begin{array}{cc}
    2ai-2b&0\\0&2ai+2b
\end{array} \right)\\[10pt]
  &= 
\left(\begin{array}{cc}
    a+bi&0\\0&a-bi
\end{array} \right)
  = 
\left(\begin{array}{cc}
    \lambda&0\\0&\bar{\lambda}
\end{array} \right).
\end{align*}
Therefore, using the fact that
\[
  e^{\lambda t}=e^{at+bti}=e^{at}(\cos(bt)+i\sin(bt))\quad\text{and}\quad
  e^{\bar{\lambda t}}=e^{at-bti}=e^{at}(\cos(bt)-i\sin(bt)),
\]
we have
\allowdisplaybreaks
\begin{align*}
  e^{\left(\begin{array}{cc}
      a&-b\\b&a
\end{array} \right)t}
&= Qe^{\diag(\lambda,\bar{\lambda})t}Q^{-1}\\[10pt]
&= 
\frac{1}{2i}
\left(\begin{array}{cc}
    i&-i\\1&1
\end{array} \right)
\left(\begin{array}{cc}
    e^{\lambda t}&0\\
    0&e^{\bar{\lambda}t}
\end{array} \right)
\left(\begin{array}{cc}
    1&i\\-1&i
\end{array} \right)\\[10pt]
&= 
\frac{1}{2i}
\left(\begin{array}{cc}
    i&-i\\1&1
\end{array} \right)
\left(\begin{array}{cc}
    e^{\lambda t}&ie^{\lambda t}\\
   -e^{\bar{\lambda}t}&ie^{\bar{\lambda}t}
\end{array} \right) \\[10pt]
&= 
\frac{1}{2i}
\left(\begin{array}{cc}
   ie^{\lambda t}+ie^{\bar{\lambda}t}&-e^{\lambda t}+e^{\bar{\lambda}t}\\
   e^{\lambda t}-e^{\bar{\lambda}t}&ie^{\lambda t}+ie^{\bar{\lambda}t}
\end{array} \right) \\[10pt]
&= 
e^{at}
\left(\begin{array}{cc}
    \cos(bt)&-\sin(bt)\\
    \sin(bt)&\cos(bt)
\end{array} \right).
\end{align*}
Let's look at the corresponding systems of differential equations and their
solutions with initial condition~$x_0$:

If $J=\left(\begin{array}{cc}
    u&0\\
    0&v
\end{array} \right)$ then the solution is 
\[
  x(t)=\left(\begin{array}{cc}
      e^{ut}&0\\
      0&e^{vt}
  \end{array} \right)
  x_0.
\]
If both~$u$ and~$v$ are negative, the origin is a {\em stable node} ($u=-1,v=-2$
displayed): 
\begin{center}
  \includegraphics[height=2in]{04monstablenode.png}\ .
\end{center}
If~$u$ and~$v$ are both positive, the origin is an {\em unstable node}
($u=1,v=2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monunstablenode.png}\ .
\end{center}
If one of~$u$ and~$v$ is negative and the other is positive, the origin is a
{\em saddle point} ($u=-1,v=2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monsaddle.png}\ .
\end{center}
\medskip

If $J=\left(\begin{array}{cc}
    u&1\\
    0&u
\end{array} \right)$ then 
\[
  e^{Jt}=\exp
\left(\begin{array}{cc}
u & t \\
0 & u
\end{array}\right)
=
\left(\begin{array}{cc}
e^{u} & te^{u} \\
0 & e^{u}
\end{array}\right)
\]
and the solution is 
\[
  x(t)=\left(\begin{array}{cc}
      e^{ut}&te^{ut}\\
      0&e^{ut}
  \end{array} \right)
  x_0.
\]
If~$u<0$, the origin is a {\em stable node}
($u=-2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monstablenode2.png}\ .
\end{center}
and if it is positive, then the origin is an {\em unstable node}
($u=2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monunstablenode2.png}\ .
\end{center}
\medskip

If $J=\left(\begin{array}{cc}
    a&-b\\
    b&a
\end{array} \right)$ then the solution is 
\[
  x(t)=e^{at}\left(\begin{array}{cc}
      \cos(b)&-\sin(b)\\
      \sin(b)&\cos(b)
  \end{array} \right)
  x_0.
\]
If~$a<0$, then each solution spirals into the origin and we say the origin is a
\emph{stable focus}
($a=-1,b=2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monspiralin.png}\ .
\end{center}
If~$a>0$, then each
solution spirals away from the origin, and we say the origin is an {\em unstable
focus}
($a=1,b=2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04monspiralout.png}\ .
\end{center}
If~$a=0$, each solution goes in a circle about the origin, and we say
that the system has a {\em center} at the origin
($a=0,b=-2$ displayed):
\begin{center}
  \includegraphics[height=2in]{04moncenter.png}\ .
\end{center}

In any of these cases,
if~$b>0$ the motion is counterclockwise, and if~$b<0$, the motion is clockwise.
\medskip

We've discussed all cases in which both eigenvalues are nonzero.  If either of
the eigenvalues is zero, i.e., if~$\det(A)=0$, then the origin is a {\em
degenerate equilibrium point}.  See our text for pictures of these systems.
\medskip

\textbf{Lemma.} Let~$A\in M_n(F)$ with eigenvalues~$\lambda_1,\dots,\lambda_n$.
Then
\begin{enumerate}
  \item\label{04monitem1} $\mathrm{trace}(A):=\sum_{i=1}^n{A_{ii}}=\sum_{i=1}^n\lambda_i$
    and~$\det(A)=\prod_{i=1}^n\lambda_i$.
  \item\label{04monitem2}  Consider the characteristic polynomial of~$A$:
\[
  p(x) = \det(A-xI_n).
\]
Then the coefficient of~$x^{n-1}$ in~$p(x)$ is~$(-1)^{n-1}\mathrm{trace}(A)$
and the constant term of~$p(x)$ is~$\det(A)$.\footnote{The characteristic
polynomials is sometimes defined to be $p(x)=\det(xI_n-A)$.  In that case, the
coefficient of~$x^{n-1}$ is $-\mathrm{trace}(A)$.  The constant term is
again~$\det(A)$.}
\end{enumerate}
\begin{proof}
 Recall that for all~$C,D\in M_n(F)$, we
 have
 \[
   \mathrm{trace}(CD)= \mathrm{trace}(DC)
 \]
 and
 \[
   \det(CD)= \det(C)\det(D)=\det(D)\det(C)=\det(DC).
 \]
 Therefore, for all invertible~$P\in M_n(F)$, 
 \[
   \mathrm{trace}(P^{-1}AP)=\mathrm{trace}(A)
   \quad\text{and}\quad
   \det(P^{-1}AP)=\det(A).
 \]
 Further, the characteristic polynomial is not affected by conjugation:
 \[
   \det(P^{-1}AP-xI_n)=\det(P^{-1}(A-xI_n)P)=\det(P^{-1})\det(A-xI_n)\det(P)=\det(A-xI).
 \]
 Therefore, we may assume that~$A$ is in Jordan form---an upper triangular
 matrix.  Considering~$p(x)=\det(A-xI)$, we see the diagonal entries are the
 eigenvalues,~$\lambda_1\dots,\lambda_n$.  Part~\ref{04monitem1} follows.
 Next, consider the characteristic polynomial
 \[
  \det(A-xI_x) =  p(x)=(\lambda_1-x)\cdots(\lambda_n-x).
 \]
 Expanding the right-hand side, we see that the coefficient of~$x^{n-1}$ is
 $\mathrm{trace}(A)$. Setting~$x=0$ in the above equation then completes the
 proof of part~\ref{04monitem2}.
\end{proof}

Let's now go back to the case~$n=2$.  Let~$\tau:=\mathrm{trace}(A)$
and~$\delta:=\det(A)$.  Up to conjugation, there are three
possibilities:
\begin{center}
  \begin{tikzpicture}
    \node at (0,0) {$\displaystyle\left(\begin{array}{cc}
	u&0\\0&v
  \end{array} \right)$};
  \node at (0,-1) {$\tau=u+v$};
  \node at (0,-1.6) {$\delta=uv$};
  \begin{scope}[xshift=1in]
    \node at (0,0) {$\displaystyle\left(\begin{array}{cc}
	u&1\\0&u
  \end{array} \right)$};
  \node at (0,-1) {$\tau=2u$};
  \node at (0,-1.6) {$\delta=u^2$};
  \end{scope}
  \begin{scope}[xshift=2in]
    \node at (0,0) {$\displaystyle\left(\begin{array}{cc}
	a&-b\\b&a
  \end{array} \right)$};
  \node at (0,-1) {$\tau=2a$};
  \node at (0,-1.6) {$\delta=a^2+b^2$};
  \end{scope}
  \end{tikzpicture}
\end{center}
The characteristic polynomial is
\[
  p(x)=x^2-\tau\,x+\delta.
\]
So the eigenvalues are
\begin{equation}\label{04moneqn}
  \frac{\tau\pm\sqrt{\tau^2-4\delta}}{2}.
\end{equation}

\textbf{Theorem.} (p.~25) 
\begin{enumerate}
  \item If~$\delta<0$, then the origin is a saddle point.
  \item If~$\delta>0$ and~$\tau^2-4\delta\geq0$, then the origin is a stable
    node if~$\tau<0$ and an unstable node if~$\tau>0$. (Note that in this
      case, the conditions~$\delta>0$ and~$\tau^2-4\delta\geq0$
      imply~$\tau\neq0$.)
  \item If~$\delta>0$ and~$\tau^2-4\delta<0$, then the origin is a stable focus
    if~$\tau<0$, an unstable focus if~$\tau>0$, or a center if~$\tau=0$ (in
    which case~$\tau-4\delta<0$ is automatic).
\end{enumerate} 
\begin{proof}
  If~$\delta<0$, then equation~\ref{04moneqn} shows that one eigenvalue is
  positive and the other is negative.  Hence, the origin is a saddle point.
  That proves the first part.  The others follow similarly.
\end{proof}
Calling a stable node or focus a {\em sink} and calling an unstable node or focus a
{\em source}, we get the following diagram:

\begin{center}
  \begin{tikzpicture}
    \draw (-5,0)--(5,0);
    \draw (0,0)--(0,5);
    \node at (5.3,0) {$\tau$};
    \node at (0,5.4) {$\delta$};
    \node at (1.25,3.0) {unstable};
    \node at (1.25,2.5) {focus};
    \node at (-1.25,3.0) {stable};
    \node at (-1.25,2.5) {focus};
    \node at (-3.75,1.8) {stable};
    \node at (-3.75,1.3) {node};
    \node at (3.75,1.8) {unstable};
    \node at (3.75,1.3) {node};
    \node at (0,-1) {saddle};
    \node at (0,0) {degenerate};
    \node at (-3,0) {degenerate};
    \node at (3,0) {degenerate};
    \node[rotate=90] at (-0.04,1.2) {center};
    \begin{scope}[xshift=-3.43cm, yshift=-4.6mm]
  \begin{axis}[ 
      %title style={at={(0.5,0)},anchor=north,yshift=-30},
      %title={Graph of~$f(x)=x^2$ and its tangent line at~$x=3$.},
      axis lines*=middle,
      axis equal image,
      ticks=none,
      xmin=-5,
      xmax=5,
      %ymin=-0.2,
      ymax=6.5
    ]
    %\fill[blue] (axis cs: 1,1) circle (2pt);  
    %\fill[draw=black,fill=white] (axis cs:1,0) circle (2pt);  
    \addplot[domain=-5:5,thick, blue] {x*x/4};
  \end{axis}
  \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
