\documentclass{article}


\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathtools}
\usepackage{bm}
\usepackage[shortlabels]{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage{booktabs}
\usepackage{color,xcolor}
\usepackage[paperheight=11in,paperwidth=8.5in,margin=1.25in]{geometry}
\usepackage{float}
\usepackage{rotating}
\usepackage{subfiles}
\usepackage{listings}
\usepackage{tagging}


\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{example}[theorem]{Example}
\theoremstyle{remark}
\newtheorem*{notation}{Notation}
\newtheorem*{remark}{Remark}
\newtheorem*{solution}{Solution}


\begin{document}

\title{Integration Workshop 2020 \\-- Ordinary Differential Equations --\\ Notes}
\author{Colin Clark}
\date{August 8, 2020}
\maketitle

\section{Existence \& Uniqueness of Solutions via Picard Iteration}
\begin{theorem}
Let \(y' = f(t,y(t))\), and suppose that \(f(t,y)\) and \(\frac{\partial}{\partial y} f(t,y) \) are continuous on the rectangle defined by  \(-\tilde{a} < t_0 < \tilde{a} \), \( -b < y_0 < b\). Then there exists \(a < \tilde{a}\) such that the initial value problem
\begin{equation*}
  \frac{dy}{dt} = f(t,y(t)), \quad \text{with} \quad y(t_0) = y_0
\end{equation*}
has a unique solution \(y^*(t)\) on \(-a< t_0 < a\) and \(-b < y^*(t) < b\) for all  \(-a< t_0 < a\).
\end{theorem}
The following example illustrates how Theorem 1 guarantees the existence of a unique solution. There are many details that are beyond the scope of the exercise that have been left out. The interested reader are directed towards any good textbook on ODE's.
\begin{example}
  Let \(y' = 2 t (1-y(t)) \) with \(y(0) = 0\). From the fundamental theorem of calculus, we have
  \begin{equation}
    y(t)
    = y_0 + \int_{t_0}^t y'(\tau) \, d\tau
    \quad \Rightarrow \quad y(t)
     = 0 + \int_0^t 2 \tau (1-y(\tau)) \, d\tau \label{eq:integral_equation}
  \end{equation}
  Morally, \(2t(1 - y_0)\) \textit{should} be a good enough approximation to \(y'(t)\) for us to guarantee a solution whenever \(t\) is not \textit{too} far from \(t_0\). This intuition will form the premise for the work that follows.

  We cannot directly solve \eqref{eq:integral_equation} because \(y(t)\) appears on both sides of the equation. However, we can use it iterate through a sequence of approximation \(y^{(k)}(t)\) that converge to the solution. More formally, if we define the map
  \begin{equation*}
    T[y](t) = \int_0^t 2\tau(1-y(\tau)) d\tau
  \end{equation*}
  we can begin with an initial guess, say \(y^{(0)}(t) := 0 \), and then define \(y^{(1)}(t) := T[y^{(0)}](t)  \). Once we have \(y^{(1)}(t)\), we repeat this process to define \(y^{(2)}(t) := T[y^{(1)}](t)  \). We keep iterating the map so \(y^{(n)}(t) := T^n[y^{(0)}](t) \).
  A rigorous approach to the problem would require the following:
  \begin{enumerate}
    \item Define the space where the map operates,
    \item Verify that the space is complete,
    \item Verify there is a unique fixed point of the map,
    \item Verify that the iterates will converge to this fixed point,
    \item Verify that the fixed point for the map coincides with the solution to the ODE.
  \end{enumerate}
  I expect that some of the terminology on the list is unfamiliar to many of you. Don't worry, all of these concepts will be introduced during the core courses. In this exercise, I will only focus on (1) and (4).
  Recall that our intuition suggests we may only be able to guarantee \textit{local} solutions? Let's try \(\tilde{a} = b = 1\), and define \(\tilde{D}\) to be the rectangle \(-\tilde{a} < y < \tilde{a}\), \(-b < t < b\). We define two quantities for future reference:
  \begin{equation*}
    M = \max_{\tilde{D}} \left|f(t,y(t))\right| \quad \text{and} \quad L = \max_{\tilde{D}} \left|\frac{\partial }{\partial y} f(t,y(t)) \right|,
  \end{equation*}
  For us, \(M = 2\) and \(D = 4\).
  % Verify that \(|f(t,y_2) - f(t,y_1)| < L |y_2 - y_1|\) holds for any two functions \(y_1,y_2\) and any \(t\) in \(\tilde{D}\).
  It turns out that our domain is too large, so we let \(a = \min\{\tfrac{b}{M}, \tfrac{1}{L}\}\) and define \(D\) by \(-a < t < a\),\(-b < y<b\).

  We will be working with functions \(y(t)\) on \(D\), and we define the metric \(\max_{-a < t < a}|y_2(t) - y_1(t)|\) to determine whether two functions are close together or far apart.
  We first show that if \(y(t)\in D\), then \(T[y](t)\in D\)
  \begin{align*}
    |T[y](t) -y_0| = \left| \int_0^t f(\tau,y(\tau)) d\tau\right| \leq M |t-t_0| \leq Ma < b
  \end{align*}
  Next, we show that if \(y_1, y_2 \in D\), then the distance between \(T[y_1]\) and \(T[y_2]\) is less than the half the distance between \(y_1\) and \(y_2\).
  \begin{align*}
    |T[y_1](t) - T[y_2](t) |
    & \leq \left|\int_0^t \Big( 2\tau(1-y_1(\tau))\Big) - \Big(2\tau(1-y_2(\tau)) \Big) d\tau \right|\\
    & \leq \int_0^t \left|\Big( 2\tau(1-y_1(\tau))\Big) - \Big(2\tau(1-y_2(\tau)) \Big) \right| d\tau \\
    & \leq L\, \int_0^t \left|y_1(\tau) - y_2(\tau) \right| d\tau \\
    % & \leq L\,  \max_{-t \leq \tau \leq t}\left|y_1(\tau) - y_2(\tau) \right|\,  \int_0^t 1\,  d\tau \\
    & \leq L\,  \max_{-t \leq \tau \leq t}\left|y_1(\tau) - y_2(\tau) \right|\,  a\\
    & \leq \frac{1}{2}  \max_{-t \leq \tau \leq t}\left|y_1(\tau) - y_2(\tau) \right|
  \end{align*}
  Finally, we observe that
  \begin{equation*}
    y*(t) \text{solves} y'(t) = 2t(1-y(t)) \quad \Leftrightarrow \quad T[y^*](t) = y^*(t)
  \end{equation*}
  The argument above constructive. This means that we should be able to iterate the map to find the solution to the ODE.
  \begin{align*}
    y^{(0)}(t)
    &= 0\\
    y^{(1)}(t)
    &= \int_0^t 2\tau(1-0) d\tau = t^2\\
    y^{(2)}(t)
    &= \int_0^t 2\tau(1-\tau^2) d\tau = t^2 - \frac{t^4}{2}\\
    y^{(3)}(t)
    &= \int_0^t 2\tau(1-\tau^2 + \frac{\tau^4}{2}) d\tau = t^2 - \frac{t^4}{2}+ \frac{t^6}{6}
  \end{align*}
  We can show by induction that the \(n\)\textsuperscript{th} iterate is
  \begin{equation*}
    y^{(n)}(t) = 1 - \left(1 - t^2 + \frac{t^4}{2!} - \frac{t^6}{3!} + \cdots + \frac{(-t^2)^n}{n!} \right)
  \end{equation*}
  Taking the limit \(n \to \infty\), we find that the solution is \(y(t) = 1 - e^{-t^2}\).
\end{example}
\newpage

\section{Systems of Linear Equations}
\subsection*{Matrix Exponential}
\begin{definition}
The \textit{matrix exponential} of a matrix \(A\) is defined via the Taylor Series
\begin{equation*}
  e^A := \sum_{k = 0}^\infty \frac{1}{k!} A^k = I + A + \frac{1}{2} A^2 + \frac{1}{6} A^3 + \dots
\end{equation*}
\end{definition}
\begin{corollary}
  Let $\Lambda$ be a diagonal matrix with entries \(\Lambda_{ij} = \{\lambda_i \,\delta_{ij} \}\), then \(e^\Lambda = \{e^{\lambda_i}\, \delta_{ij}\}\).
\end{corollary}
\begin{proof}
  Left to the reader.
\end{proof}
\begin{remark}
The terms of the Taylor Series of \(e^A\) can be simplified by diagonalizing \(A\).
\begin{equation*}
  e^A
  = \sum_{k = 0}^\infty \frac{1}{k!} A^k = \sum_{k = 0}^\infty \frac{1}{k!} \left(UDU^{-1}\right)^k = \sum_{k = 0}^\infty\left( \frac{1}{k!} UD^kU^{-1}\right) = U\left(\sum_{k = 0}^\infty \frac{1}{k!} D^k\right)U^{-1} = U e^D U^{-1}
\end{equation*}
\end{remark}
Recall from the linear algebra lectures that not all matrices are diagonizable. A matrix with an incomplete set of eigenvectors is call \textit{defective}. Every defective matrix can be expressed in \textit{Jordan (canonical) form} \(M J M^{-1}\) where \(J\) is composed of \textit{Jordan blocks} (with repeated eigenvalues on the diagonal and 1's on the first super-diagonal) and \(M\) is the matrix of generalized eigenvectors.
\begin{example}
  Compute the matrix exponential of the defective matrix \(A = \begin{bsmallmatrix} 2 & 1\\ 0 & 2\end{bsmallmatrix}\)
\end{example}
\subsection*{Solutions to Systems of Linear ODEs}
Let \(\bm{x}(t) = e^{tA} \bm{x_0}\).
Therefore,
\begin{equation}
  \bm{x}(t) = e^{tA} \bm{x_0} \quad \text{solves} \quad \dot{\bm{x}} = A\bm{x}, \bm{x}(0) = \bm{x}_0
\end{equation}
Let \(A = U D U^{-1}\) be the diagonalization of \(A\). Use the change of coordinates
\begin{equation*}
  y(t) = U^{-1} x(t), \quad y_0 = U^{-1} x_0
\end{equation*}
then
\begin{equation*}
  \bm{y}(t) =  U^{-1}e^{tA}U \bm{y_0} =e^{tU^{-1}AU} \bm{y_0} \quad \text{solves} \quad \dot{\bm{y}} = U^{-1}A U\bm{y}, \bm{y}(0) = U^{-1}\bm{y}_0
\end{equation*}
so
\begin{equation*}\bm{y}(t) = U^{-1}e^{tA}U \bm{y_0} =e^{tU^{-1}AU} \bm{y_0}= e^{tD} \bm{y_0} = \begin{bmatrix} e^{\lambda_1 t} & 0 \\ 0 & e^{\lambda_2 t} \end{bmatrix} \bm{y}_0 =  e^{\lambda_1 t} y_0^{(1)} +  e^{\lambda_2 t}y_0^{(2)}.
\end{equation*}
In the original coordinate system, the solution is given by
\begin{equation*}
  \bm{x}(t) = U\begin{bmatrix} e^{\lambda_1 t} & 0 \\ 0 & e^{\lambda_2 t} \end{bmatrix} U^{-1}\bm{x}_0 = u_1 e^{\lambda_1 t} y_0^{(1)} + u_2 e^{\lambda_2 t} y_0^{(2)}
\end{equation*}
\subsection*{Phase planes}
Phase planes are graphical representations of the solutions to a system of differential equations.
\begin{example}
  Plot phase planes for \(\bm{y}' (t) = A \bm{y}\), where
  \begin{enumerate}
    \item \( A = \begin{bmatrix} 1 & 0 \\ 0 & 1\end{bmatrix} \begin{bmatrix} \lambda_1 & 0 \\ 0 & \lambda_2 \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \) with \(0 < \lambda_1 \leq \lambda_2\),
    % \item \( A = \begin{bmatrix} 1 & 0 \\ 0 & 1\end{bmatrix} \begin{bmatrix} \alpha i & 0 \\ 0 & -\alpha i \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \),
    \item \( A = \begin{bmatrix} i & -i \\ 2 & 2\end{bmatrix} \begin{bmatrix} 2i &  0\\ 0 & -2i \end{bmatrix}\begin{bmatrix} i & -i \\ 2 & 2 \end{bmatrix} \).
    \item \( A = \begin{bmatrix} 1 & 0 \\ 1 & 1\end{bmatrix} \begin{bmatrix} -2 & 0 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix} \),
  \end{enumerate}
\end{example}


\newpage

\section{Techniques for Finding Explicit Solutions}
\subsection*{Separation of Variables}
Suppose \(\dot{x}(t) = f(x)g(t)\), then
\begin{equation*}
  \int_{x_0}^x \frac{1}{f(\xi)} d\xi = \int_{t_0}^t g(\tau) d\tau
\end{equation*}
\subsection*{Linear Constant Coefficient Differential eEuations}
Suppose an ODE is give by
\begin{equation*}
  a_n y^{(n)}(s) + a_{n-1} y^{(n-1)}(s) + \dots + a_0 y(s) = 0
\end{equation*}
Look for solutions in the form \(y(s) = e^{ks} \) which gives
\begin{equation*}
  \left(a_n k^n + a_{n-1} k^{n-1} + \dots + a_0 \right) e^{ks} = 0
\end{equation*}
\begin{enumerate}
  \item[\textit{Case:}] The \(n\) roots of the characteristic polynomial are unique. Let the roots are given by \(k_1,k_2, \dots, k_n\). Then root provide a solution \(e^{k_is}\) that is linearly independent to the solutions provided by the other roots. That is, \(y(s) = c_1 e^{k_1s} + c_2 e^{k_2 s} + \dots + c_n e^{k_ns}\).
  \item[\textit{Case:}] Some roots of the characteristic polynomial are repeated roots. Repeated roots are associated with the phenomenom of resonance. A roots that is repeated \(m\) times provides \(m\) linearly indepenent solutions \(p_m(x) e^{ks}\), where \(p_m(x)\) is polynomial of degree \(m\).
\end{enumerate}
\subsection*{Integrating Factors}
Suppose \(y'(x) +p(x) y(x) = f(x) \). Multiply by an integrating factor \(\mu(x)\) to get
  \begin{equation*}\mu(x)y'(x) + \mu(x)p(x) y(x) = \mu(x)f(x)
\end{equation*}
The integrating factor is specifically chosen so that the left hand side is equivalent to \((\mu(x) y(x))'\). That is, \(\mu'(x) = \mu(x) p(x)\), or equivalently,
\begin{equation*}
  \mu(x) = e^{\int p(x) dx}.
\end{equation*}
\subsection*{Variation of Parameters}
Suppose a second order homogeneous ODE has solutions \(y_1(x) \) and \(y_2(x)\). Then the solution to the inhomogeneous problem with right hand side \(f(x)\) is give by
\begin{equation*}
  y(x) = c_1 y_1(x) + c_2y_2(x) + y_1(x) \int \frac{-y_2(x)f(x)}{W(x)} dx + y_2(x) \int \frac{y_1(x)f(x)}{W(x)} dx
\end{equation*}

\end{document}
