Skip to main content

Applied Mathematics

Section 7.3 Linear ordinary differential equations

As discussed in section SectionΒ 7.1, a differential equation is ordinary if the derivatives are ordinary. Additionally, it is linear if it is linear in its dependent variable and derivatives of the dependent variable. We investigate the solution of some classes of linear ordinary differential equations in this section. Let’s assume that \(y\) is the dependent variable and \(x\) is the independent variable. The most general \(n\)th order ordinary linear differential equation as the form:
\begin{equation} a_n(x) y^{(n)} + a_{n-1}(x) y^{(n-1)} + \cdots + a_1(x) y' + a_0 (x) y = f(x)\tag{7.3.1} \end{equation}
In the most general terms, this differential equation is very difficult to solve despite being linear. However, there are cases when this has nice solutions. For the most part, we’ll look at such equations in this section.

Subsection 7.3.1 Second-order Constant-Coefficient Homogeneous differential equations

The most important ordinary differential equations that arise from solving the wave and heat equation are 2nd-order constant coefficient homogeneous differential equations. If \(f(x) \equiv 0\) in (7.3.1), then it is called homogeneous and if the coefficients of the \(y\) terms and its derivatives are not dependent on \(x\text{,}\) then the equation is constant-coefficient. A general 2nd-order ODE with these characteristics can be written:
\begin{equation*} a y'' + b y' + cy = 0 \end{equation*}
where \(a,b,c\) are real constants. To solve these, if we let \(y=e^{rx}\) and substitute this into the ODE,
\begin{align*} ar^2 e^{rx} + br e^{rx} + ce^{rx} \amp = 0 \\ e^{rx}(ar^2 + br +c) \amp = 0 \end{align*}
and since \(e^{rx}\) is never 0
\begin{gather*} ar^2+br+c=0 \end{gather*}
is called the characteristic equation related to the ODE. In general, there are two solutions to this equation, \(r_1\) and \(r_2\text{.}\) The general solution to the equation will thus be
\begin{equation*} y = c_1 e^{r_1 x} + c_2 e^{r_2 x} \end{equation*}

Example 7.3.1.

Find the general solution to
\begin{equation*} y'' + 3y' + 2y = 0 \end{equation*}
Solution.
The characteristic equation is
\begin{align*} r^2 + 3r+2 \amp = 0 \\ (r+2)(r+1) \amp = 0 \end{align*}
which has solutions \(r=-2\) and \(r=-1\text{.}\) The general solution thus is
\begin{equation*} y = c_1 e^{-2x} + c_2 e^{-x} \end{equation*}
To find the values of \(c_1\) and \(c_2\) in the example above or any other differential equation, additional information must be given. This is analogous to using a point to find the integration constant from an indefinite integral. The information is generally framed in the language of initial conditions and initial value problems as defined below.

Definition 7.3.2.

