Integrating Factor Method (First-Order Linear Differential Equations)

This tutorial explains how to solve first-order linear differential equations using the integrating factor method. You will find a clear derivation of the formula, followed by fully worked examples and practice exercises with answers.

General Form

A first-order linear differential equation has the form

\[ \frac{dy}{dx} + P(x)y = Q(x) \]

where \(P(x)\) and \(Q(x)\) are known functions of \(x\).

Derivation of the Integrating Factor

Multiply both sides by an unknown function \(u(x)\):

\[ u(x)\frac{dy}{dx}+u(x)P(x)y=u(x)Q(x) \]

We want the left side to become the derivative of a product. Using the product rule:

\[ \frac{d(uy)}{dx}=y\frac{du}{dx}+u\frac{dy}{dx} \]

For this to match the previous expression, we require

\[ y\frac{du}{dx}=uP(x)y \]

Dividing by \(y\):

\[ \frac{du}{dx}=uP(x) \]

or

\[ \frac{1}{u}\frac{du}{dx}=P(x) \]

Integrating:

\[ \ln u=\int P(x)\,dx \]

Hence the integrating factor is

\[ u(x)=e^{\int P(x)\,dx} \]

Multiplying the original equation by this factor gives

\[ \frac{d(uy)}{dx}=u(x)Q(x) \]

Integrating both sides:

\[ u(x)y=\int u(x)Q(x)\,dx \]

Finally,

\[ y=\frac{1}{u(x)}\int u(x)Q(x)\,dx \]

Worked Examples

Example 1

Solve:

\[ \frac{dy}{dx}-2xy=x \]

Here \(P(x)=-2x\), \(Q(x)=x\).

\[ u(x)=e^{\int -2x\,dx}=e^{-x^2} \] \[ e^{-x^2}y=\int xe^{-x^2}\,dx \] \[ e^{-x^2}y=-\frac12 e^{-x^2}+C \] \[ y=Ce^{x^2}-\frac12 \]

Example 2

Solve for \(x>0\):

\[ \frac{dy}{dx}+\frac{y}{x}=-2 \] \[ u(x)=e^{\int \frac1x dx}=x \] \[ xy=\int -2x\,dx=-x^2+C \] \[ y=\frac{C}{x}-x \]

Example 3

\[ x\frac{dy}{dx}+y=-x^3,\quad x>0 \]

Divide by \(x\):

\[ \frac{dy}{dx}+\frac{y}{x}=-x^2 \] \[ u(x)=x \] \[ xy=\int -x^3\,dx=-\frac{x^4}{4}+C \] \[ y=\frac{C}{x}-\frac{x^3}{4} \]

Exercises

Solve:

1. \(\dfrac{dy}{dx}+y=2x+5\)
2. \(\dfrac{dy}{dx}+y=x^4\)

Answers

1. \(y=2x+3+Ce^{-x}\)
2. \(y=x^4-4x^3+12x^2-24x+24+Ce^{-x}\)

Further Reading

More Differential Equations Tutorials
Runge–Kutta Method

Tip: The integrating factor method is fundamental in calculus and appears frequently in physics, engineering, and applied mathematics.