First-order linear differential equations

In this post, we'll see how we solve first-order linear differential equations.



Consider the following first-order homogeneous linear differential equation

\[y' +p(x)y = 0. \tag{Eq:homdiff}\] 

By separating variables, we have

\[\frac{dy}{y} = -p(x)dx.\]

Integrating both sides gives

\[\log|y| = -\int p(x)dx + c\]

so that

\[y = Ce^{-\int p(x)dx}\tag{Eq:homsol}\]

where \(C\) is a constant.

Example. Let's solve

\[y' + 2y = 0.\]

By separating variables, we have

\[\frac{dy}{y} = -2dx.\]

Integrating both sides,

\[\log|y| = -2x + c.\]

Exponentiating both sides, we have

\[y = Ce^{-2x}.\]

where \(C\) is a constant. □

Method of variation of parameters

Next, consider the inhomogeneous differential equation

\[y' + p(x)y + q(x) = 0.  \tag{Eq:inhomdiff}\]

As we have learned in a previous post, we need to find one special solution to construct the general solution. How do we find a special solution?

See also: Linear differential equations: Introduction

Here's one way. This is called the method of variation of parameters. That is, we replace the constant (paramater) \(C\) in the solution (Eq:homsol) of the homogeneous case (Eq:homdiff) with a function \(C(x)\):

\[y = C(x)Y(x)\]

where \(Y(x) = \exp\left(-\int p(x)dx\right)\) is a solution of the homogeneous equation. Noting that \(Y' + p(x)Y = 0\),

\[\begin{eqnarray*} y' + p(x) y + q(x) &=& \{C(x)Y(x)\}' + p(x)C(x)Y(x) + q(x)\\ &=& Y(x)C'(x) + q(x). \end{eqnarray*}\]

If \(y = C(x)Y(x)\) is a solution, then we must have \(Y(x)C'(x) + q(x) = 0\), which gives

\[C'(x) = -q(x)e^{\int p(x)dx}.\]

Integrating this yields

\[C(x) = -\int q(x)e^{\int p(x)dx}dx.\]

Therefore,

\[y = -e^{-\int p(x)dx}\int q(x)e^{\int p(x)dx}dx\]

is a special solution.


Example. Let's solve

\[y' + 2y -3e^{4x} = 0. \tag{Eq:eg2}\]

First, solving the homogeneous ODE

\[y' + 2y = 0,\]

we have

\[y = Ce^{-2x}.\]

Replacing the constant \(C\) with a function \(p(x)\), let \(y(x) = p(x)e^{-2x}\).

Then, we have \(y' = p'(x)e^{-2x} -2p(x)e^{-2x}\). Substituting this into (Eq:eg2),

\[p'(x)e^{-2x} -2p(x)e^{-2x} + 2p(x)e^{-2x} - 3e^{4x} = 0\]

so that

\[p'(x) = 3e^{6x}.\]

Integrating both sides, we have

\[p(x) = \frac{1}{2}e^{6x} + C\]

where \(C\) is a constant. Therefore, the general solution is given by

\[y = \left(\frac{1}{2}e^{6x} + C\right)e^{-2x} = \frac{1}{2}e^{4x} + Ce^{-2x}\]

where \(C\) is a constant. □

Comments

Popular posts from this blog

Open sets and closed sets in \(\mathbb{R}^n\)

Euclidean spaces

Applications of multiple integrals