A differential equation has initial conditions if at some point \(t_0\text{,}\) then \(y(t_0)\text{,}\) \(y'(t_0), \ldots, y^{(n-1)}(t_0)\) are known, where \(n\) is the order of the differential equation. The differential equation together with the initial conditions is known as a initial value problem.
The next example shows how to fully solve an initial value problem:

Example 7.3.3.

Find the solution to the initial value problem
\begin{equation*} y''+3y'+2y = 0 \qquad \text{$y(0)=3, y'(0) = -4$}. \end{equation*}
Solution.
To solve the initial value problem we first solve the differential equation, and this was done in ExampleΒ 7.3.1 And the general solution is
\begin{equation} y = c_1 e^{-2x} + c_2 e^{-x}\tag{7.3.2} \end{equation}
Since the initial conditions include knowing the derivative, we will need
\begin{equation} y' = -2c_1 e^{-2x} -c_2 e^{-x}\tag{7.3.3} \end{equation}
and then we will substitute \(y(0)=3\) into (7.3.2) and \(y'(0)=-4\) into (7.3.3)
\begin{align*} 3 \amp = c_1 + c_2 \\ -4 \amp = -2c_1 -c_2 \end{align*}
and the solution to this is \(c_1=1\) and \(c_2=2\text{.}\) Therefore the solution to the initial value problem is
\begin{equation*} y = e^{-2x} + 2e^{-x} \end{equation*}
There are many general types of solutions to second-order constant coefficient differential equations. The following lemma shows the possible solutions.

Proof.

First, recall that the characteristic equation of (7.3.4) is
\begin{equation*} a r^2 + br+c = 0 \end{equation*}
We will prove each statement in order.
  1. The derivatives of (7.3.5) are
    \begin{align*} y' \amp = c_1 r_1 e^{r_1 x} + c_2 r_2 e^{r_2 x} \\ y'' \amp = c_1 r_1^2 e^{r_1 x} + c_2 r_2^2 e^{r_2 x} \end{align*}
    and substituting these into (7.3.4),
    \begin{align*} a y'' + b y' + c y \amp = a (c_1 r_1^2 e^{r_1 x} + c_2 r_2^2 e^{r_2 x} ) + b(c_1 r_1 e^{r_1 x} \\ \amp \qquad + c_2 r_2 e^{r_2 x}) + c(c_1 e^{r_1 x} + c_2 e^{r_2 x}) \end{align*}
    rearranging
    \begin{align*} \amp = c_1 (a r_1^2 + b r_1 + c) e^{r_1 x} + c_2 (a r_2^2 + b r_2 + c) e^{r_2 x} \end{align*}
    and since \(r_1\) and \(r_2\) are roots of the characteristic equation, then both terms in parentheses are zero and
    \begin{equation*} a y'' + b y' + c y = 0 \end{equation*}
  2. The derivatives of (7.3.6) are
    \begin{align*} y' \amp = e^{r_1 x} (r_1 c_1 + c_2 + r_1 c_2 x ) \\ y'' \amp = e^{r_1 x} (r_1^2 c_1 + 2 r_1 c_2 + r_1^2 c_2 x) \end{align*}
    where the product rule has been used. In this case, recall also that since \(r_1\) is the only real root, that \(r_1 = -b/(2a)\) from the quadratic formula with the discriminant \(b^2-4ac=0\text{.}\) Substituting into (7.3.4)
    \begin{align*} a y'' + by' + cy \amp = a e^{r_1 x} (r_1^2 c_1 + 2 r_1 c_2 + r_1^2 c_2 x) \\ \amp \qquad + be^{r_1 x} (r_1 c_1 + c_2 + r_1 c_2 x ) + c (c_1 + c_2 x )e^{r_1 x} \\ \amp = \bigl( c_1 (a r_1^2 + b r_1 + c) + c_2 (2 a r_1 + b) \\ \amp \qquad \qquad + c_2 x (a r_1^2 + br_1 + c)) \bigr) e^{r_1 x} =0 \end{align*}
    where the term with factor \(c_1\) and the term with factor \(c_2 x\) are each 0, because \(r_1\) is a root of the characteristic equation. Lastly, the term with factor \(c_2\) is 0 because as stated about \(r_1=-b/(2a)\text{.}\)
  3. Note that since the roots are pure imaginary, then then \(b=0\) in (7.3.4) and therefore \(r_1\) and \(r_2\) satisfy \(r^2=-c/a\) and since \(r_1=\beta i\text{,}\) then \(\beta^2=c/a\text{.}\) The derivatives of (7.3.7) are
    \begin{align*} y' \amp = c_1 \beta \cos \beta x - c_2 \beta \sin \beta x \\ y'' \amp = - c_1 \beta^2 \sin \beta x -c_2 \beta^2 \cos \beta x \end{align*}
    and then substituting into (7.3.4) with \(b=0\text{,}\)
    \begin{align*} ay'' + c y \amp = a (-c_1 \beta^2 \sin \beta x - c_2 \beta^2 \cos \beta x) + c ( c_1 \sin \beta x +c_2 \cos \beta x ) \\ \amp = c_1 (-a\beta^2 + c) \sin \beta x + c_2 (-a\beta^2 +c) \cos \beta x =0 \end{align*}
    since \(\beta^2=c/a\text{.}\)
  4. In this case, since the roots are complex conjugates, we can write \(r_1=\alpha+i\beta \) and \(r_2=\alpha-i\beta\text{.}\) The characteristic equation can be written:
    \begin{align*} a(r-r_1)(r-r_2) \amp = a(r-(\alpha + i \beta))(r-(\alpha-i\beta)) \\ \amp = a r^2 - 2 a \alpha r + a(\alpha^2+\beta^2) = 0 \end{align*}
    which implies that \(b=-2a \alpha\) and \(c=a(\alpha^2+\beta^2)\text{.}\) The derivatives of (7.3.8) are
    \begin{align*} y' \amp = e^{\alpha x} \bigl( (c_1 \alpha - c_2 \beta) \sin \beta x + (c_2 \alpha + c_1 \beta) \cos \beta x \bigr) \\ y'' \amp = e^{\alpha x} \bigl( (c_1 \alpha^2 -2 c_2 \alpha \beta - c_1 \beta^2) \sin \beta x \\ \amp \qquad \qquad + (c_2 \alpha^2 + 2 c_1 \alpha \beta - c_2 \beta^2) \cos \beta x\bigr) \end{align*}
    and substituting them into (7.3.4),
    \begin{align} a y'' + by' + cy \amp = a e^{\alpha x} \bigl( (c_1 \alpha^2 -2 c_2 \alpha \beta - c_1 \beta^2) \sin \beta x \notag\\ \amp \qquad \qquad + (c_2 \alpha^2 + 2 c_1 \alpha \beta - c_2 \beta^2) \cos \beta x\bigr) \notag\\ \amp \qquad + b e^{\alpha x} \bigl( (c_1 \alpha - c_2 \beta) \sin \beta x + (c_2 \alpha + c_1 \beta) \cos \beta x \bigr) \notag\\ \amp \qquad + c e^{ax} \bigl( c_1 \sin \beta x + c_2 \cos \beta x) \notag\\ \amp = e^{\alpha x} \bigl( c_1 (a\alpha^2-a\beta^2 +b\alpha + c) \sin \beta x \notag\\ \amp \qquad + c_1 (2a\alpha\beta+b\beta) \cos \beta x + c_2 (-2a\alpha \beta-b\beta) \sin \beta x \notag\\ \amp \qquad + c_2 (a \alpha^2 - a \beta^2 + b \alpha + c) \bigr) \tag{7.3.9} \end{align}
    And using \(b=-2a\alpha\) and \(c=a(\alpha^2+\beta^2)\text{,}\) the right hand side of (7.3.9) is 0, therefore (7.3.8) is a solution.

Example 7.3.5.

Find the general solution to \(y'' + 9y=0\text{.}\)
Solution.
The characteristic equation is
\begin{align*} r^2+9 \amp = 0 \\ r \amp = \pm 3i \end{align*}
Since the roots are pure imaginary, the general solution is
\begin{align*} y \amp = C_1 \cos 3x + C_2 \sin 3x \end{align*}
The characteristic equation for this next example has complex roots.

Example 7.3.6.

Find the solution to \(y'' + 4y' +5y=0\text{.}\)
Solution.
The characteristic equation for this differential equation is
\begin{equation*} r^2 + 4r + 5 = 0 \end{equation*}
and since this can’t be factored, we’ll use the quadratic equation to solve this:
\begin{equation*} r = \frac{-4 \pm \sqrt{16-20}}{2} = -2 \pm i \end{equation*}
Using LemmaΒ 7.3.4, the general solution is
\begin{align*} \amp = e^{-2x} \bigl( C_1 \cos x + C_2 \sin x \bigr) \end{align*}

Subsection 7.3.2 Solutions Differential Equations as Vector Spaces

We studied vector spaces in section SectionΒ 3.1 and a common example of a vector space that is not \(\mathbb{R}^n\) is that of functions. It can be shown that the set related to the differential equation in ExampleΒ 7.3.1
\begin{equation*} V = \{ y \in \mathcal{C}^{(2)}(\mathbb{R}) \; | \; y'' + 9 y = 0 \} \end{equation*}
is a vector space or a subspace of \(\mathcal{C}^{(2)}\text{,}\) the vector space of all functions with continuous 2nd derivatives. The basis of the subspace are the two solutions of the differential equation or \(B=(\cos 3x, \sin 3x)\text{.}\) Note that the general solution to the differential equation is the linear combination of the basis vectors or the span of the two solutions.