The Method of Integrating Factors Examples 2

# The Method of Integrating Factors Examples 2

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.

More examples can be found on The Method of Integrating Factors Examples 1 page.

## Example 1

Find all solutions to the differential equation $t\frac{dy}{dt} + 2y = t^2 - t + 1$.

We must first divide both sides of the equation by $t$ in order to get the differential equation above into the form $\frac{dy}{dt} + p(t) y = g(t)$. Upon doing so, we obtain:

(2)
\begin{align} \quad \frac{dy}{dt} + \frac{2y}{t} = t - 1 + \frac{1}{t} \end{align}

Now we can clearly see that $p(t) = \frac{2}{t}$ and $g(t) = t - 1 + \frac{1}{t}$. Thus we obtain our integrating factor:

(3)
\begin{align} \quad \mu (t) = e^{\int p(t) \: dt} = e^{\int \frac{2}{t} \: dt} = e^{2 \ln t} = e^{\ln (t^2)} = t^2 \end{align}

Thus for $C$ as a constant we get that:

(4)
\begin{align} \quad \mu (t) \frac{dy}{dt} + \mu (t) p(t) y = \mu (t) g(t) \\ \quad t^2 \frac{dy}{dt} + 2ty = t^3 - t^2 + t \\ \quad \frac{d}{dt} \left ( t^2 y \right ) = t^3 - t^2 + t \\ \quad \int \frac{d}{dt} \left ( t^2 y \right ) \: dt = \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} ## Example 2

Find all solutions to the differential equation $(t^2 - 1) \frac{dy}{dt} + 2ty = t$.

We want to rewrite the differential equation above so that it is in the correct form to apply the method of integrating factors. If we divide both sides of the differential equation above by $(t^2 - 1)$ we get that:

(5)
\begin{align} \quad \frac{dy}{dt} + \frac{2t}{t^2 - 1}y = \frac{t}{t^2 - 1} \end{align}

Therefore we have that $p(t) = \frac{2t}{t^2 - 1}$ and $g(t) = \frac{t}{t^2 - 1}$, and so our integrating factor is:

(6)
\begin{align} \quad \mu (t) = e^{\int p(t) \: dt} = e^{\int \frac{2t}{t^2 - 1} \: dt} \end{align}

To solve the integral in the exponent of $\mu (t)$ we will use the substitution method for integration. Let $u = t^2 - 1$. Then $du = 2t \: dt$, and hence we have that $\int \frac{2t}{t^2 - 1} \: dt = \int \frac{1}{u} \: du = \ln (u) = \ln (t^2 - 1)$. Thus we have our integrating factor is:

(7)
\begin{align} \quad \mu (t) = e^{\ln (t^2 - 1)} = t^2 - 1 \end{align}

Thus for $C$ as a constant we have:

(8)
\begin{align} \quad \mu (t) \frac{dy}{dt} + \mu (t) p(t) y = \mu (t) g(t) \\ \quad (t^2 - 1) \frac{dy}{dt} + 2ty = t \\ \quad \frac{d}{dt} \left ( (t^2 - 1)y \right ) = t \\ \quad \int \frac{d}{dt} \left ( (t^2 - 1)y \right ) \: dt = \int t \: dt \\ \quad (t^2 - 1)y = \frac{t^2}{2} + C \\ \quad y = \frac{t^2}{2(t^2 - 1)} + \frac{C}{t^2 - 1} \end{align} ## Example 3

Find all solutions to the differential equation $t \frac{dy}{dt} - 2y = t^4 \sin t$.

To get the differential equation above in the appropriate form, we will first divide both sides by $t$ to get that:

(9)
\begin{align} \frac{dy}{dt} - \frac{2}{t}y = t^3 \sin t \end{align}

We can see that $p(t) = -\frac{2}{t}$ and $g(t) = t^3 \sin t$. Thus we have that our integrating factor is:

(10)
\begin{align} \quad \mu (t) = e^{\int p(t) \: dt} = e^{\int -\frac{2}{t} \: dt} = e^{-2\ln t} = e^{\ln \left ( \frac{1}{t^2} \right )} = \frac{1}{t^2} \end{align}

Thus for $C$ as a constant we get that:

(11)
\begin{align} \quad \mu (t) \frac{dy}{dt} + \mu (t) p(t) y = \mu (t) g(t) \\ \quad \frac{1}{t^2} \frac{dy}{dt} - \frac{2}{t^3} y = t \sin t \\ \quad \frac{d}{dt} \left ( \frac{y}{t^2} \right ) = t \sin t \\ \quad \int \frac{d}{dt} \left ( \frac{y}{t^2} \right ) \: dt = \int t \sin t \: dt \\ \quad \frac{y}{t^2} = \int t \sin t \: dt \end{align}

To evaluate the integral on the righthand side, we will use integration by parts. Once again, recall that $\int u \: dv = uv - \int v \: du$. Let $u = t$ and let $dv = \sin t \: dt$. Then $du = 1$ and $v = -\cos t$ and thus we have that:

(12)
\begin{align} \quad \int t \sin t \: dt = -t \cos t - \int -\cos t \: du = -t \cos t + \sin t + C = \sin t - t \cos t + C \end{align}

Therefore going back to our differential equation above, we have that:

(13)
\begin{align} \quad \frac{y}{t^2} = \sin t - t \cos t + C\\ \quad y = t^2 \sin t - t^3 \cos t + Ct^2 \end{align}