Skip to content

First-Order Linear Equations

You will learn how to recognize first-order linear equations, use the integrating factor method to solve them, and apply the technique to both general and initial value problems.

A first-order linear differential equation can be written in the standard form:

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

The left side is almost the derivative of a product. The trick is to multiply both sides by a special function called the integrating factor:

μ(x)=eP(x)dx\mu(x) = e^{\int P(x) \, dx}

When you multiply through by μ(x)\mu(x), the left side becomes a perfect derivative:

ddx[μ(x)y]=μ(x)Q(x)\frac{d}{dx} \left[ \mu(x) \cdot y \right] = \mu(x) \cdot Q(x)

Now you can integrate both sides directly and solve for yy.

The diagram shows the integrating factor workflow: identify P(x)P(x), compute μ(x)=ePdx\mu(x) = e^{\int P\,dx}, multiply through, recognize the perfect derivative, and integrate.

Example 1: Basic Integrating Factor

Solve dydx+3y=6\frac{dy}{dx} + 3y = 6.

Solution: Here P(x)=3P(x) = 3, so:

μ(x)=e3dx=e3x\mu(x) = e^{\int 3 \, dx} = e^{3x}

Multiply through:

e3xdydx+3e3xy=6e3xe^{3x} \frac{dy}{dx} + 3e^{3x} y = 6e^{3x} ddx(ye3x)=6e3x\frac{d}{dx} \left( y \cdot e^{3x} \right) = 6e^{3x}

Integrate:

ye3x=2e3x+Cy \cdot e^{3x} = 2e^{3x} + C y=2+Ce3xy = 2 + Ce^{-3x}

Example 2: With Initial Condition

Solve dydx2y=4\frac{dy}{dx} - 2y = 4 with y(0)=5y(0) = 5.

Solution: P(x)=2P(x) = -2, so μ(x)=e2x\mu(x) = e^{-2x}.

ddx(ye2x)=4e2x\frac{d}{dx}(ye^{-2x}) = 4e^{-2x} ye2x=2e2x+Cye^{-2x} = -2e^{-2x} + C y=2+Ce2xy = -2 + Ce^{2x}

Apply y(0)=5y(0) = 5: 5=2+C    C=75 = -2 + C \implies C = 7

Final: y=2+7e2xy = -2 + 7e^{2x}

Example 3: Variable Coefficients

Solve dydx+1xy=x\frac{dy}{dx} + \frac{1}{x}y = x for x>0x \gt 0.

Solution: P(x)=1xP(x) = \frac{1}{x}, so μ(x)=e1xdx=elnx=x\mu(x) = e^{\int \frac{1}{x}\,dx} = e^{\ln x} = x.

Multiply through:

xdydx+y=x2x\frac{dy}{dx} + y = x^2 ddx(xy)=x2\frac{d}{dx}(xy) = x^2 xy=x33+Cxy = \frac{x^3}{3} + C y=x23+Cxy = \frac{x^2}{3} + \frac{C}{x}

First-order linear equations appear everywhere in science and engineering. In electronics, they model RC circuits (how voltage across a capacitor changes when charging or discharging). In environmental science, they describe how the concentration of a pollutant in a lake changes when there is continuous inflow and outflow. Pharmacokinetics uses them to predict how drug levels in the blood rise and fall after taking medication. These are all situations where the rate of change depends linearly on the current value.

The standard form of a first-order linear ODE is:
The integrating factor for $\frac{dy}{dx} + P(x)y = Q(x)$ is:
Multiplying by the integrating factor makes the left side:
For $\frac{dy}{dx} + 2y = 4$, the integrating factor is:
First-order linear equations commonly model: