8.5: First-Order Linear Differential Equations
Separation of Variables is a valuable framework that enables us to solve many types of differential equations. Unsurprisingly, the method fails when a differential equation cannot be separated. In these cases, specialized techniques must be applied to attain solutions if doing so is possible. In this section our strategy is to reverse-engineer the Product Rule, forcing one side of a differential equation to be the product of two functions. We will solve differential equations of the form \begin{equation} y' + P(x) y = Q(x) \pd \label{eq:linear} \end{equation} We call equations in this form first-order linear differential equations because \(y\) and \(y'\) both have a power of \(1.\) Our goal is to manipulate the left side of \(\eqref{eq:linear}\) to be the derivative of a product of functions.
In \(\eqref{eq:linear},\) we multiply both sides by a function \(\mu(x) \col\) \begin{equation} \mu(x) y' + P(x) \mu(x) y = Q(x) \mu(x) \pd \label{eq:linear-mu} \end{equation} We choose \(\mu(x)\) to satisfy \(\mu'(x) = P(x) \mu(x).\) Then \(\eqref{eq:linear-mu}\) becomes \begin{equation} \mu(x) y' + \mu'(x) y = Q(x) \mu (x) \cma \label{eq:linear-mu-d} \end{equation} where the left side matches the Product Rule expansion of \([y \mu(x)]'.\) Thus, we rewrite \(\eqref{eq:linear-mu-d}\) as \[ \deriv{}{x} [y \mu(x)] = Q(x) \mu(x) \cma \] and integrating both sides yields \begin{align} y \mu(x) &= C + \int Q(x) \mu(x) \di x \nonumber \nl y &= \frac{C}{\mu(x)} + \frac{1}{\mu(x)} \int Q(x) \mu(x) \di x \label{eq:linear-equation-y} \pd \end{align} We call \(\mu(x)\) an integrating factor. Since we choose \(\mu(x)\) to satisfy \(\mu'(x) = P(x) \mu(x),\) we solve for \(\mu(x)\) using Separation of Variables, as follows: \begin{align} \deriv{\mu}{x} &= P(x) \mu(x) \nonumber \nl \frac{1}{\mu} \dd \mu &= P(x) \di x \nonumber \nl \ln|\mu| &= \int P(x) \di x \nonumber \nl \mu(x) &= e^{\int P(x) \di x} \pd \label{eq:mu} \end{align} Substituting \(\eqref{eq:mu}\) into \(\eqref{eq:linear-equation-y}\) then produces a general solution to \(\eqref{eq:linear}\)—namely, \begin{equation} y = Ce^{-\int P(x) \di x} + e^{-\int P(x) \di x} \int Q(x) e^{\int P(x) \di x} \di x \pd \label{eq:linear-sol} \end{equation}
We omit the constant of integration in \(\mu(x) = e^{\int P(x) \di x}\) because we only need one integrating factor.
- Multiply both sides of the equation by an integrating factor, \[\mu(x) = e^{\int P(x) \di x} \cma\] to obtain \[y' e^{\int P(x) \di x} + P(x) e^{\int P(x) \di x} y = Q(x) e^{\int P(x) \di x} \pd\] The left side is the derivative of the product \(y e^{\int P(x) \di x}.\)
- Integrate both sides to get \[y e^{\int P(x) \di x} = C + \int Q(x) e^{\int P(x) \di x} \di x \pd\]
- Solve for \(y.\)
A first-order linear differential equation takes the form \[y' + P(x) y = Q(x) \cma\] which is called linear because the powers of \(y\) and \(y'\) are both \(1.\) To find the general solution of a first-order linear differential equation, use the following steps:
- Multiply both sides of the equation by an integrating factor, \[\mu(x) = e^{\int P(x) \di x} \cma\] to obtain \[y' e^{\int P(x) \di x} + P(x) e^{\int P(x) \di x} y = Q(x) e^{\int P(x) \di x} \pd\] The left side is the derivative of the product \(y e^{\int P(x) \di x}.\)
- Integrate both sides to get \[y e^{\int P(x) \di x} = C + \int Q(x) e^{\int P(x) \di x} \di x \pd\]
- Solve for \(y.\)