%\documentclass[10pt,a4paper,twoside,fleqn,draft]{article}
\documentclass[10pt,a4paper,twoside,draft]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[mathscr]{euscript}
\usepackage{url}
\usepackage{amsthm}
\usepackage{eco}
\usepackage{parskip}
\usepackage{verbatim}

\swapnumbers
\input{../../../../TeX/abbreviations}
\input{../../../../TeX/article-theorems}
%\input{../../math/format}
\theoremstyle{definition}
%\newtheorem{exercise}{Exercise}
%\newtheorem{example}{Example}

\numberwithin{equation}{section}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO,RE]{\today}
\fancyhead[CO]{\rightmark}
\fancyhead[CE]{\leftmark}



\newcommand{\news}[1][]{\subsection{#1}}
%\newcommand{\pref}[1]{(\ref{#1})}

%\renewcommand{\theequation}{\roman{equation}}

\renewcommand{\log}{\ln}

%\pagestyle{myheadings}
%\markboth{David Pierce, \today}{\today, Differential equations notes}

%\addtolength{\voffset}{-1.5cm}
%\addtolength{\textheight}{3cm}

\title{Differential equations notes}
\author{David Pierce}
\date{October 11, 2006; recompiled, \today}

\begin{document}
\pagenumbering{roman}
%\renewcommand{\thepage}{\roman{page}}
%\renewcommand{\labelpage}{(\thepage)}
\maketitle
%\thispagestyle{empty}

I originally prepared these notes while teaching Math 253, Introduction to
Ordinary Differential Equations, in the fall of 2003.  Now I am
updating them while teaching Math 219, Introduction to Differential
Equations.

The main
reference is \cite[7th edition, 2001]{MR31:3651}, though sometimes I
consult books like \cite{Kells} or \cite{MR30:2175}, used at METU
years ago. 



\bibliographystyle{plain}
\bibliography{../../../../TeX/references}

\newpage
\tableofcontents

\newpage
\pagenumbering{arabic}


%\setcounter{page}{1}

%\renewcommand{\thepage}{\arabic{page}}
%\renewcommand{\labelpage}{\thepage}
\setcounter{section}{-1}
\section{Introduction}
Recall the fundamental theorems of calculus:
\begin{enumerate}
  \item
If $f$ is continuous, then $\displaystyle\frac{\dee}{\dee
  x}\int_a^xf(t)\dee t=f(x)$.
\item
If $f=g'$, then $\int_a^bf(x)\dee x=g(b)-g(a)$.
\end{enumerate}
So anybody who has studied calculus has solved differential equations:
\begin{itemize}
  \item
To find an indefinite integral $\int f(t)\dee t$ is to
solve the differential equation
\begin{equation}\label{1}
  y'=f(x).
\end{equation}
For example, since 
\begin{equation}\label{indef-ex}
  \int 4t\log t\dee t=2t^2\log t-\int 2t\dee
t=2t^2\log t-t^2+C,
\end{equation}
 the solutions of the differential equation
\begin{equation}\label{1-ex}
  y'=4x\log x
\end{equation}
are the functions $2x^2\log x-x^2+C$.
\item
The value of $\log x$ is defined to be $\int_1^x\dee t/t$.  Thus $\log$
is the solution of the differential equation
\begin{equation}\label{log}
  y'=\frac 1x
\end{equation}
meeting the \tech{initial condition} $y(1)=0$.
\item 
The inverse of $\log$ is defined to be $\exp$, and we must have
\begin{equation}
  \exp'x=\frac 1{\log'\exp x}=\exp x.
\end{equation}
Thus $\exp$ is the 
solution of the differential equation
\begin{equation}\label{exp}
  y'=y
\end{equation}
meeting the initial condition $y(0)=1$.
\end{itemize}
Note that equation \eqref{log} expresses the derivative of a function
of $x$ as another function of $x$; so the equation can be solved by
integrating.  But in equation \eqref{exp}, the derivative of a function $y$
is expressed as a function \emph{of that function $y$}; the solution
of such equations will require new techniques, which are what this
course is all about.

\subsection*{A note on notation}

Particular functions can be described in several ways.  For example,
the squaring function is: 
\begin{itemize}
  \item
the function $f$ such that $f(x)=x^2$ for all [real] numbers $x$;
\item
the function $x\mapsto x^2$ (or $t\mapsto t^2$); or
\item
the function $x^2$ (or $t^2$).
\end{itemize}
(See \cite[ch.~3, p.~45]{Spivak-Calc}.)  The last notation is
ambiguous.  The expressions $x\mapsto x^2$ and
$t\mapsto t^2$ represent the \emph{same} function; but we cannot
indicate this by writing
\begin{equation}
  x^2=t^2.
\end{equation}
Also, what does an expression like
\begin{equation}
  t+t^2x
\end{equation}
mean?  If it indicates a function, then  this function could be 
\begin{equation}
  t\mapsto
t+t^2x,\quad\text{ or }\quad x\mapsto t+t^2x,\quad\text{ or possibly
}\quad(t,x)\mapsto t+t^2x.
\end{equation}
The definite integral
\begin{equation}
  \int_a^bf(t)\dee t
\end{equation}
can also be written
\begin{equation}
  \int_a^b f.
\end{equation}
Of course the latter notation can't be used if we only know $f$ from a
formula:  the integral from $a$ to $b$ of the function $x\mapsto x\log
x$ is
\begin{equation}
  \int_a^b x\log x\dee x;
\end{equation}
this is a number (depending on $a$ and $b$), and it is the \emph{same}
number as
\begin{equation}
\int_a^b t\log t\dee t.
\end{equation}
The so-called indefinite integral $\int f(t)\dee t$ is usually
understood as an instruction or command, namely:
\begin{enumerate}
  \item
find a function $g$ such that $g'=f$;
\item
write down $g(t)+C$, where $C$ is understood as an arbitrary constant.
\end{enumerate}
(See \cite[ch.~18, p.~337]{Spivak-Calc}.)
In this case, we would also write
\begin{equation}
  \int f(s)\dee s=g(s)+C,
\end{equation}
which means that $\int f(t)\dee t$ and $\int f(s)\dee s$ indicate
\emph{different things}.  

However, this convention is violated at
\cite[\S~2.1, p.~33, equations~(21--22)]{MR31:3651}.   There, by
integrating 
\begin{equation}
  \frac{\dee}{\dee t}(\me^{at}y)=\me^{at}g(t),
\end{equation}
the writers conclude
\begin{equation}
  \me^{at}y=\int\me^{as}g(s)\dee s+c;
\end{equation}
they feel the need to distinguish the `integration variable,' now $s$,
from the `independent variable,' $t$.  Yet if the integration can be
performed, then, according to the usual convention, an expression
$h(s)$ will be obtained.  Then one just has to remember to replace $s$
with $t$ here.

To avoid ambiguity, it might be best to let expressions such as $\int
f(t)\dee t$ and $\int 
f(s)\dee s$ and $\int f$ indicate the \emph{same} thing, namely an
arbitrary function $g$ such that $g'=f$.  In other words, these
expressions should simply denote a
\defn{primitive of $f$}.  Suppose we want to indicate a \emph{value}
of $g$, such as $g(x)$.  Keeping in mind the fundamental theorem of
calculus, we can write, for example,
\begin{equation}\label{new-defn}
  \int^x f.
\end{equation}
Then the conclusion of \eqref{indef-ex} would be written
\begin{equation}
  \int^x 4t\log t\dee t=2x^2\log x-x^2+C.
\end{equation}
If we are trying to be precise in this way, then it seems that we
should write \eqref{1} in the form  
\begin{equation}
  y'=f.
\end{equation}
But this form does not accommodate the example \eqref{1-ex}; this
could be written more precisely as
\begin{equation}
  \frac{\dee y}{\dee x}=4x\log x.
\end{equation}
One can formally `solve' this as follows:
\begin{align}
  \frac{\dee y}{\dee x}=4x\log x
&\Iff \dee y=4x\log x\dee x\\
&\Iff \int\dee y=\int 4x\log x\dee x\\
&\Iff y=2x^2\log x-x^2+C.
\end{align}

The \emph{chain rule}\label{chain-rule} is that if $g$ is
differentiable at $a$, and $f$ 
is differentiable at $g(a)$, then $f\circ g$ is differentiable at $a$,
and
\begin{equation}
  (f\circ g)'(a)=f'(g(a))\cdot g'(a).
\end{equation}
Hence the equation
\begin{equation}
  (f\circ g)'=(f'\circ g)\cdot g'
\end{equation}
holds on the common domain of the two members.  If one thinks of
$f\circ g$ as a function $y$, and of $g$ as a function $x$, then one
may write
\begin{equation}
  \frac{\dee y}{\dee t}=\frac{\dee y}{\dee x}\frac{\dee x}{\dee t}.
\end{equation}
Then $\dee y/\dee x$ is not the derivative $y'$ of $y$, but is the
quotient of $y'$ by $x'$.
\newpage

\section{Examples from natural science}
\subsection{From physics}
In physics, Newton's second law, $F=ma$, is a differential equation
since $a=\dee v/\dee t$, that is, $a=\dot v$ (the time-derivative of
$v$).

On a body falling in air, there are two forces:
\begin{itemize}
  \item 
$mg$, due to gravity;
\item
$-\gamma v$, due to friction.  (Here $\gamma$ is the
  `drag-coefficient'.) 
\end{itemize}
Then $ma=F$ can be written as $m\dot v=mg-\gamma v$, that is,
\begin{equation}\label{free-fall}
  \frac{\dee v}{\dee t}=g-\frac{\gamma}mv.
\end{equation}

\subsection{From ecology}
A similar equation arises from consideration of a mouse population of
size $p$ attacked by owls.  Changes in $p$ are due to:
\begin{itemize}
  \item
the birth-rate $r$, in units $\displaystyle\frac{\text{baby
    mice}}{(\text{mice})(\text{month})}$;
\item
the death-rate $k$, in units $\displaystyle\frac{\text{mice}}{\text{month}}$
(killed by owls).
\end{itemize}
(Note how `rate' is used in two different senses.)
Hence we have the differential equation
\begin{equation}\label{mouse-pop}
  \frac{\dee p}{\dee t}=rp-k.
\end{equation}

\section{Direction-fields}
The equations \eqref{free-fall} and \eqref{mouse-pop} have the form
\begin{equation}\label{1-lin-const}
  \frac{\dee y}{\dee t}=ay-b,
\end{equation}
where $y$ is a function of $t$, and $a$ and $b$ are constant.
In turn, the equation \eqref{1-lin-const} (along with \eqref{log} and
\eqref{exp}) is a special case of an equation
\begin{equation}\label{first}
  \frac{\dee y}{\dee t}=f(t,y),
\end{equation}
where $f$ is a function of two variables.
A solution to such an equation can be thought of as a curve in the
Cartesian plane whose slope at each point $(t,y)$ has the value $f(t,y)$.

Hence an idea of the solution of \eqref{first} can be got from a
\defn{direction-field}.  Formally, the direction-field associated with
\eqref{first} is just the function $f$ itself.  One pictures the
direction-field as the plane with a little line of slope $f(t,y)$ at
each point $(t,y)$.  See figures 1.1.2 and 
1.1.4 in the book.

From \eqref{free-fall} (and the direction-field) one may see that, as
$t\to\infty$, so $v$ approaches a `terminal velocity', $mg/\gamma$.

From \eqref{mouse-pop}, one may see that, as $t\to\infty$, so $p$
either drops to $0$ or blows up (increases without bound).

\section[First-order ODE's]{First-order ordinary differential equations}

\subsection{Introduction}

Equation \eqref{1-lin-const} is an \defn{ordinary} differential
  equation because $y$ is a function of only one variable, so only
  ordinary derivatives (and not partial derivatives) appear.  Equation
  \eqref{1-lin-const} is also:
  \begin{itemize}
    \item
 \defn{first-order}, because only the first derivative of $y$ appears;
\item
 \defn{linear}, because $y$ and its derivative(s) are not raised to
 powers or multiplied by each other;
\item
with \defn{constant coefficients}, because $a$ and $b$ are constant
(that is, the derivatives $\dee a/\dee t$ and $\dee b/\dee t$ are
$0$). 
  \end{itemize}

To solve \eqref{1-lin-const}, assuming $a\neq0$, first note that
\emph{one} solution is constant: $y=b/a$.  To find all other
solutions, we may proceed thus:
\begin{align}
  \frac{\dee y}{\dee t}=ay-b & \Iff \frac{\dee y}{\dee
  t}=a\left(y-\frac ba\right)  \\
&\Iff \frac {\dee y/\dee t}{y-b/a}=a\\
&\Iff \frac{\dee}{\dee t}\log\left|y-\frac ba\right|=a\\
&\Iff \log\left|y-\frac ba\right| =at+C\\
&\Iff \left|y-\frac ba\right|=e^{at}e^C\\
&\Iff y=\frac ba+ce^{at}.\label{sol1}
\end{align}
Note that $c=\pm e^C$; but what does this constant mean?  Suppose $y(0)$ is
  $y_0$---this is an \defn{initial
  condition}.  Then $y_0= b/a+c$, so $c=y_0-b/a$.  Hence the solution
  of \eqref{1-lin-const} is
  \begin{equation}
    y=\frac ba+\left(y_0-\frac ba\right)e^{at}.
  \end{equation}
For another method of solution, see Exercise 1.2.4.  

\subsection{Integrating factors}
For a \emph{third} method of solving \eqref{1-lin-const},
rewrite the equation as
\begin{equation}
  \frac{\dee y}{\dee t}-ay=-b.
\end{equation}
Now we use a trick:  Multiply each side by a function $\mu(t)$ (called
  an \defn{integrating factor}):
\begin{equation}\label{mu-prod}
  \frac{\dee y}{\dee t}\cdot\mu(t)-ay\cdot\mu(t)=-b\cdot\mu(t).
\end{equation}
Try to understand the left side as a derivative.  We know
\begin{equation}
  \frac{\dee}{\dee t}(y\cdot\mu(t)) =\frac{\dee y}{\dee
  t}\cdot\mu(t)+y\cdot\mu'(t). 
\end{equation}
So let us choose $\mu$ so that
\begin{equation}
  -a\cdot\mu(t)=\mu'(t).
\end{equation}
This is a new differential equation.  We just need one solution, say
$\mu(t)=e^{-at}$.  Substituting into \eqref{mu-prod} and integrating,
we have 
\begin{align}
  \frac{\dee y}{\dee t}=ay-b 
& \Iff \frac{\dee y}{\dee t}\cdot e^{-at}- ay\cdot e^{-at}=-be^{-at}\\
&\Iff \frac{\dee}{\dee t}(y\cdot e^{-at})=-be^{-at}
\label{intermed}\\
&\Iff y\cdot e^{-at}=\frac bae^{-at}+c\\
&\Iff y=\frac ba+ce^{at},
\end{align}
in agreement with \eqref{sol1}.

Now: in arriving at \eqref{intermed}, we had no need to assume that
$b$ was constant.  Replacing $-b$ with $g(t)$, we have
\begin{align}
  \frac{\dee y}{\dee t}-ay=g(t)
&\Iff \frac{\dee}{\dee t}(y\cdot e^{-at})=g(t)e^{-at}\\
&\Iff y\cdot e^{-at}=\int^t g(s)e^{-as}\dee s\\
&\Iff y=e^{at}\int^t  g(s)e^{-as}\dee s.
\end{align}
(For the notation, see \eqref{new-defn}.)
If $g$ is a polynomial, then we can find $\int g(t)e^{-at}\dee t$
through integration by parts.  

\begin{example}
  Say $g(t)=-(mt+k)$.  We
have
\begin{align}
  \int(mt+k)e^{-at}\dee t
&= -\frac{mt+k}ae^{-at}+\frac ma\int e^{-at}\dee t\\
&= -\left(\frac{mt+k}a+\frac m{a^2}\right)e^{-at}+C.
\end{align}
Therefore
\begin{equation}
  \frac {\dee y}{\dee t}- ay=-(mt+k)\Iff y= \frac{mt+k}a+\frac m{a^2}
  +Ce^{at}. 
\end{equation}
Note here that the behavior of $y$ for large $t$ depends on the sign
of $a$:
\begin{itemize}
  \item
if $a\leq0$, then $y\approx(mt+k)/a+m/a^2$ as $t\to\infty$;
\item
if $a>0$ and $C\neq0$, then $y$ diverges from this value.
\end{itemize}
\end{example}

We can try using integrating factors to solve an arbitrary first-order
linear equation, namely
\begin{equation}\label{eqn:1-lin}
  \frac{\dee y}{\dee t}+y\cdot p(t)=g(t).
\end{equation}
Our integrating factor $\mu(t)$ should satisfy
\begin{gather}
  p(t)\mu(t)=\mu'(t),\\
\frac{\mu'(t)}{\mu(t)}=p(t),\\
\frac{\dee}{\dee t}\log\mu(t)=p(t).
\end{gather}
So we may let
\begin{gather}
  \log\mu(t)=\int^t p,\\
\mu(t)=\exp\int^t p.
\end{gather}
For this $\mu$, we have
\begin{align}
  \frac{\dee y}{\dee t}+y\cdot p(t)=g(t)
&\Iff \frac{\dee}{\dee t}(y\cdot\mu(t))=g(t)\cdot\mu(t)\\
&\Iff y\cdot\mu=\int g\cdot \mu.
\end{align}
How useful this is depends on whether we can perform the
integrations:

\begin{example}\label{ex:gen-lin}
  Suppose we want to solve
\begin{equation}
  ty'+ay=bt^2,
\end{equation}
that is, 
\begin{equation}
  y'+y\cdot \frac at=bt.
\end{equation}
To find $\mu$ as above, we note
\begin{equation}
  \int^t \frac as\dee s= a\log t+C,
\end{equation}
so we may let
\begin{equation}
  \mu(t)=\exp (a\log t)=t^a.
\end{equation}
Then we have
\begin{align}
    y'+y\cdot \frac at=bt
&\Iff \frac{\dee}{\dee t}(y\cdot t^a)=bt^{a+1}\\
&\Iff y\cdot t^a=\frac b{a+2}t^{a+2}+C\\
&\Iff y=\frac b{a+2}t^2+ Ct^{-a}.
\end{align}
We must assume here $a\neq -2$.
\end{example}

\subsection{Separable equations}

We can use the technique of integrating factors to attack an equation
\begin{equation}\label{eqn:1-gen}
  \frac{\dee y}{\dee x}=f(x,y),
\end{equation}
provided that $f(x,y)$ is linear in $y$; in this case we solve as we
did \eqref{eqn:1-lin}.  Suppose now that in $f(x,y)$, we can
\emph{separate} the two
variables in the sense of putting $x$ in the numerator and $y$ in the
denominator, so that \eqref{eqn:1-gen} becomes
\begin{equation}\label{eqn:1-sep}
\frac{\dee y}{\dee x}  =\frac{g(x)}{h(y)}.
\end{equation}
The notation suggests the following solution:
\begin{align}
  \frac{\dee y}{\dee x}=\frac{g(x)}{h(y)}
&\Iff h(y)\dee y=g(x)\dee x\\
&\Iff \int h(y)\dee y=\int g(x)\dee x.\label{eqn:sep}
\end{align}
If in fact $h=H'$ and $g=G'$, then \eqref{eqn:sep} is equivalent to
\begin{equation}\label{eqn:sep-sol}
  H(y)=G(x)+c.
\end{equation}
This equation describes a family of curves, one for each value of
$c$.  Each curve determines $y$ \emph{implicitly} as 
one or more functions of $x$.  Perhaps we want the curve to contain
the point $(x_0,y_0)$; then we must have
\begin{equation}
  H(y_0)=G(x_0)+c,
\end{equation}
which lets us rewrite \eqref{eqn:sep-sol} as
\begin{equation}
  H(y)-H(y_0)=G(x)-G(x_0),
\end{equation}
which in turn means that \eqref{eqn:sep} can be written
\begin{equation}\label{eqn:sep-sol-def}
  \int_{y_0}^y h(t)\dee t=\int_{x_0}^x g(t)\dee t.
\end{equation}

\begin{example}
  To solve
  \begin{equation}
    \frac{\dee y}{\dee x}=\frac{1-x^2}{y^2}
  \end{equation}
so that $y(0)=3$, we can
rewrite the requirements as
\begin{gather}
  \int_3^y t^2\dee t=\int_0^x(1-t^2)\dee t,\\
\frac{y^3}3-9=x-\frac{x^3}3,\\
y^3=27+3x-x^3.\label{eqn:sep-ex}
\end{gather}
Since every real number has a unique real cube-root,
\eqref{eqn:sep-ex} determines $y$ as a unique function of $x$.  One
can get a sense for the shape of the function by looking at the
direction-field\dots 
\end{example}

The technique can be justified more formally as follows.  Rewrite
\eqref{eqn:1-sep} as
\begin{equation}
  y'=\frac g{h(y)},
\end{equation}
where $y$, $g$ and $h$ are understood to be functions.  Equivalently,
\begin{gather}
  h(y)y'=g,\\
\int_{x_0}^x h(y)y'=\int_{x_0}^x g.\label{eqn:sep-rig}
\end{gather}
If $y(x_0)=y_0$, then by so-called $u$-substitution (here $u=y(t)$) we
can write \eqref{eqn:sep-rig} as
\begin{equation}
  \int_{y_0}^{y(x)} h=\int_{x_0}^x g,
\end{equation}
which is \eqref{eqn:sep-sol-def}.

Note that linear differential equations with no constant term are separable:

\begin{example}
  To solve the equation
  \begin{equation}
    y'=y+y\sin x
  \end{equation}
so that $y(0)=1$, we may note
\begin{align}
    y'=y+y\sin x
&\Iff     y'=y(1+\sin x)=\frac{1+\sin x}{1/y}\\
&\Iff \int_1^y\frac{\dee t}{t}=\int_0^x(1+\sin t)\dee t\\
&\Iff \log y= \left.(t-\cos t)\right|_0^x=x-\cos x+1\\
&\Iff y=\exp(x-\cos x+1).
\end{align}
\end{example}


A separable equation with initial condition may not have a unique
solution: 

\begin{example}\label{ex:sep-nonu}
  To solve
  \begin{equation}
    \frac{\dee y}{\dee x}= -\frac xy \quad\text{ and }\quad y(1)=0,
  \end{equation}
we note that the solutions are just those $y$ satisfying:
\begin{gather}
  \int_0^y t\dee t=-\int_1^xt\dee t,\\
\left.\frac{t^2}2\right|_0^y=\left.-\frac{t^2}2\right|_1^t,\\
y^2=-x^2+1,\\
y=\pm\sqrt{x^2+1}.
\end{gather}
\end{example}

We now have three methods of solution for some equations:

\begin{example}
  We can solve
  \begin{equation}
    y'=f(t)\cdot(y+a),
  \end{equation}
where $a$ is constant, in any of the following ways:

\begin{enumerate}
  \item
Rewrite as follows:
\begin{gather}
  \frac{y'}{y+a}=f(t),\\
\frac{\dee}{\dee t}\log\abs{y+a}=f(t),\\
\log\abs{y+a}=\int f+C,\\
\abs{y+a}=\exp C\exp\int f,\\
y+a=c\exp \int f,\\
y=c\exp\int f-a.
\end{gather}
In particular, 
\begin{equation}
  y_0=c\exp\int_{t_0}^{t_0}f-a=c-a,
\end{equation}
so the solution is
\begin{equation}\label{eqn:1of3}
  y=(a+y_0)\exp\int_{t_0}^tf-a.
\end{equation}

\item
The equation is separable:
\begin{gather}
  \frac{\dee y}{\dee t}=\frac{f(t)}{(y+a)\inv},\\
\int_{y_0}^y\frac{\dee x}{x+a}=\int_{t_0}^tf(x)\dee x,\\
\log\pm(y+a)-\log\pm(y_0+a)=\int_{t_0}^tf,
\end{gather}
which is equivalent to \eqref{eqn:1of3}.

\item
We can use integrating factors; but watch out:  We want to solve
\begin{equation}
    \frac{\dee y}{\dee t}\cdot\mu(t)-y\cdot f(t)\cdot \mu(t)=a\cdot
    f(t)\cdot\mu(t),  
\end{equation}
where the left side is
\begin{equation}
  \frac{\dee}{\dee t}(y\cdot\mu(t)),
\end{equation}
so we want
\begin{gather}
  \mu'(t)=-f(t)\cdot\mu(t),\\
  \frac{\mu'(t)}{\mu(t)}=-f(t),\\
\frac{\dee}{\dee t}\log\abs{\mu(t)}=-f(t),\\
\log\abs{\mu(t)}=-\int^tf.
\end{gather}
Any $\mu$ satisfying this will work, so let
\begin{equation}
  \mu(t)=\exp\int^tf.
\end{equation}
Then we have
\begin{gather}
    \frac{\dee}{\dee
    t}(y\cdot\mu(t))=a\cdot f(t)\cdot\mu(t)=-a\cdot\mu'(t),\\
\int_{t_0}^t\frac{\dee}{\dee u}(y\cdot\mu(u))\dee u=
    \int_{t_0}^t\mu'(u)\dee u.
\end{gather}
If we assume $\mu(t_0)=0$, then we get
\begin{gather}
  y\cdot\mu(t)=-a\cdot \mu(t),
\label{eqn:3of3}\\
y=-a,
\end{gather}
which is only a special case of the earlier solutions.  But because of
its definition here, $\mu(t)$ can never be $0$.  We may specify
\begin{equation}
  \mu(t)=\exp\int_{t_0}^tf,
\end{equation}
so $\mu(t_0)=1$.  Then \eqref{eqn:3of3} gives us
\begin{gather}
  t\cdot\mu(t)-y_0=-a(\mu(t)-1),\\
y=\frac{a+y_0}{\mu(t)}-a=(a+y_0)\exp\int_{t_0}^tf-a,
\end{gather}
as before.
\end{enumerate}
\end{example}

\begin{example}
  We find an expression for the velocity $v$ of a projectile fired
  vertically from an airless planet.  We may let $x$ be the distance
  of the projectile from the center of the planet.  From Newton we
  have
  \begin{equation}
    \frac{\dee v}{\dee t}=-\frac k{x^2}
  \end{equation}
for some positive constant $k$ that is proportional to the planet's
mass.

Either the projectile eventually returns to the planet, or not.

During certain time-intervals, `$v$ is a function of $x$,' that is,
$v=f\circ x$ for some function $f$; so by the Chain Rule (see
p.~\pageref{chain-rule}), 
\begin{equation}
  \frac{\dee v}{\dee t}=\frac{\dee v}{\dee x}\frac{\dee x}{\dee t}
  =v\cdot\frac{\dee v}{\dee x}. 
\end{equation}
Thus we get a separable equation:
\begin{gather}
  v\cdot\frac{\dee v}{\dee x}=-\frac k{x^2},\\
\int_{v_0}^v u\dee u=-k\int_{x_0}^x\frac{\dee u}{u^2},\\
v^2-v_0^2=2k\left(\frac 1x-\frac 1{x_0}\right),\\
v^2=\frac{2k}x+v_0^2-\frac{2k}{x_0}.
\end{gather}
The limiting case is $v_0^2=2k/x_0$; the projectile returns if and
only if 
\begin{equation}
  v_0\leq\sqrt{\frac{2k}{x_0}}.
\end{equation}
\end{example}

\begin{example}{}
[I didn't do this in class.]  Say a container (a bucket, a pond) of
  volume $V$ is fed at a
  constant rate $a$ (say in liters/minute) with a solution of some
  chemical compound with a variable concentration of $f$ (in
  grams/liter, say).  The same container is drained at the same rate.
  Assume that at any moment the concentration of compound in the
  container is uniform.  Let the total mass of the compound in the
  container be $Q$.  Then we get
  \begin{equation}
    Q'=af(t)-a\frac QV,
  \end{equation}
a linear equation soluble by means of the integrating factor
$\exp(at/V)$:
\begin{gather}
  a\cdot f(t)\cdot\exp\frac{at}V=Q'(t)\cdot\exp\frac{at}V+\frac
  aVQ(t)\exp\frac{at}V =\frac{\dee}{\dee
  t}\left(Q'(t)\cdot\exp\frac{at}V\right),\\
a\int f(t)\exp\frac{at}V\dee t+C.
\end{gather}
Say $t_0=0$ and $Q(t_0)=Q_0$.  Then
\begin{equation}
  Q(t)=\frac{\displaystyle\int_0^tf(u)\exp\displaystyle\frac{au}V\dee
  u}{\exp\displaystyle\frac{at}V}+Q_0. 
\end{equation}
\end{example}

\subsection{Linear \emph{versus} non-linear equations}

Here is precise formulation of the method of integrating factors as
applied to linear differential equations:

\begin{theorem}\label{thm:lin}
Suppose $p$ and $g$ are continuous functions on the open interval
$(\alpha,\beta)$, and $\alpha<t_0<\beta$.  Then for any real number
$y_0$ there is a unique function $y$ that is differentiable on
$(\alpha,\beta)$ and solves the initial-value problem
\begin{gather}
  y'+y\cdot p=g,\label{eqn:ifthm1}\\
y(t_0)=y_0.\label{eqn:ifthm2}
\end{gather}
\end{theorem}

\begin{proof}
Let $\mu$ be the function on
  $(\alpha,\beta)$ given by
  \begin{equation}
    \mu(t)=\exp\int_{t_0}^tp.
  \end{equation}
Note that $\mu$ is well-defined on $(\alpha,\beta)$ since $p$ is
continuous.  Also, 
\begin{equation}
  \mu'=p\cdot\mu,
\end{equation}
$\mu(t_0)=1$ and $\mu(t)$ is never $0$.  
  Suppose \eqref{eqn:ifthm1} and \eqref{eqn:ifthm2} hold.  
Then we have
\begin{gather}
  y'\cdot\mu+y\cdot p\cdot\mu=g\cdot \mu,\\
(y\cdot\mu)'=g\cdot\mu,\\
\int_{t_0}^t(y\cdot\mu)'=\int_{t_0}^t g\cdot\mu,\\
y(t)\mu(t)-y_0= \int_{t_0}^t g\cdot\mu,\\
y(t)=\frac{\int_{t_0}^t
  g\cdot\mu}{\mu(t)}+\frac{y_0}{\mu(t)}\label{eqn:ifthm3} 
\end{gather}
for all $t$ in $(\alpha,\beta)$.  Thus $y$ is unique.  Multiplying by
$\mu(t)$ and differentiating, one can check that the value of $y$
given by \eqref{eqn:ifthm3} does satisfy \eqref{eqn:ifthm1} and
\eqref{eqn:ifthm2}.  
\end{proof}

\begin{example}
  In Example \ref{ex:gen-lin}, we consider the equation
  \begin{equation}\label{eqn:ln-lin}
    ty'+ay=bt^2.
  \end{equation}
The corresponding linear equation is
\begin{equation}
  y'+y\cdot\frac at=bt.
\end{equation}
Then Theorem \ref{thm:lin} tells that, if $(t_0,y_0)$ is a point in
the plane such that $t_0=\neq0$, then \eqref{eqn:ln-lin} has a unique
solution such that $y(t_0)=y_0$, and $y$ is defined on: $(0,\infty)$,
if $t_0>0$, and on $(-\infty,0)$, if $t_0<0$.  If $a\neq-2$, we found
\begin{equation}
  y=\frac{b}{a+2}t^2+Ct^{-a},
\end{equation}
from which we get
\begin{gather}
  y_0=\frac b{a+2}t_0^2+Ct_0^{-a},\\
C= y_0t_0^a-\frac{b}{a+2}t_0^{a+2},\\
  y=\frac{b}{a+2}t^2+ y_0\left(\frac{t_0}{t}\right)^a
  -\frac{b}{a+2}\left(\frac{t_0}t\right)^at_0^{2};
\end{gather}
this is the unique solution.  But say $a=-1$; then
\begin{equation}
  y=bt^2+\frac{y_0}{t_0}t-bt_0t.
\end{equation}
Thus $y$ is well-defined on $\R$ (and is a solution of
\eqref{eqn:ln-lin}). 
\end{example}

Does a theorem like Theorem \ref{thm:lin} hold for an arbitrary
first-order equation,
\begin{equation}
  y'(t)=f(t,y(t))?
\end{equation}
In time we shall give some justification for the following assertion:

\emph{Suppose \label{statement} a rectangle
  $(\alpha,\beta)\times(\gamma,\delta)$
  contains a point $(t_0,y_0)$, and on this rectangle, a function $f$
  is continuous and has a continuous partial derivative in the second
  coordinate.  Then the initial-value problem 
  \begin{gather}
    y'(t)=f(t,y(t)),\\
y(t_0)=y_0
  \end{gather}
has a unique solution on \emph{some} interval containing $t_0$.}

To see why this might be true, consider the direction-field for the
equation.  Note how continuity matters:  For example, in Example
\ref{ex:sep-nonu}, we have an initial-value problem $\dee y/\dee
x=-x/y$ and $y(1)=0$ with \emph{two} solutions; but the function
\begin{equation}
  (x,y)\mapsto -\frac xy
\end{equation}
is not defined (much less continuous) at $(0,1)$.

We also have the following:

\begin{example}
  Is there an initial-value problem whose solutions are the
  curves $y=at^2$?  These pass through $(0,0)$, and on such curves we
  have 
  \begin{gather}
    y'=2at,\\
a=\frac y{t^2},\\
y'=\frac{2y}t,\\
y't=2y.
  \end{gather}
The direction-field is undefined at $(0,0)$, so the proposed theorem
does not apply.  We can still solve the equation:
\begin{gather}
  \frac{\dee y}{2y}=\frac{\dee t}t,\\
\frac12(\log y-\log y_0=\log t-\log t_0,\\
\log y+2\log t_0=2\log t+\log y_0,\\
yt_0^2=t^2y_0.
\end{gather}
\end{example}

\begin{example}
Assume $y_0\neq 0$.  If we solve
  \begin{equation}
    y'=y^2
  \end{equation}
as a separable equation, we get
\begin{gather}
t-t_0=  \int_{y_0}^yu^{-2}\dee u=\frac 1{y_0}-\frac 1y,\\
y=\frac{y_0}{1-(t-t_0)y_0}.
\end{gather}
Then $y$ is undefined when $t=t_0+1/y_0$, something not evident from
the original equation (which meets the criteria of the proposed
theorem on all rectangles).  The solution should be understood as
defined on: $(-\infty, t_0+1/y_0)$, if $y_0>0$; and on
$(t_0+1/y_0,\infty)$, if $y_0<0$.  If we require $y_0=0$, then, by
inspection, the
equation has the solution $y=0$, defined on $(-\infty,\infty)$; by the
proposed theorem, the solution is unique.
\end{example}

\subsection{Exact equations}

We ask which first-order equations $y'=f(x,y)$ have an implicit solution 
\begin{equation}
  \psi(x,y)=0.
\end{equation}
Differentiating the solution, we get
\begin{equation}\label{eqn:exact}
  \psi_x(x,y)+\psi_y(x,y)\cdot y'=0.
\end{equation}
(Note that $\psi_x$ is just $\partial \psi/\partial x$, \&c.)
Such an equation is called \defn{exact}, and its solutions have the
form
\begin{equation}
  \psi(x,y)=C.
\end{equation}
Note that a multiple
\begin{equation}
  \mu(x,y)\cdot\psi_x(x,y)+ \mu(x,y)\cdot\psi_y(x,y)\cdot y'=0
\end{equation}
of an exact equation will not generally be exact, although it is
solved by all solutions of the exact equation.

\begin{example}
  The separable equation
  \begin{equation}
    f(x)+g(y)\cdot y'=0
  \end{equation}
is exact, since it has the form \eqref{eqn:exact} with
\begin{equation}
  \psi(x,y)=\int f(x)\dee x+\int g(y)\dee y.
\end{equation}
\end{example}

\begin{example}
  The linear equation
  \begin{equation}
    y'+y\cdot g(x)=p(x)
  \end{equation}
is not generally exact, but if $\mu'(x)=g(x)\cdot\mu(x)$, then we can
rewrite the equation as
\begin{equation}
  y\cdot\mu'(x)-p(x)\cdot\mu(x)+\mu(x)\cdot y'=0,
\end{equation}
which has the form \eqref{eqn:exact} with
\begin{equation}
  \psi(x,y)=y\cdot \mu(x)-\int p(x)\cdot \mu(x)\dee x.
\end{equation}
\end{example}

\begin{example}
The equation
\begin{equation}
  2x+y^2+2xy\cdot y'=0
\end{equation}
has the form of \eqref{eqn:exact}, where
\begin{equation}
  \psi(x,y)=x^2+xy^2.
\end{equation}
\end{example}

How can you tell whether an equation of the form
\begin{equation}
  M(x,y)+N(x,y)\cdot y'=0
\end{equation}
is exact?

\begin{lemma}
  Let $M$ and $N$ be continuous functions of $(x,y)$ on an open rectangle
  $R$, and suppose $M_y$ and $N_x$ exist and are continuous on that
  rectangle.  The following are equivalent:
  \begin{enumerate}
    \item
There is a function $\psi$ such that
$\psi_x=M$ and $\psi_y=N$ on $R$.
\item
$M_y=N_x$ on $R$.
  \end{enumerate}
\end{lemma}

\begin{proof}
  If $\psi$ exists, then $\psi_{xy}=M_y$ and $\psi_{yx}=N_x$; since
  these derivatives are continuous, they are equal.

If $M_y=N_x$, we recover $\psi$ by integrating:  Say
\begin{equation}
  \psi(x,y)=\int M(x,y)\dee x + h(y)
\end{equation}
for some function $h$.  Then
\begin{equation}
  \psi_x=M.
\end{equation}
We want to choose $h$ so that $\psi_y=N$.  We have
\begin{gather}
  \psi_y=\int M_y(x,y)\dee x+ h'(y),\\
h'(y)= \psi_y-\int M_y(x,y)\dee x.
\end{gather}
We want the right member of this equation to be $N-\int M_y(x,y)\dee
x$.  It is enough if this function is constant in $x$, as
$h'(y)$ should be: that is, it is enough if
\begin{equation}
  0=\frac{\partial}{\partial x}\left(N-\int M_y(x,y)\dee x\right)
  =N_x-M_y, 
\end{equation}
which is true by assumption.  Hence we may choose
\begin{equation}
  h=\int\left(N-\int M_y(x,y)\dee x\right)\dee y.
\end{equation}
\end{proof}

\begin{example}
  To solve
  \begin{equation}
    2xe^y-y\sin x+(x^2e^y+\cos x-1)y'=0,
  \end{equation}
we first check for exactness:
\begin{gather}
  \frac{\partial}{\partial y}(2xe^y-y\sin x)=2xe^y-\sin x,\\
  \frac{\partial}{\partial x}(x^2e^y+\cos x-1)= 2xe^y-\sin x,
\end{gather}
equal, so the equation is exact.
We now look for $\psi$ so that
\begin{gather}
  \psi_x=2xe^y-y\sin x,\\
\psi_y=x^2e^y+\cos x-1.
\end{gather}
One may be able to see that the solution is
\begin{equation}
  x^2e^y+y\cos x-y=C.
\end{equation}
Otherwise, find $\psi$ by integrating:
\begin{align}
  \psi
&=\int \psi_x\dee x\\
&=\int (2xe^y-y\sin x)\dee x\\
&= x^2e^y+y\cos x+h(y);
\end{align}
differentiating with respect to $y$ gives
\begin{gather}
  x^2e^y+\cos x-1=\psi_y=x^2e^y+\cos x+h'(y),\\
h'(y)=-1,\\
h(y)=-y+C.
\end{gather}
\end{example}

\begin{example}
  The equation
  \begin{equation}
    y^2+xy+(x^2+3xy)y'=0
  \end{equation}
is not exact.  Perhaps we can find an \tech{integrating factor}: some
$\mu(x,y)$ such that the equation
  \begin{equation}
    \mu(x,y)\cdot (y^2+xy)+\mu(x,y)\cdot(x^2+3xy)y'=0
  \end{equation}
is exact.  Then we should have
\begin{equation}\label{eqn:ex-mu}
  \mu(x,y)\cdot(2y+x) + \mu_y(x,y)\cdot(y^2+xy)=
\mu(x,y)\cdot(2x+3y) +\mu_x(x,y)\cdot(x^2+3xy),
\end{equation}
a \tech{partial differential equation}, which we are not prepared to
solve in general.  But perhaps there is a solution $\mu(x)$; that is,
perhaps we can solve
\begin{gather}
  \mu(x)\cdot(2y+x) =
\mu(x)\cdot(2x+3y) +\mu'(x)\cdot(x^2+3xy),\\
\mu'(x)=\mu(x)\frac{2y+x-(2x+3y)}{x^2+3xy},\\
\mu'(x)=-\mu(x)\frac{x+y}{x(x+3y)},
\end{gather}
not soluble by current techniques.  Try again: perhaps
\eqref{eqn:ex-mu} has a solution $\mu(y)$, that is, we may be able to
solve
\begin{gather}
  \mu(y)\cdot(2y+x) + \mu'(y)\cdot(y^2+xy)=
\mu(y)\cdot(2x+3y),\\
\mu'(y)=\mu(y)\frac{2x+3y-(2y+x)}{y^2+xy}=
\mu(y)\frac{x+y}{y(x+y)}=\frac{\mu(y)}y,
\end{gather}
so we may let $\mu(y)=y$.  We now have to solve the exact equation
\begin{equation}
  y^3+xy^2+(x^2y+3xy^2)\cdot y'=0.
\end{equation}
The solution is $\psi(x,y)=C$, where
\begin{gather}
  \psi=\int\psi_x(x,y)\dee x=\int(y^3+xy^2)\dee x= xy^3+\frac12
  x^2y^2+h(y),\\
x^2y+3xy^2=\psi_y=3xy^2+x^2y+h'(y),\\
h'(y)=0,
\end{gather}
so $h$ is constant and the solution is
\begin{equation}
  xy^3+\frac12
  x^2y^2=C.
\end{equation}
\end{example}

\begin{comment}
  


\subsection{Approximating solutions: Euler's method}

[This subsection was not covered in 2006.]

The solution to
\begin{equation}
  y'=f(t,y)
\end{equation}
passing through $(t_0,y_0)$ satisfies
\begin{equation}
  y(t)\approx f(t_0,y_0)(t-t_0)+y_0
\end{equation}
when $t$ is near $t_0$.  Let $t_1=t_0+h$, and suppose $y_1$ is the
approximate value of $y(t_1)$.  Then the solution passes close to the
line
\begin{equation}
  y=f(t_1,y_1)\cdot(t-t_1)+y_1,
\end{equation}
and so forth.  In general, let $t_n=t_0+nh$, and define $y_n$
recursively by
\begin{equation}
  y_{n+1}=f(t_n,y_n)\cdot h+y_n.
\end{equation}
Then the points $(t_n,y_n)$ lie near the solution: consider the
direction-field.  

\subsection{Approximating solutions by iteration}

[This subsection was not covered in 2006.]

Suppose $\phi$ is a function of one variable, $f$ is a function of
two variables, and $t_0$ is a number.  By the fundamental theorem of
calculus, the differential equation (rather,
\emph{identity}) 
\begin{equation}
  \phi'(t)=f(t,\phi(t))
\end{equation}
is equivalent to the \tech{integral equation}
Let $t_0=0$, and assume $\phi(0)=0$; so we can rewrite \eqref{eqn:it1}
as
\begin{equation}\label{eqn:it1}
  \phi(t)=\int_{0}^tf(u,\phi(u))\dee u.
\end{equation}
If $f$ is sufficiently nice (as in the statement on
p.~\pageref{statement}), then we can express $\phi$ as a limit of
successive approximations $\phi_n$:  We can choose an initial
approximation $\phi_0$ (say, $\phi_0(t)=0$), and then define $\phi_n$
recursively by
\begin{equation}
  \phi_{n+1}(t)=\int_0^tf(u,\phi_n(u))\dee u.
\end{equation}

\begin{example}
  Say $f(t,y)=2t(1+y)$.  If $\phi_0(t)=0$, then:
  \begin{gather}
    \phi_1(t)=\int_0^t 2u\dee u= t^2;\\
     \phi_2(t)=\int_0^t 2u(1+u^2)\dee u= \phi_1(t)+\int_0^t2u^3\dee u=
     t^2+\frac{t^4}2;\\ 
     \phi_3(t)=\int_0^t 2u\left(1+u^2+ \frac{u^4}2\right)\dee u=
     \phi_2(t)+ \frac{t^6}6;\\
\phi_4(t)=\phi_3(t)+\int_0^t \frac{u^7}3\dee u=\phi_3(t)+\frac{t^8}{24}  
  \end{gather}
It seems that
\begin{equation}
  \phi_{n+1}(t)=\phi_n(t)+\frac{t^{2n+2}}{(n+1)!}.
\end{equation}
This is confirmed by induction, since it is true when $n=0$, and if it
is true when $n=k$, then
\begin{equation}
  \phi_{k+2}(t)=\int_0^t2u(1+\phi_{k+1}(u))\dee
  u=\phi_{k+1}(t)+\int_0^t\frac{2u^{2k+3}}{(k+1)!}=
  \phi_{k+1}(t)+\frac{t^{2k+4}}{(k+2)!}. 
\end{equation}
Thus the $\phi_n$ are the partial sums of the series
\begin{equation}
  \sum_{n=1}^\infty\frac{t^{2n}}{n!},
\end{equation}
which is convergent and is a solution of the original differential
equation.  (In fact the series is
\begin{equation}
  \exp(t^2)-1,
\end{equation}
though one need not see this in order to check that it is a solution
of the equation.)
\end{example}



\end{comment}

\section{Linear equations}

An arbitrary linear ordinary differential equation can be written

\begin{equation}
  y\cdot f_0(t)+ y'\cdot f_1(t) + y''\cdot f_2(t) + \dots +
  y^{(n)}\cdot f_n(t)=g(t)
\end{equation}
or, more neatly,
\begin{equation}\label{eqn:gen-lin}
  \sum_{i=0}^ny^{(i)}\cdot f_i(t)=g(t);
\end{equation}
if $f_n\neq0$, then this equation is of order $n$, and one can
rewrite the equation as
\begin{equation}
  \sum_{i=0}^{n-1}y^{(i)}\cdot
  \frac{f_i(t)}{f_n(t)}+y^{(n)}=\frac{g(t)}{f_n(t)}. 
\end{equation}

\subsection[Homogeneous with constant coeff. I]{Homogeneous
  equations with constant coefficients, I} 

The equation \eqref{eqn:gen-lin} is \defn{homogeneous} if $g=0$.  An
arbitrary \emph{second-order} linear homogeneous equation with
constant coefficients is
\begin{equation}\label{eqn:2lhcc}
  y''+ay'+b=0.
\end{equation}

\begin{example}\label{ex:1linex}
  One may notice that the equation
  \begin{equation}\label{eqn:1linex}
    y''-y=0
  \end{equation}
has solutions $e^t$ and $e^{-t}$.  Then, because of the sum- and
constant-rules of calculus, every function
\begin{equation}\label{eqn:1linexgen}
  c_0e^t+c_1e^{-t}
\end{equation}
is a solution (where the $c_i$ are constants).  An initial condition
such as
\begin{equation}
  y(0)= 3
\end{equation}
gives us only
\begin{equation}\label{eqn:1linex1}
  c_0+c_1=3;
\end{equation}
to have a unique solution, we can impose an initial condition on $y'$,
such as 
\begin{equation}
  y'(0)= 2;
\end{equation}
then we have also
\begin{equation}\label{eqn:1linex2}
  c_0-c_1=2.
\end{equation}
The system of equations \eqref{eqn:1linex1} and \eqref{eqn:1linex2}
yields
\begin{equation}
  y=\frac 52e^t+\frac12e^{-t}
\end{equation}
as the unique solution of the form \eqref{eqn:1linexgen} to the
initial-value problem.
\end{example}

We may hypothesize that \eqref{eqn:2lhcc} has a solution $e^{rt}$ for
some $r$.  Then we can check:
\begin{align}
 \frac{\dee^2}{\dee t^2}e^{rt}+a\frac{\dee}{\dee t}e^{rt}+be^{rt}=0 & \Iff \\
 (r^2+ar+b)e^{rt}=0 & \Iff \\
 r^2+ar+b=0.\label{eqn:2ch}
\end{align}
Equation \eqref{eqn:2ch} is called the \defn{characteristic equation} of
\eqref{eqn:2lhcc}; it is a quadratic equation, with two or one real
root, or else two or one complex, non-real root.

Suppose first that \eqref{eqn:2ch} has the two distinct real roots
$r_0$ and $r_1$.  Then, just as in Example \ref{ex:1linex}, Equation
\eqref{eqn:2lhcc} has the solutions
\begin{equation}\label{eqn:ggs}
y=  c_0e^{r_0t}+c_1e^{r_1t}.
\end{equation}
This is called the \defn{general solution}, since it will turn out
that all solutions have this form.  The initial conditions
\begin{equation}
  y(t_0)=y_0\quad\text{ and }\quad y'(t_0)=y'_0
\end{equation}
yield the linear system
\begin{equation}\label{eqn:ls}
  \begin{cases}
    y_0=c_0e^{r_0t_0}+c_1e^{r_1t_0},\\
    y_0'=r_0c_0e^{r_0t_0}+ r_1c_1e^{r_1t_0},
  \end{cases}
\end{equation}
which has a unique solution $(c_0,c_1)$:  We can check this just by solving the system, or by using theory:

If $a$, $b$, $c$ and $d$ are numbers, we write
\begin{equation}
  \begin{vmatrix}
    a & b\\
    c & d
  \end{vmatrix}
\end{equation}
for the number $ad-bc$; this is the \defn{determinant} of the
\defn{$2\times 2$ matrix}  
\begin{equation}
  \begin{pmatrix}
    a & b\\
    c & d
  \end{pmatrix}.
\end{equation}
If this is not $0$, then the linear system
\begin{equation}
  \begin{cases}
    ax+by=e,\\
    cx+dy=f
  \end{cases}
\end{equation}
has the solution
\begin{equation}
  x=\frac{
    \begin{vmatrix}
      e & b\\
      f & d
    \end{vmatrix}}{
    \begin{vmatrix}
      a & b\\
      c & d
    \end{vmatrix}}=\frac{ed-bf}{ad-bc},\quad
  y=\frac{
    \begin{vmatrix}
      a & e\\
      c & f
    \end{vmatrix}}{
    \begin{vmatrix}
      a & b\\
      c & d
    \end{vmatrix}}=\frac{af-ec}{ad-bc},
\end{equation}
as one can check by computing.
So \eqref{eqn:ls} has the solution
\begin{equation}
  c_0= \frac{y_0r_1-y_0'}{r_1-r_0}e^{-r_0t_0}, \quad
c_1=\frac{y_0'-y_0r_0}{r_1-r_0}e^{-r_1t_0}.
\end{equation}

\begin{example}
  For the general solution of
  \begin{equation}
    y'' + y'- 12y = 0,
  \end{equation}
form the characteristic equation,
\begin{equation}
  r^2+r-12=0,
\end{equation}
whose roots are $-4$ and $3$; so the general solution is
\begin{equation}
y=  c_0e^{-4t}+c_1e^{3t}.
\end{equation}
Under the initial conditions
\begin{equation}
  y(0)=5\quad\text{ and }\quad y'(0)=-1,
\end{equation}
we get the system
\begin{equation}
  \begin{cases}
\phantom{-}5 =\phantom{-4}c_0 +\phantom{3}c_1,\\
         - 1 =         -4 c_0 +         3 c_1,
  \end{cases}
\end{equation}
with solution $(16/7,19/7)$, whence
\begin{equation}
  y=\frac{16}7e^{-4t}+\frac{19}7e^{3t}.
\end{equation}
Note that the graph has a minimum point $(t_c,y_c)$, where
\begin{gather}
  0=y'_c=-\frac{64}7e^{-4t_c}+\frac{57}7e^{3t_c},\\
e^{-7t_c}=\frac{57}{64},\\
t_c=\frac 17\log\frac{64}{57}.
\end{gather}
\end{example}
Note how the long-term behavior of \eqref{eqn:ggs} depends on the signs
of $r_0$ and $r_1$.

\subsection{Homogeneous equations in general}

An arbitrary second-order linear differential equation can
be written
\begin{equation}
  y''+p(t)y'+q(t)y=g(t).
\end{equation}
It can be proved that, \emph{if the functions $p$, $q$ and $g$ are
  continuous on an open interval, then the equation has a unique
  solution on the whole interval satisfying initial conditions
  \begin{equation}\label{eqn:ic}
    y_0=y(t_0)\quad\text{ and }\quad y_0'=y'(t_0).
  \end{equation}
}

We are interested now in the homogeneous case, where $g=0$.

\begin{theorem}[principle of superposition]
  If $\phi_0$ and $\phi_1$ are solutions of
\begin{equation}\label{eqn:2lh}
  y''+p(t)y' + q(t)y=0,
\end{equation}
and $c_0$ and $c_1$ are constants, then
\begin{equation}\label{eqn:2lhgs}
  c_0\phi_0+c_1\phi_1
\end{equation}
is also a solution.
\end{theorem}

As in Example \ref{ex:1linex}, the proof is by the sum- and
constant-rules of differential calculus.  Since the $0$-function is a
solution of \eqref{eqn:2lh}, another way to state the conclusion of
the theorem is that the set of solutions of \eqref{eqn:2lh} is a
\defn{vector-space}. 

Suppose one does know two solutions as in the theorem.  Then a
solution satisfying \eqref{eqn:ic} can be found by solving
\begin{equation}
  \begin{cases}
    y_0=c_0\phi_0(t_0)+c_1\phi_1(t_0),\\
y_0'=c_0\phi_0'(t_0)+c_1\phi_1'(t_0).
  \end{cases}
\end{equation}
This system has a solution if the determinant
\begin{equation}
  \begin{vmatrix}
    \phi_0(t_0) & \phi_1(t_0)\\
    \phi_0'(t_0) & \phi_1'(t_0)
  \end{vmatrix}
\end{equation}
is not $0$.  This determinant is called the \defn{Wronskian} of
$\phi_0$ and $\phi_1$ at $t_0$ and can be denoted
\begin{equation}
  W(\phi_0,\phi_1)(t_0).
\end{equation}
Suppose this is \emph{not} $0$; then:
\begin{itemize}
  \item
for the equation \eqref{eqn:2lh}
with initial conditions \eqref{eqn:ic} there is a solution of the form
\eqref{eqn:2lhgs};
\item
the functions $\phi_0$ and $\phi_1$ compose
a \defn{fundamental set of solutions} to \eqref{eqn:2lh};
\item
equation
\eqref{eqn:2lhgs} can be called a \defn{general solution} to
\eqref{eqn:2lh};
\item
the space of solutions to \eqref{eqn:2lh} is \defn{2-dimensional}.
\end{itemize}

\begin{example}\label{ex:efs}
  Suppose the characteristic equation of \eqref{eqn:2lhcc} has
  distinct real roots $r_0$ and $r_1$.  Let $\phi_i(t)=e^{r_it}$.
  Then
  \begin{equation}
    W(\phi_0,\phi_1)(t)=
    \begin{vmatrix}
      e^{r_0t} & e^{r_1t}\\
      r_0e^{r_0t} & r_1e^{r_1t}
    \end{vmatrix}=(r_1-r_0)e^{(r_0+r_1)t}\neq0,
  \end{equation}
so $\phi_0$ and $\phi_1$ compose a pair of fundamental solutions of
\eqref{eqn:2lhcc}. 
\end{example}

\begin{example}
  The equation
  \begin{equation}
    2t^2y''+3ty'-1=0
  \end{equation}
can be written
\begin{equation}
  2y''+3t^{-1}y'-t^{-2}=0,
\end{equation}
so by the claim at the beginning of this sub-section, the equation has
solutions on $(0,\infty)$.  One can check that two such solutions are
$t^{1/2}$ and $t^{-1}$.  These are fundamental solutions since
\begin{equation}
  W(t^{1/2},t^{-1})=
  \begin{vmatrix}
    t^{1/2} & t^{-1}\\
    t^{-1/2}/2 & -t^{-2}
  \end{vmatrix}=\frac{-3t^{-3/2}}2\neq0
\end{equation}
when $t>0$.
\end{example}

\begin{example}
  Suppose $\phi_i$ are solutions of \eqref{eqn:2lh} satisfying the
  initial conditions
  \begin{gather}
    \phi_0(t_0)=1,\quad \phi_0'(t_0)=0,\\
    \phi_1(t_0)=0,\quad \phi_1'(t_0)=1.
  \end{gather}
Then the $\phi_i$ compose a fundamental pair of solutions, since their
Wronskian is $1$.
\end{example}

The last example shows that, by the claim at the beginning of the
sub-section, \emph{fundamental solutions always exist}.  More than one
pair exists for a given equation:

\begin{example}
Equation \eqref{eqn:1linex} has fundamental solutions $e^t$ and $e^{-t}$.
If we solve \eqref{eqn:1linex} for the fundamental solutions in the
last example, we get $(e^t+e^{-t})/2$ and $(e^t-e^{-t})/2$, that is,
$\cosh t$ and $\sinh t$.  So the general solution can be written
\begin{equation}
  k_0\cosh t+k_1\sinh t.
\end{equation}
Thus, \eqref{eqn:1linex} has two neat pairs of fundamental solutions,
namely, $\{e^t,e^{-t}\}$ and $\{\cosh,\sinh\}$.
\end{example}

If $W(\phi_0,\phi_1)(t_0)\neq0$ for some $t_0$, then the
\emph{homogeneous} linear system
\begin{equation}\label{eqn:hom-lin-sys}
  \begin{cases}
c_0\phi_0(t_0)+c_1\phi_1(t_0)=0,\\
c_0\phi_0'(t_0)+c_1\phi_1'(t_0)=0.    
  \end{cases}
\end{equation}
has the unique solution $(0,0)$.  This means that the only solution to
the equation
\begin{equation}
  c_0\phi_0+c_1\phi_1=0
\end{equation}
is $(0,0)$.  By definition then, the functions $\phi_0$ and $\phi_1$
are \defn{linearly independent}.  We have shown:

\begin{theorem}
  If the
  Wronskian of two functions is non-zero at one point, then the two
  functions are linearly independent.
\end{theorem}

The converse is false: that is, there are linearly independent
functions whose Wronskian is $0$ at all points:

\begin{example}\label{ex:counter}
  On the interval $(-2,2)$, let $\phi_0(t)=t^3$ and let
  $\phi_1(t)=\abs{t^3}=t^2\abs t$.  Then $\phi_0'(t)=3t^2$, while
  $\phi_1'(t)=3t\abs t$.  Hence
  \begin{equation}
    W(\phi_0,\phi_1)(t)=
    \begin{vmatrix}
      t^3 & t^2\abs t\\
      3t^2 & 3t\abs t
    \end{vmatrix}=0
  \end{equation}
for all $t$.  However, suppose $c_0\phi_0+c_1\phi_1=0$ on $(-2,2)$.
Then at $1$ we have $c_0+c_1=0$, while at $-1$ we have $-c_0+c_1=0$;
solved simultaneously, these equations have the unique solution
$(0,0)$.  Therefore $\phi_0$ and $\phi_1$ are linearly independent.
\end{example}

\begin{example}
  If $r_0\neq r_1$, then the functions $e^{r_0t}$ and $e^{r_1t}$ are
  linearly independent by Example \ref{ex:efs}.
\end{example}

If the $\phi_i$ are solutions to a second-order linear homogeneous
differential equation, then examples like \ref{ex:counter} are not
possible:


\begin{theorem}
  Suppose $\phi_0$ and $\phi_1$ are defined on an open interval $I$ and
  are solutions of 
  \begin{equation}\label{eqn:Abel}
    y''+p(t)y'+q(t)y=0.
  \end{equation}
If their Wronskian is $0$ at one
  point of $I$, then the functions are linearly dependent.
\end{theorem}

\begin{proof}
  Suppose $W(\phi_0,\phi_1)(t_0)=0$.  Then the system
  \eqref{eqn:hom-lin-sys} has a non-zero solution $(c_0,c_1)$.  Let
  $\psi$ be the function $c_0\phi_0+c_1\phi_1$.  Then, by
  \eqref{eqn:hom-lin-sys}, we have $\psi(t_0)=0$ and $\psi'(t_0)=0$.  But
  $\psi$ is also a solution of \eqref{eqn:Abel}, and there is only one
  solution meeting the initial conditions $y(t_0)=0$ and $y'(t_0)=0$,
  namely, $y=0$.  Hence $\psi=0$, which means that the $\phi_i$ are
  linearly dependent.
\end{proof}

We now know that the following are equivalent conditions on a pair
$\{\phi_0,\phi_1\}$ of solutions of \eqref{eqn:Abel}:
\begin{enumerate}
  \item
$W(\phi_0,\phi_1)(t_0)\neq 0$ for some $t_0$.
\item
$\{\phi_0,\phi_1\}$ is a fundamental set of solutions of
  \eqref{eqn:Abel}.
\item
The $\phi_i$ are linearly independent.
\item
$W(\phi_0,\phi_1)(t_0)\neq 0$ for all $t_0$ (in the domain of the
  $\phi_i$). 
\end{enumerate}

In particular, we can say something about $W(\phi_0,\phi_1)$ without
knowing the $\phi_i$: it is $0$ either everywhere or nowhere.  We can
say more:

\begin{theorem}[Abel]
  If $\phi_0$ and $\phi_1$ are solutions of
\eqref{eqn:Abel},
then
\begin{equation}\label{eqn:Abel2}
  W(\phi_0,\phi_1)(t)=c\exp\left(-\int^t p\right),
\end{equation}
where $c$ is constant (that is, $c$ is independent of $t$, or $\dee
c/\dee t=0$; the value of $c$ does depend on $\phi_0$ and $\phi_1$).
\end{theorem}

\begin{proof}
Write the Wronskian here as $W$.  We have
  \begin{align}
    W&=\phi_0 \phi_1' -\phi_1 \phi_0',\\
W'&=\phi_0\phi_1''-\phi_1\phi_0''.
  \end{align}
From \eqref{eqn:Abel}, we also have
\begin{align}
  \phi_1\phi_0''+p\phi_1\phi_0'+q\phi_1\phi_0&=0,\\
  \phi_0\phi_1''+p\phi_0\phi_1'+q\phi_0\phi_1&=0,
\end{align}
which by subtraction yields
\begin{equation}
  W'+pW=0.
\end{equation}
This is a first-order differential equation we can solve, and its
solution is \eqref{eqn:Abel2}.
\end{proof}

\subsection[Homogeneous with constant coeff. II]{Homogeneous equations
  with constant coefficients, II} 

By observation, the equation
\begin{equation}\label{eqn:lh2iiex}
  y''+y=0
\end{equation}
has a fundamental set $\{\cos,\sin\}$ of solutions.  The
characteristic equation
\begin{equation}
  r^2+1=0
\end{equation}
has roots $\pm i$.  Suppose the equation
\begin{equation}\label{eqn:2lhiichar}
  r^2+ar+b=0
\end{equation}
has roots $\lambda\pm i\mu$, where $\lambda$ and $\mu$ are real, and
$\mu\neq0$ (so that the two roots are distinct).  One may guess that a
fundamental set of solutions of
\begin{equation}\label{eqn:2lhii}
  y''+ay'+by=0
\end{equation}
is $\{e^{\lambda t}\cos \mu t,e^{\lambda t}\sin \mu t\}$.  The guess
is correct, as we can verify:  For example, let
\begin{align}
\phi(t)&= e^{\lambda  t}\cos \mu t;\\
\intertext{then}
  \phi'(t) &= \lambda e^{\lambda t}\cos \mu t-\mu e^{\lambda t}\sin
  \mu t,\\
\phi''(t)&=\lambda^2 e^{\lambda t}\cos\mu t-2\lambda\mu e^{\lambda
  t}\sin \mu t-\mu^2e^{\lambda t}\cos\mu t,
\end{align}
and therefore
\begin{multline}
  (\phi''+a\phi'+b\phi)(t)=\\(\lambda^2-\mu^2 +a\lambda +b)e^{\lambda
  t}\cos \mu t - \mu(2\lambda+a)e^{\lambda t}\sin\mu t. 
\end{multline}
By assumption, we have
\begin{align}
  r^2+ar+b&= (r-\lambda -i\mu)(r-\lambda +i\mu)\\
&= (r-\lambda)^2-(i\mu)^2\\
&= r^2-2r\lambda+\lambda^2+\mu^2,
\end{align}
whence
\begin{align}
  a&=-2\lambda,\\
b&=\lambda^2+\mu^2
\end{align}
{and therefore}
\begin{gather}
2\lambda +a=0,\\
\lambda^2-\mu^2 +a\lambda +b= \lambda^2-\mu^2
-2\lambda^2+\lambda^2+\mu^2=0,\\
\phi''+a\phi'+b\phi=0.
\end{gather}
Likewise if $\phi(t)=e^{\lambda t}\sin\mu t$.  Therefore $e^{\lambda
  t}\cos\mu t$ and $e^{\lambda
  t}\sin\mu t$ are solutions of \eqref{eqn:2lhii}.  They comprise a
  fundamental set since their Wronskian is non-zero:
  \begin{multline}
        \begin{vmatrix}
      e^{\lambda t}\cos\mu t & e^{\lambda t}\sin\mu t\\
e^{\lambda t}(\lambda\cos\mu t-\mu \sin \mu t) &
e^{\lambda t}(\lambda\sin\mu t+\mu\cos\mu t)
    \end{vmatrix}=\\
e^{2\lambda t}\left(
\lambda
    \begin{vmatrix}
      \cos\mu t & \sin\mu t\\
\cos\mu t & \sin\mu t
    \end{vmatrix} +
\mu
    \begin{vmatrix}
      \cos\mu t & \sin\mu t\\
-\sin \mu t & \cos\mu t)
    \end{vmatrix}
\right)=\mu e^{2\lambda t}.
  \end{multline}



Why does this approach work?  We might expect complex
exponentiation to be defined so that \eqref{eqn:2lhii} has
solutions $e^{(\lambda\pm i\mu) t}$.
In particular, if $\phi(t)=e^{it}$, then we should have
\begin{align}
  \phi'(t)&=i\phi(t),\\
\phi''(t)&=-\phi(t),
\end{align}
so that $\phi$ solves the initial-value problem
\begin{equation}
  y''+y=0,\quad y(0)=1,\quad y'(0)=i.
\end{equation}
But this problem should have a unique solution $c_0\cos +c_1\sin$,
where---since $(c_0\cos+c_1\sin)'=-c_0\sin+c_1\cos$---we have
\begin{align}
  1&=c_0\cos 0+c_1\sin 0=c_0,\\
i&=-c_0\sin 0+c_1\cos 0=c_1.
\end{align}
Therefore we should define
\begin{equation}
  e^{it}=\cos t+i\sin t;
\end{equation}
this is known as \defn{Euler's formula}.  From it we have
\begin{equation}
  e^{-it}=\cos t-i\sin t,
\end{equation}
whence
\begin{equation}
  e^{(\lambda\pm i\mu) t}= e^{\lambda t}e^{\pm i\mu t}= e^{\lambda
  t}(\cos \mu t\pm i\sin \mu t). 
\end{equation}
Hence, by Euler's formula, $e^{(\lambda\pm i\mu)t}$ \emph{are}
solutions of \eqref{eqn:2lhii}.  Moreover, the solutions we found
originally are given by
\begin{align}
  e^{\lambda t}\cos \mu t&=\frac12(e^{(\lambda+ i\mu) t}+  e^{(\lambda-
  i\mu) t}),\\ 
  e^{\lambda t}\sin \mu t&=\frac1{2i}(e^{(\lambda+ i\mu) t}-  e^{(\lambda-
  i\mu) t}).\\ 
\end{align}
Thus $\{e^{(\lambda\pm i\mu)t}\}$ is a fundamental set of solutions of
\eqref{eqn:2lhii}. 

Note in particular
\begin{align}
  \cos  t&=\frac12(e^{it}+  e^{i t}),\\ 
  \sin  t&=\frac1{2i}(e^{i t}-  e^{i t}).
\end{align}

\begin{example}
  The equation
  \begin{equation}
    y''-y'+y=0
  \end{equation}
has characteristic equation
\begin{equation}
  r^2-r+1=0,
\end{equation}
whence
\begin{equation}
  r=\frac{1\pm i\sqrt 3}2,
\end{equation}
so the general solution is
\begin{equation}
  e^{t/2}\left(c_0\cos\frac{t\sqrt 3}2+ c_1\sin\frac{t\sqrt 3}2\right).
\end{equation}
\end{example}

\begin{remark}
  The product
\begin{equation}
  e^{\lambda t}(c_0\cos \mu t+i\sin \mu t)
\end{equation}
can also be written
\begin{equation}
  Ae^{\lambda t}\sin(\mu t+\theta)
\end{equation}
for some $A$ and $\theta$.  One can verify this by angle-addition
formulas.  Alternatively, $A\sin(t+\theta)$ is a solution of
\eqref{eqn:lh2iiex}, so it is $c_0\cos t+c_1\sin t$ for some $c_0$ and
$c_1$; moreover,
\begin{align}
  A \sin \theta & = c_0,\\
  A \cos \theta & = c_1.
\end{align}
From this, $A^2=c_0^2+c_1^2$, and then $\theta$ is uniquely determined
in the interval $[0,2\pi)$.
\end{remark}

\subsection[Homogeneous with constant coeff. III]{Homogeneous
  equations with constant coefficients, III} 

Suppose the characteristic equation \eqref{eqn:2lhiichar} has a double
root---which must therefore be $-a/2$. Then \eqref{eqn:2lhii} has the
solution $e^{-at/2}$.  Call this $\phi(t)$.  Then $t\phi(t)$ is also
a solution.  Indeed, we have
\begin{align}
\frac{\dee}{\dee t}(t\phi(t))&=\phi(t) -\frac{a}2t\phi(t),\\
\frac{\dee ^2}{\dee t^2}(t\phi(t))&=-a\phi(t)+\frac{a^2}4t\phi(t)
\end{align}
and hence
\begin{equation}
  \frac{\dee ^2}{\dee t^2}(t\phi(t))+a \frac{\dee}{\dee t}(t\phi(t)) +
  bt\phi(t)= \left(\frac{a^2}4-\frac{a^2}2+b\right)t\phi(t)=0
\end{equation}
since $4b=a^2$.  Moreover, $\phi(t)$ and $t\phi(t)$ are linearly
independent, since
\begin{equation}
  \begin{vmatrix}
    \phi(t) & t\phi(t)\\
\phi'(t) & \phi(t)+ t\phi'(t)
  \end{vmatrix}=
  \begin{vmatrix}
    \phi(t) & t\phi(t)\\
0 & \phi(t)
  \end{vmatrix} +
  \begin{vmatrix}
    \phi(t) & t\phi(t)\\
\phi'(t) & t\phi'(t)
  \end{vmatrix}=\phi(t)^2.
\end{equation}
Thus $\{e^{-at/2},te^{-at/2}\}$ is a fundamental set of solutions of
\eqref{eqn:2lhii} when the characteristic equation has a double root.

\begin{example}
  The equation
  \begin{equation}\label{eqn:2lhiiiex}
    y''-2y+y=0
  \end{equation}
has characteristic equation
\begin{equation}
  0=r^2-2r+1=(r-1)^2,
\end{equation}
so $\{e^t,te^t\}$ is a fundamental set of solutions.  Let
$\phi(t)=c_0e^t+c_1te^t$, so that $\phi'(t)=(c_0+c_1)e^t+c_1te^t$.
The initial conditions
\begin{equation}
  y(0)=1\quad\text{ and }\quad y'(0)=0
\end{equation}
give us
\begin{equation}
  \begin{cases}
    1= c_0,\\
    0= c_0+c_1,
  \end{cases}
\end{equation}
so the solution is $e^t-te^t$, that is, $(1-t)e^t$.
\end{example}

\subsection{Reduction of order}

The solution $te^{-at/2}$ in the previous subsection can be derived
from the solution $e^{-at/2}$ by \defn{reduction of
  order}, that is, by reducing the original second-order equation
\eqref{eqn:2lhii} to a
first-order equation.  The general procedure is as follows.

Suppose $\phi$ is a solution of of \eqref{eqn:2lh}.  We try to find a
function $v$ so that $v\phi$ is also a solution.  We have
\begin{align}
  (v\phi)'&=v\phi'+v'\phi,\\
(v\phi)''&=v\phi''+2v'\phi'+v''\phi,
\end{align}
whence
\begin{equation}
  (v\phi)''+p(v\phi)'+qv\phi= 2v'\phi'+v''\phi + pv'\phi.
\end{equation}
Thus $v$ should be a solution of the equation
\begin{equation}
   2v'\phi'+v''\phi + pv'\phi=0,
\end{equation}
which means $v'$ should be a solution of
\begin{equation}\label{eqn:red-ord}
  \phi (v')'+(2\phi'+p\phi)v'=0,
\end{equation}
a \emph{first-order} equation---in fact, linear-homogeneous (hence
separable). 

\begin{example}
  If our equation is \eqref{eqn:2lhiiiex}, with solution $e^t$, then
  \eqref{eqn:red-ord} becomes
  \begin{equation}
    e^tv''(t)=0,
  \end{equation}
so $v'$ is constant, and we may let $v(t)=t$.
\end{example}

\begin{example}
  The equation
  \begin{equation}\label{eqn:red-ord-ex}
    2t^2y''+3ty'-y=0
  \end{equation}
has the solution $1/t$.  We want another solution, $v(t)/t$.  We have
\begin{align}
  \frac{\dee}{\dee t}\left(\frac{v(t)}t\right)&
  =\frac{tv'(t)-v(t)}{t^2}=\frac{v'(t)}t-\frac{v(t)}{t^2},\\ 
  \frac{\dee^2}{\dee t^2}\left(\frac{v(t)}t\right)&
  =\frac{tv''(t)-v'(t)}{t^2}-\frac{t^2v'(t)-2tv(t)}{t^4}\\
 &=  \frac{t^2v''(t)-2tv'(t)+2v(t)}{t^3},
\end{align}
so replacing $y$ with $v(t)/t$ in \eqref{eqn:red-ord-ex} gives
\begin{gather}
  2(t^2v''(t)-2tv'(t)+2v(t))+3(tv'(t)-v(t))-v(t)=0,\\
2t^2v''(t)-tv'(t)=0,\\
\frac{v''(t)}{v'(t)}=\frac 1{2t},\\
\log v'(t)=\frac 12\log t+C;
\end{gather}
letting $C$ be $0$, we get
\begin{gather}
  v'(t)=t^{1/2},\\
v=\int t^{1/2}\dee t=\frac 23t^{3/2}+C,
\end{gather}
where again we may let $C$ be $0$.
\end{example}

\subsection{Inhomogeneous equations}

We know that the set of solutions of \eqref{eqn:2lh} is a
two-dimensional vector-space $V$.  If $\psi$ is a solution of
\begin{equation}\label{eqn:2li}
  y''+p(t)\cdot y'+q(t)\cdot y=g(t),
\end{equation}
then the set of solutions is $V+\psi$, the \defn{translation} of $V$
by $\psi$.  This means two things:
\begin{itemize}
  \item
If $\psi_0$ and $\psi_1$ solve \eqref{eqn:2li}, then $\psi_0-\psi_1$
solves \eqref{eqn:2lh}.
\item
If $\psi$ solves \eqref{eqn:2li}, and $\phi$ solves \eqref{eqn:2lh},
then $\psi+\phi$ solves \eqref{eqn:2li}.
\end{itemize}
So if we know the general solution to \eqref{eqn:2lh}, then we know every
solution to \eqref{eqn:2li}, \emph{provided} we know just one
solution.  To find one solution, we have two methods:

\begin{example}
  To solve
  \begin{equation}
    y''+3y'-4y=e^{2t},
  \end{equation}
we note first that the general solution of the corresponding
homogeneous equation
  \begin{equation}
    y''+3y'-4y=e^{2t}
  \end{equation}
is $c_0e^t+c_1e^{-4t}$.  We guess that the inhomogeneous equation has
solution $Ae^{2t}$, where $A$ is an \defn{undetermined coefficient}.
If $\phi(t)=Ae^{2t}$, then $\phi'=2\phi$ and $\phi''=4\phi$, so we
want
\begin{gather}
  (\phi''+3\phi'-4\phi)(t)=e^{2t},\\
(4+3\cdot 2-4)Ae^{2t}=e^{2t},\\
6A=1.
\end{gather}
So the inhomogeneous equation has general solution
\begin{equation}
  c_0e^t+c_1e^{-4t}+\frac 16e^{2t}.
\end{equation}
\end{example}

If $\phi_i$ solves $y''+p\cdot y'+q\cdot y=g_i$, then $\phi_0+\phi_1$
solves 
\begin{equation}
  y''+p\cdot y'+q\cdot y=g_0+g_1.
\end{equation}
So the method of undetermined coefficients has a broader application:

\begin{example}
  To find a particular solution of
  \begin{equation}
    y''+3y'-4y=e^{2t}-e^{6t},
  \end{equation}
it is enough to take $e^{2t}/6$ from the previous example and add it
to a solution of $y''+3y'-4y=-e^{6t}$, such as $-e^{6t}/50$.
\end{example}

\begin{example}
  To solve
  \begin{equation}
    y''+3y'-4y=2\sin t,
  \end{equation}
remember that $2i\sin t=e^{it}-e^{-it}$; so we can look for a
particular solution of the form
\begin{equation}
  Ce^{it}+De^{-it};
\end{equation}
but since also $2\cos t=e^{it}+e^{-it}$, we can also look for a
solution
\begin{equation}
  A\cos t+B\sin t.
\end{equation}
\end{example}

\subsection{Variation of parameters}

[Not typed up yet.]

\section{Laplace transform}

\subsection{Basics}

Suppose $f$ is a function defined on $[0,\infty)$.  The function $f$
  (if it exists) defined on an interval $[p,\infty)$ by
  \begin{equation}
    F(s)=\int_0^{\infty}e^{-st}f(t)\dee t
  \end{equation}
is called the \defn{Laplace transform} of $f$ and is denoted
\begin{equation}
  \Lpt f.
\end{equation}
By convention here, $f$ is treated as $f(t)$, and $F$ as $F(s)$.

\begin{example}
By integration by parts, we have
  \begin{align}
      \Lpt t& =\int_0^{\infty}te^{-st}\dee t\\
& =\lim_{x\to\infty}\int_0^xte^{-st}\dee t\\
& =\lim_{x\to\infty}\left(
  \bndry{\frac{te^{-st}}{-s}}0x +\frac 1s\int_0^xe^{-st}\dee t\right)\\  
& =\lim_{x\to\infty}\bndry{\frac{e^{-st}}{-s^2}}0x\\
& = \frac 1{s^2}.
  \end{align}
\end{example}

One important property of $\Lpt{}$ is easily proved:

\begin{theorem}
  $\Lpt{}$ is linear, that is,
  \begin{equation}
    \Lpt{af+bg}=a\Lpt f+b\Lpt g,
  \end{equation}
where $f$ and $g$ are functions, and $a$ and $b$ are constants.
\end{theorem}

To use $\Lpt{}$ in solving differential equations, we can relate $\Lpt
f$ and $\Lpt {f'}$.  First we identify a condition on $f$ guaranteeing
that $\Lpt f$ exists:

\begin{theorem}
If $f$ is defined on $[0,\infty)$ and is integrable on each interval
  $[0,t]$, and if
  $\lim_{t\to\infty}e^{-pt}f(t)=0$ for some (positive) $p$, then $\Lpt
  f$ exists.   
\end{theorem}

\begin{proof}
  By hypothesis, there is $M$ such that, if $M\leq t$, then
  $\abs{e^{-pt}f(t)}\leq 1$.  Suppose $p<s$.  Then
  $\abs{e^{-st}f(t)}\leq e^{(p-s)t}\abs{e^{-pt}f(t)}\leq e^{(p-s)t}$
  when $M\leq t$.  Since $\int_0^{\infty}e^{(p-s)t}$ exists, $\Lpt f$
  must exist. 
\end{proof}

If $f$ meets the condition that $\lim_{t\to\infty}e^{-pt}f(t)=0$ for
some (positive) $p$, then $f$ may be said to have \defn{exponential
  order}. 

\begin{theorem}\label{thm:Lpt1}
  If $f$ is continuously differentiable and has exponential order,
  then  $\Lpt{f'}$ exists and is given by
  \begin{equation}
    \Lpt{f'}=s\cdot\Lpt f-f(0).
  \end{equation}
\end{theorem}

\begin{proof}
  Using integration by parts, we have
  \begin{align}
    \Lpt{f'}&=\Lpint {f'(t)}\\
&=\bndry{e^{-st}f(t)}0{\infty}+s\Lpint {f(t)}\\
&=\bndry{e^{-st}f(t)}0{\infty}+s\Lpt {f(t)}.
  \end{align}
Since $f$ has exponential order, we must have
\begin{equation}
  \lim_{x\to\infty}e^{-sx}f(x)=0
\end{equation}
if $s$ is large enough.  The claim now follows.
\end{proof}

In fact the last theorem is true if $f'$ is merely `piecewise'
continuous. 
A third fact we shall not prove:

\begin{theorem}
  If $\Lpt f=\Lpt g$, then $f=g$.
\end{theorem}

We can now solve some initial-value problems:

\begin{example}
  To solve
  \begin{equation}
    y'-2y=e^{4t},\quad y(0)=3,
  \end{equation}
suppose $\phi$ \emph{is} a solution.  Then
\begin{gather}
  \Lpt{\phi'-2\phi}=\Lpt{e^{4t}},\\
\Lpt{\phi'}-2\cdot\Lpt{\phi}=\Lpint{e^{4t}},\\
s\cdot\Lpt{\phi}-\phi(0)-2\cdot\Lpt{\phi}=\frac1{s-4},\\
(s-2)\cdot\Lpt{\phi}-3=\frac1{s-4},\\
(s-2)\cdot\Lpt{\phi}=3+\frac1{s-4}=\frac{3s-11}{s-4},\\
\Lpt{\phi}=\frac{3s-11}{(s-2)(s-4)}.
\end{gather}
Now decompose the right side into `partial fractions':
\begin{equation}
  \frac{3s-11}{(s-2)(s-4)}=\frac A{s-2} +\frac B{s-4},
\end{equation}
where
\begin{equation}
  3s-11=A(s-4)+B(s-2)=(A+B)s-4A-2B,
\end{equation}
whence
\begin{equation}
  \begin{cases}
    \phantom 4A+\phantom 2B=3,\\
4A+2B=11,
  \end{cases}
\end{equation}
so that
\begin{equation}
  A=\frac{
    \begin{vmatrix}
      3&1\\11&2
    \end{vmatrix}}{
    \begin{vmatrix}
      1&1\\4&2
    \end{vmatrix}}=\frac{6-11}{2-4}=\frac{5}2,\quad B=3-\frac 52=\frac 12.
\end{equation}
We now have
\begin{equation}
  \Lpt{\phi}=\frac 52\left(\frac 1{s-2}\right)+\frac 12\left(\frac
  1{s-4}\right).
\end{equation}
Our calculation of $\Lpt{e^{4t}}$ can be adapted to show
\begin{equation}
  \Lpt{e^{at}}=\frac 1{s-a}.
\end{equation}
So we have
\begin{align}
  \Lpt{\phi}& =\frac 52\Lpt{e^{2t}}+\frac 12\Lpt{e^{4t}}\\ 
& =\Lpt{\frac 52e^{2t}+\frac 12e^{4t}},
\end{align}
and therefore
\begin{equation}
  \phi= \frac 52e^{2t}+\frac 12e^{4t}.
\end{equation}
\end{example}

To solve higher-order differential equations, we can use a
generalization of Theorem \ref{thm:Lpt1}:

\begin{theorem}
  If $f^{(n-1)}$ is continuously differentiable and has exponential order,
  then  $\Lpt{f^{(n)}}$ exists and is given by
  \begin{equation}
    \Lpt{f^{(n)}}=s^n\cdot\Lpt f-\sum_{k=0}^{n-1}s^kf^{(n-1-k)}(0).
  \end{equation}  
\end{theorem}

\begin{proof}
  Induction.
\end{proof}

\begin{example}\label{example:Lpt2}
  To solve
  \begin{equation}
    y''+y=e^{-2t}\sin t,\quad y(0)=0,\quad y'(0)=0,
  \end{equation}
apply $\Lpt{}$ to the differential equation, and use the initial values:
\begin{gather}
  \Lpt{y''}+\Lpt y=\Lpt{e^{-2t}\sin t},\\
s^2\cdot\Lpt y-s\cdot y(0)-y'(0)+\Lpt y= \Lpt{e^{-2t}\sin t},\\
(s^2+1)\cdot Y=\Lpt{e^{-2t}\sin t},
\end{gather}
where $Y=\Lpt y$.
\end{example}

To continue with the solution, we need more facts about Laplace
transforms:

\begin{theorem}
If  $\Lpt {f(t)}=F(s)$, then $F(s+a)=\Lpt{e^{-at}f(t)}$.
\end{theorem}

So $\Lpt{e^{-2t}\sin t}=F(s+2)$, where $F(s)=\Lpt{\sin t}$.  Now,
\begin{align}
  \Lpt{\sin}&=\Lpint{\sin t}\\
&=\bndry{-e^{-st}\cos t}0{\infty}-s\Lpint{\cos t}\\
&=1-s\cdot\Lpt{\cos},
\end{align}
and similarly
\begin{align}
  \Lpt{\cos}&=s\cdot\Lpt{\sin}\\
&=s-s^2\cdot\Lpt{\cos},
\end{align}
so that
\begin{equation}
  \Lpt{\cos}=\frac s{s^2+1},\quad\Lpt{\sin}=\frac 1{s^2+1}.
\end{equation}
Alternatively, one can use that
\begin{align}
  \Lpt{\cos}+i\cdot\Lpt{\sin}&= \Lpint{(\cos t+i\sin t)}\\
&=\Lpint {e^{it}}=\bndry{\frac 1{-s+i}e^{(-s+i)t}}0{\infty}\\
&=\frac 1{s-i}\\
&=\frac {s+i}{s^2+1}.
\end{align}

Continuing with Example \ref{example:Lpt2}, we have
\begin{gather}
  (s^2+1)\cdot Y=\frac1{(s+2)^2+1},\\
Y=\frac1{(s^2+1)(s^2+4s+5)},\\
Y=\frac {As+B}{s^2+1}+\frac{Cs+D}{s^2+4s+5},
\end{gather}
where one should calculate that
\begin{equation}
  A=-\frac18,\quad B=\frac 18,\quad C=\frac 18,\quad D=\frac 38.
\end{equation}
In any case, we now have
\begin{align}
  Y&=A\frac {s}{s^2+1}+B\frac 1{s^2+1}+C\frac{s}{(s+2)^2+1}+D\frac
  1{(s+2)^2+1}\\
 &=A\Lpt{\cos}+B\Lpt{\sin}+C\Lpt{e^{-2t}\cos t}+D\Lpt{e^{-2t}\sin t},
\end{align}
so that
\begin{equation}
  y= A\cos t+B\sin t+Ce^{-2t}\cos t+De^{-2t}\sin t.
\end{equation}

In the example, if $\sin t$ had been replaced with $\sin 5t$, we could
have used the following:

\begin{theorem}
  If $\Lpt f=F$, then $\Lpt{f(at)}=F(s/a)/a$.
\end{theorem}

\begin{proof}
  By the substitution
  \begin{equation}
    u=at,\quad \dee u=a\dee t,
  \end{equation}
we have
\begin{align}
  \Lpt{f(at)}&=\Lpint{f(at)}\\
&=\frac 1a\int_0^{\infty}e^{-su/a}f(u)\dee u\\
&=\frac 1a\cdot F\left(\frac sa\right),
\end{align}
where $F(s)=\Lpt f$.
\end{proof}

Hence for example
\begin{equation}
  \Lpt {\cos at}=\frac s{s^2+a^2},\quad\Lpt{\sin at}=\frac a{s^2+a^2}.
\end{equation}

\subsection{Springs}

Suppose an object is subject to the force of a spring (and gravity).
Let $u(t)$ be the displacement of the object from its resting position.
Then the force on the spring is $mu''(t)$.  The force may have three
components: 
\begin{enumerate}
  \item
$-ku(t)$, by Hooke's Law;
\item
$-\gamma u'(t)$, due to friction (\defn{damping});
\item
some other force $F(t)$.
\end{enumerate}
Thus arises the 2nd-order linear differential equation
\begin{equation}
  mu''+\gamma u'+ku=F(t),
\end{equation}
where the coefficients $m$, $\gamma$ and $k$ are non-negative
constants.  Laplace transforms will be particularly useful in case $F$
has discontinuities.

\subsection{Discontinuities}

\begin{example}
  To solve
  \begin{equation}
    y''+2y'+5y=F(t),\quad y(0)=1,\quad y'(0)=0,
  \end{equation}
where
\begin{equation}
  F(t)=
  \begin{cases}
    1,&\text{ if }0\leq t<\pi;\\
0,&\text{ if }\pi\leq t,
  \end{cases}
\end{equation}
note that
\begin{align}
  \Lpt F&=\Lpint{F(t)}\\
&=\int_0^{\pi}e^{-st}\dee t\\
&=\bndry{-\frac{e^{-st}}{s}}0{\pi}\\
&=\frac{1-e^{s\pi}}s.
\end{align}
So we have
\begin{gather}
  \Lpt{y''}+2\Lpt{y'}+5\Lpt y= \frac{1-e^{s\pi}}s,\\
s^2Y-s+2sY-2+5Y=\frac{1-e^{s\pi}}s,\\
(s^2+2s+5)Y=\frac{1-e^{s\pi}}s+s+2,\\
(s^2+2s+5)Y=\frac{s^2+2s+1}s- \frac{e^{s\pi}}s,\\
Y=\frac As+ \frac{Bs+C}{s^2+2s+5} -e^{s\pi}\left(\frac Ds+
\frac{Es+F}{s^2+2s+5}\right),\\
Y=\frac As+ \frac{Bs+C}{(s+1)^2+4} -e^{s\pi}\left(\frac Ds+
\frac{Es+F}{(s+1)^2+4}\right).
\end{gather}
\end{example}

To complete the solution, we need the following:\dots

\section[Systems of DE's]{Systems of differential equations}

We want to solve systems of the form
\begin{equation}
  \begin{cases}
    x_1'=a_{1\;1}x_1 + a_{1\;2}x_2 + \dotsb + a_{1\;n}x_n\\
    x_2'=a_{2\;1}x_1 + a_{2\;2}x_2 + \dotsb + a_{2\;n}x_n\\
\dots\\
    x_n'=a_{n\;1}x_1 + a_{n\;2}x_2 + \dotsb + a_{n\;n}x_n
  \end{cases}
\end{equation}
We can write this as the matrix equation
\begin{equation}\label{eqn:matrix}
  \tuple x'=A\tuple x,
\end{equation}
where
\begin{equation}
  \tuple x=
  \begin{bmatrix}
    x_1\\\vdots\\x_n
  \end{bmatrix}
\quad\text{ and }\quad 
A=
\begin{bmatrix}
a_{1\;1} & \dots & a_{1\;n}\\
\vdots & & \vdots\\
a_{n\;1} & \dots & a_{n\;n}  
\end{bmatrix}.
\end{equation}
In case $n=1$, we have $x'=ax$, with general solution $ce^{at}$; that
is, all solutions are linear combinations of $e^{at}$.  In the general
case, we look for solutions like $e^{at}$.  They should be
vectors---say $\boldsymbol{\xi}e^{rt}$, that is,
\begin{equation}
  \begin{bmatrix}
    \xi_1e^{rt}\\
\vdots\\
\xi_ne^{rt}
  \end{bmatrix}.
\end{equation}
Plugging into \eqref{eqn:matrix} gives
\begin{gather}
  r\boldsymbol{\xi}e^{rt}=A\boldsymbol{\xi}e^{rt},\\
r\boldsymbol{\xi}=A\boldsymbol{\xi},\\
rI\boldsymbol{\xi}=A\boldsymbol{\xi},\\
(rI-A)\boldsymbol{\xi}=\tuple 0,
\end{gather}
where
\begin{equation}
  I=
  \begin{bmatrix}
    1 & 0 & \dots & 0\\
    0 & 1 & \dots & 0\\
\vdots& \vdots & \ddots & \vdots\\
0 & 0 & \dots & 1
  \end{bmatrix}.
\end{equation}
Here $r$ is an \defn{eigenvalue} of $A$, and $\boldsymbol{\xi}$ is a
corresponding \defn{eigenvector}.  This means $\boldsymbol{\xi}\neq\tuple
0$, and:
\begin{enumerate}
  \item
Multiplying $\boldsymbol{\xi}$ by the matrix $A$ is the same as multiplying
by a \defn{scalar} (number);
\item
this scalar is $r$.
\end{enumerate}
We find $r$ first by solving
\begin{equation}
  \det(\lambda I-A)=0,
\end{equation}
the \defn{characteristic equation} of $A$.

\begin{example}
  Let $A=
  \begin{bmatrix}
    1 & 0 \\0 & -1
  \end{bmatrix}$; the characteristic equation is
  \begin{gather}
    \begin{vmatrix}
      \lambda-1 & 0\\0 & \lambda+1
    \end{vmatrix}=0,\\
\lambda^2-1=0,\\
\lambda=\pm 1.
  \end{gather}
That is, $A$ has eigenvalues $\pm 1$.

For the eigenvectors corresponding to $1$, we solve:
\begin{gather}
  (A-I)
  \begin{bmatrix}
    x\\y
  \end{bmatrix}
  =\tuple 0,\\
  \begin{bmatrix}
    0 & 0\\0& -2
  \end{bmatrix}
  \begin{bmatrix}
    x\\y
  \end{bmatrix}
  =\tuple 0,\\
-2y=0.
\end{gather}
So the eigenvectors are the non-zero multiples of $\begin{bmatrix}
  1\\0
\end{bmatrix}$.


For the eigenvectors corresponding to $-1$, we solve:
\begin{gather}
  (A+I)
  \begin{bmatrix}
    x\\y
  \end{bmatrix}
  =\tuple 0,\\
  \begin{bmatrix}
    2 & 0\\0& 0
  \end{bmatrix}
  \begin{bmatrix}
    x\\y
  \end{bmatrix}
  =\tuple 0,\\
2x=0.
\end{gather}
So the eigenvectors are the non-zero multiples of $\begin{bmatrix}
  0\\1
\end{bmatrix}$.

Hence the equation \eqref{eqn:matrix} has, in this case, the general
solution
\begin{equation}
  c_0
  \begin{bmatrix}
    1\\0
  \end{bmatrix}e^t+ c_1
  \begin{bmatrix}
    0\\1
  \end{bmatrix}e^{-t}.
\end{equation}
Consider the direction-field\dots
\end{example}

\begin{example}
  $A=
  \begin{bmatrix}
    3&-2\\4&-3
  \end{bmatrix}$.  Eigenvalues: $\pm1$ again.  Eigenvectors: $(1,1)$
  and $(1,2)$.
\end{example}



\end{document}



