\docname{sess4.1}
\doctitle{First-Order Linear Differential Equations}

\mylhead
\myrhead

\title{\doctitle}
\maketitle

\emph{Linear equations} are probably the most important class of differential equations. They will be the main focus of this course.

{\bf Definition.}
The general {\bf first-order linear ODE} has the form:
\begin{equation}
A(t)\frac{dx}{dt}+B(t)x(t)=C(t).\label{e1}
\end{equation}
We'll see that we often need to put it in the form:
\begin{equation}\frac{dx}{dt}+p(t)x(t)=q(t)\label{e2}\end{equation}
We'll call (\ref{e2}) {\bf standard form}.  We can always convert (\ref{e1}) to standard form by dividing by $A(t)$.

\section{Terminology and Notation}
The functions $A(t)$, $B(t)$ in (\ref{e1}) and $p(t)$ in (\ref{e2})
are called the {\bf coefficients} of the ODE. If $A$ and $B$ (or $p$)
are constant we say the equation is a {\bf constant coefficient} DE.

We use the familiar notations $x'$ or $\overdot{x}$ for the derivative
of $x$.  With some exceptions, we'll use $\overdot x$ to mean the
derivative with respect to time and $x'$ for other types of derivatives.

\section{Homogeneous/Inhomogeneous}

If $C(t)=0$ in (\ref{e1}) the resulting equation:
\[A(t) \overdot x+B(t)x=0\] is called
{\bf homogeneous}{\footnote{Homogeneous is not the same as homogenous
    (or homogenized).  The syllable ``ge'' has a long e and is
    stressed in homogeneous, while the syllable ``mo'' is stressed in
    homogenous.}}.  Likewise for $\overdot x+p(t)x=0$.

Otherwise the equation is {\bf inhomogeneous}.

\smallskip

In the next session we will see a general analytic method for solving
first-order linear ODE's. For now, note that if $A$, $B$ and $C$ are \emph{constant} then the equation is separable:
\[\frac{A \, dx}{C-Bx}=dt.\]

\section{Examples}

We start with two examples that are modeled by first-order linear ODE's.

\examp{1} In session 1 we modeled an oryx population $x$ with natural growth rate $k$ and harvest rate $h$:
\[\overdot x=kx-h, \text{ or } \overdot x - kx =-h.\]

\hbcom{Double check sesssion number.}

\begin{figure}[h]
\centering
  \includegraphics[width=.5\textwidth]{oryx.jpg}
  \caption{Oryx.  
Image courtesy of \href{http://www.flickr.com/photos/cdstrachan/4487656010/}{Cape Town Craig} on flickr.}
\end{figure}


%use?
\hbcom{These examples doen't have ``solutions'' as such.}
We repeat the argument leading to this model. We start with the
population $x(t)$ at time $t$. A natural growth rate $k$ means that
after a short time $\Delta t$ we would expect there to be approximately $kx(t)\Delta t$ more oryx. However, in that same time $h\Delta t$ oryx are harvested. So we have the net change in the oryx population:
$$\Delta x \approx kx(t)\Delta t-h\Delta t \qquad
\Longrightarrow \qquad \frac{\Delta x}{\Delta t} \approx kx(t)-h.
$$

Now, letting  the time interval $\Delta t$ approach 0 we get the ODE $\frac{dx}{dt}=kx(t)-h$.

\smallskip

Note:  if the rates $k$ and $h$ vary with time, the modeling process will lead to the same differential equation:
\[\frac{dx}{dt}=k(t)x(t)-h(t) \text{ or } \frac{dx}{dt}-k(t)x(t)=-h(t).\]

\examp{2} Bank account: I have a bank account. It has $x(t)$ dollars in it.
$x$ is a function of time. I can deposit money in the account and make
withdrawals from it. The bank pays me rent for the money in my account.
This is called interest.

In the old days a bank would pay interest at the end of the month on
the balance at the beginning of the month. We can model this
mathematically.

With $\Delta t = 1/12 $, the statement at the end of the month will read:
$$x( t + \Delta t ) = x(t) + I x(t) \Delta t + [\text{\small deposits}
- \text{\small withdrawals between }t \; \text{\small and }t+\Delta t].$$
$I$ has units (year)${}^{-1}$ . These days $I$ is typically very small, say
$1\% = 0.01 $. You don't get $1\%$ each month! you get 1/12 of that.

You can think of a withdrawal as a negative deposit, so I will call everything
a deposit.

Nowadays interest is usually computed daily. This is a step on the path
to the enlightenment afforded by calculus, in which $\Delta t \rightarrow 0$.

In order to reach enlightenment, I want to record deposits minus withdrawals
as a \textit{rate}, in dollars per year. Suppose I contribute \$100 sometime every
month, and make no withdrawals. My total deposits up to time $t$ -- my
"cumulative total" deposit $Q(t)$ -- has a graph like the one in Figure~\ref{fig4.1.2}.

\begin{figure}[h]
\begin{verbatim}
             Q
                |          ____|
                |      ___|
                |   __|
                |__|__________________________
                    |   |   |   |   |   |   |     t
\end{verbatim}
  \caption{With periodic deposits to a bank account, the graph of $Q(t)$ is a
    step function.}\label{fig4.1.2}
\end{figure}

In keeping with letting $\Delta t \rightarrow 0$, we should imagine
that I am making this contribution continually at the constant rate of
\$1200/year.  Then the graph of $Q(t)$ is a straight line with slope
1/1200, shown in Figure~\ref{fig4.1.3}.  The derivative $Q'(t) = q(t)$
is constant.

\begin{figure}[h]
\begin{verbatim}
             Q
                |           .
                |       .
                |   .
                |_____________________________
                    |   |   |   |                  t
\end{verbatim}
  \caption{With continuous deposits to a bank account, the graph of
    $Q(t)$ is a straight line.}\label{fig4.1.3}
\end{figure}

In general, say I deposit at the rate of $q(t)$ dollars per year.  The
value of $q(t)$ might vary over time, and might be negative from
time to time, because withdrawals are merely negative deposits.

So (assuming $q(t)$ is continuous),
$$x ( t + \Delta t )\approx x(t) + I x(t) \Delta t + q(t) \Delta t.$$
Now subtract $x(t)$ and divide by $\Delta t$:
\[\frac{x ( t + \Delta t ) - x(t)}{\Delta t}\approx I x + q\]
Next, let the interest period $\Delta t$ tend to zero:
$$\overdot x = I x + q.$$

Note: $q(t)$ can certainly vary in time. The interest rate can too.
In fact the interest rate might depend upon $x$ as well: a larger
account will probably earn a better interest rate. Neither feature
affects the derivation of this equation, but if $I$ does depend upon
$x$ as well as $t$ , then the equation we are looking at is no longer linear.
So let's say $I = I(t) $ and $q = q(t) $.

We can put the ODE into standard form:
$$\overdot x - I x = q.$$
Each symbol represents a function of $t$.
