# 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)

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)

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)

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

(4)

## 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)

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)

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)

Thus for $C$ as a constant we have:

(8)

## 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)

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)

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

(11)

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)

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

(13)