Skip to main content

Section 11.2 First Order Linear DEs

Definition 11.2.1. Linear First Order DE.

A first order DE that can be put into the form

\begin{equation*} y' + P(x) y = Q(x) \end{equation*}

is called a linear first order DE.

Which of the following DEs are linear?

  1. \(\displaystyle y' = e^x y\)

  2. \(\displaystyle \dfrac{dy}{dx} = -\dfrac{x}{y+1}\)

  3. \(\displaystyle \sin(x) y' + \cos(x) y = \cos(x)\)

  4. \(\displaystyle y^2 y' + x^2 y =4\)

Answer.

\(a\) and \(c\text{.}\)

Solution.
  1. Since this DE can be rearranged as

    \begin{equation*} y' - e^x y = 0 \end{equation*}
    it is linear with \(P(x) = -e^x\) and \(Q(x) = 0\text{.}\) Notice that this DE is also separable since it is of the form \(y' = f(x)g(y)\text{.}\) Here \(f(x) = e^x\) and \(g(y) = y\text{.}\)

  2. We cannot rearrange this DE into the form \(y' + P(x) y = Q(x)\) and hence it is not linear. It is however separable.

  3. Dividing the equation by \(\sin(x)\) gives

    \begin{equation*} y' + \cot(x) y = \cot(x) \end{equation*}
    and hence this DE is linear with \(P(x) = \cot(x)\) and \(Q(x) = \cot(x)\text{.}\) Notice that this DE is also exact since it can be written as
    \begin{equation*} \dfrac{d}{dx} \left( \sin(x) y \right) = \cos(x)\text{.} \end{equation*}
    This observation leads to the solution of the DE very efficiently.

  4. This DE is not linear. It also isn't separable nor exact.

As illustrated in Example 11.2.2(c), we can solve a first order linear DE if it is of the form

\begin{equation} f(x) y' + f'(x) y = g(x)\label{Eqn-first_order_linear_form}\tag{11.2.1} \end{equation}

since in this case the DE is already exact. If the DE is not of this form we proceed by looking for an integrating factor, \(I(x)\text{,}\) for the DE. Remember that multiplying both sides of the DE by an integrating factor makes the equation exact. So, consider the first order linear DE

\begin{equation*} y'+P(x)y = Q(x)\text{.} \end{equation*}

Multiplying both sides by the (as yet unknown) function \(I(x)\) gives

\begin{equation*} I(x)y' + I(x) P(x)y = I(x) Q(x)\text{.} \end{equation*}

On comparing this to (11.2.1) we can see that this will only be exact if

\begin{equation} I'(x) = I(x)P(x)\text{,}\label{Eqn-int_factor_equation}\tag{11.2.2} \end{equation}

(11.2.2) is itself a first order linear DE for the function \(I(x)\text{.}\) However it is also separable and so we can solve it via the separation of variables technique. This gives

\begin{equation*} I(x) = A e ^{\int P(x) dx} \end{equation*}

where here \(\int P(x) dx\) refers to any one of the antiderivatives of \(P(x)\text{.}\) Thus, in theory at least, we can find an entire family of integrating factors for our original DE. It won’t matter which particular integrating factor we use so we usually just take the one with \(A=1\text{.}\) In summary:

Solve \(y' = x+y\)

Answer.

\(y(x) = Ce^x - x - 1\)

Solution.

This first order DE is not separable. If we rearrange the equation as

\begin{equation*} y'-y = x \end{equation*}

we can see that the equation is linear with \(P(x) = -1\) and \(Q(x) = x\text{.}\) Thus an integrating factor will be

\begin{equation*} I(x) = e^{\int -1 dx} = e^{-x}\text{.} \end{equation*}

Multiplying both sides of the DE by \(I(x)\) gives

\begin{equation*} \dfrac{d}{dx} \left( e^{-x} y \right) = x e^{-x} \end{equation*}

and hence

\begin{equation*} e^{-x} y = \int xe^{-x} dx\text{.} \end{equation*}

Using integration by parts gives

\begin{equation*} e^{-x} y = -xe^{-x} - e^{-x} + C\text{,} \end{equation*}

and so the general solution is

\begin{equation*} y(x) = Ce^x - x - 1\text{.} \end{equation*}

Note: As always we can check our answer by substituting back into the original DE.

Solve \(y' + \sin(x)y = \sin(x)\)

Answer.

\(y(x) = 1+C e^{\cos(x)}\)

Solution.

This equation is linear with \(P(x) = \sin(x)\) and \(Q(x) = \sin(x)\text{.}\) Thus an integrating factor will be

\begin{equation*} I(x) = e^{\int \sin(x) dx} = e^{-\cos(x)}\text{.} \end{equation*}

Multiplying both sides of the DE by the integrating factor gives

\begin{equation*} \dfrac{d}{dx} \left( e^{-\cos(x)}y \right) = \sin(x) e^{-\cos(x)}\text{,} \end{equation*}

and hence

\begin{equation*} e^{-\cos(x)} y = \int \sin(x) e^{-\cos(x)} dx\text{.} \end{equation*}

Using integration by substitution gives

\begin{equation*} e^{-\cos(x)}y = e^{-\cos(x)} + C\text{.} \end{equation*}

Thus the general solution is

\begin{equation*} y(x) = 1+C e^{\cos(x)}\text{.} \end{equation*}

Once again we should check that this is indeed a solution by substituting back into the original DE.

Solve the initial-value problem

\begin{equation*} xy' = y + 2x^3, \: \, y(1) = 2\text{.} \end{equation*}
Answer.

\(y(x) = x^3 + x\)

Solution.

On rearranging the equation as

\begin{equation*} y' - \frac{1}{x} y = 2x^2\text{.} \end{equation*}

we see that this DE is linear with \(P(x) = -\frac{1}{x}\) and \(Q(x) = 2x^2\text{.}\) Thus an integrating factor will be

\begin{equation*} I(x) = e^{\int -x^{-1} dx} = e^{\ln (x^{-1})} = \frac{1}{x}\text{.} \end{equation*}

Multiplying both sides by \(I(x)\) gives

\begin{equation*} \dfrac{d}{dx} \left( \dfrac{1}{x} y \right) = 2x\text{,} \end{equation*}

and hence

\begin{equation*} \dfrac{1}{x} y = x^2 + C\text{.} \end{equation*}

Thus the general solution is

\begin{equation*} y(x) = x^3 + Cx\text{.} \end{equation*}

Using the initial condition \(y(1) = 2\) gives

\begin{equation*} 2 = 1^3 +1 \cdot C \end{equation*}

and so the solution to the initial-value problem is

\begin{equation*} y(x) = x^3 + x\text{.} \end{equation*}

Exercises Example Tasks

1.

Solve the first order linear DE \(\dfrac{dP}{dt} = t^2 - P\text{.}\)

2.

Solve \(y' + \cot(x)y = x\text{.}\)

3.

Solve the initial-value problem

\begin{equation*} y' = e^x + y, \: \, y(0) = 4\text{.} \end{equation*}

4.

Solve \(x^2y' + y = 1\text{.}\)