The Method of Integrating Factors Examples 3
The Method of Integrating Factors Examples 3
Recall from The Method of Integrating Factors page that we can solve first order linear differential equations of the form $\frac{dy}{dt} + p(t) y = g(t)$ by multiplying both sides of the equation by the integrating factor $\mu (t) = e^{\int p(t) \: dt}$ so that:
(1)
\begin{align} \quad \mu (t) \frac{dy}{dt} + \mu (t) p(t) y = \mu (t) g(t) \\ \quad \frac{d}{dt} \left ( \mu (t) y \right ) = \mu (t) g(t) \\ \quad \int \frac{d}{dt} \left ( \mu (t) y \right ) \: dt = \int \mu (t) g(t) \: dt \\ \quad \mu (t) y = \int \mu (t) g(t) \: dt \\ \quad y = \frac{\int \mu (t) g(t) \: dt}{\mu (t)} \end{align}
We will now look at some examples of applying this method of integrating factors.
Example 1
Solve the initial value problem. $t \frac{dy}{dt} +2y = t^2 - t + 1$ for $t > 0$ and with the initial condition $y(1) = \frac{1}{2}$.
We first need our differential equation in the appropriate form. We divide each side by $t$ to get:
(2)
\begin{align} \quad \frac{dy}{dt} + \frac{2}{t} y = \frac{t^2 - t + 1}{t} \\ \quad \frac{dy}{dt} + \frac{2}{t} y = t - 1 + \frac{1}{t} \end{align}
We now see that $p(t) = \frac{2}{t}$. Therefore our integrating factor is:
(3)
\begin{align} \quad \mu (t) = e^{\int p(t) \: dt} \\ \quad \mu (t) = e^{\int \frac{2}{t} \: dt} \\ \quad \mu (t) = e^{2 \ln \mid t \mid} \\ \quad \mu (t) = e^{\ln t^2} \\ \quad \mu (t) = t^2 \end{align}
We now multiply both sides of our differential equation by our integrating factor $\mu (t)$ and get:
(4)
\begin{align} \quad \mu (t) \frac{dy}{dt} + \mu (t) \frac{2}{t} y = \mu (t) \left ( t - 1 + \frac{1}{t} \right ) \\ \quad t^2 \frac{dy}{dt} + 2t y = t^3 - t^2 + t \\ \quad \frac{d}{dt} (t^2 y ) = t^3 - t^2 + t \\ \quad t^2 y = \int ( t^3 - t^2 + t ) \: dt \\ \quad t^2 y = \frac{t^4}{4} - \frac{t^3}{3} + \frac{t^2}{2} + C \\ \quad y = \frac{t^2}{4} - \frac{t}{3} + \frac{1}{2} + \frac{C}{t^2} \end{align}
Plugging in our initial condition of $y(1) = \frac{1}{2}$ and we have that:
(5)
\begin{align} \quad \frac{1}{2} = \frac{1}{4} - \frac{1}{3} + \frac{1}{2} + C \\ \quad \frac{1}{12} = C \end{align}
Therefore the solution to this initial value problem is:
(6)
\begin{align} \quad y = \frac{t^2}{4} - \frac{t}{3} + \frac{1}{2} + \frac{1}{12t^2} \end{align}
Example 2
Solve the initial value problem. $t^3 \frac{dy}{dt} + 4t^2 y = e^{-t}$ for $t < 0$ and with the initial condition $y(-1) = 0$.
Once again, we will divide each term in our differential equation, this time by $t^3$, to get it in the appropriate form:
(7)
\begin{align} \quad \frac{dy}{dt} + \frac{4}{t} y = \frac{e^{-t}}{t^3} \end{align}
We see that $p(t) = \frac{4}{t}$ and so our integrating factor is:
(8)
\begin{align} \quad \mu(t) = e^{\int p(t) \: dt} \\ \quad \mu(t) = e^{\int \frac{4}{t} \: dt} \\ \quad \mu(t) = e^{4 \ln \mid t \mid} \\ \quad \mu(t) = e^{\ln t^4} \\ \quad \mu(t) = t^4 \end{align}
We now multiply both sides of our differential equation by $t^4$ to get:
(9)
\begin{align} \quad t^4 \frac{dy}{dt} + 4t^3 y = te^{-t} \\ \quad \frac{d}{dt} (t^4 y) = te^{-t} \\ \quad t^4 y = \int te^{-t} \: dt \end{align}
The integral on the righthand side can be evaluated with integration by parts. Let $u = t$ and $dv = e^{-t} \: dt$. Then $du = dt$ and $v = -e^{-t}$. Therefore we have that:
(10)
\begin{align} \quad \int u \: dv = uv - \int v \: du \\ \quad \int te^{-t} \: dt = -te^{-t} + \int e^{-t} \: dt \\ \quad \int te^{-t} \: dt = -te^{-t} -e^{-t} + C \\ \quad \int te^{-t} \: dt = -(t + 1)e^{-t} + C \end{align}
Therefore we have that:
(11)
\begin{align} \quad t^4 y = -(t + 1)e^{-t} + C \\ \quad y = -\frac{(t + 1)e^{-t} + C}{t^4} \end{align}
Plugging in the initial condition of $y(-1) = 0$ and we see that $C = 0$. Therefore the solution to this initial value problem is:
(12)
\begin{align} \quad y = -\frac{(t + 1)e^{-t}}{t^4} \end{align}