Skip to content

First-order linear ODEs and the integrating factor

5 min read

Short answer

For y′+P(x)y=Q(x)y'+P(x)y=Q(x), multiply by μ(x)=e∫P dx\mu(x)=e^{\int P\,dx}. The left side becomes (μy)′(\mu y)', so μy=∫μQ dx+C\mu y=\int\mu Q\,dx+C and y=1μ(∫μQ dx+C)y=\dfrac1\mu\left(\int\mu Q\,dx+C\right).

y′ + P y = Q → (μ y)′ = μ Q, μ = e^{∫P dx}y′ + P y = Q → (μ y)′ = μ Q, μ = e^{∫P dx}Standard form coefficient of y′ must be 1μ e to the integral of PKey step left side is a product ruleFinish integrate and divide by μ
The integrating factor is chosen so that μ' = Pμ, which makes the left side an exact derivative.

Why μ works

(μy)′=μ′y+μy′(\mu y)'=\mu'y+\mu y'. If μ′=Pμ\mu'=P\mu, this equals μ(y′+Py)=μQ\mu(y'+Py)=\mu Q. The equation μ′=Pμ\mu'=P\mu is separable with solution μ=e∫P\mu=e^{\int P} (any constant can be dropped).

Standard form first

The coefficient of y′y' must be 11. For x y′+2y=x2x\,y'+2y=x^2, divide by xx to get y′+2xy=xy'+\tfrac2xy=x before reading off P=2xP=\tfrac2x.

Worked example

Solve y′+2y=exy'+2y=e^{x} with y(0)=1y(0)=1.

μ=e2x\mu=e^{2x}, so (e2xy)′=e3x(e^{2x}y)'=e^{3x} and e2xy=13e3x+Ce^{2x}y=\tfrac13e^{3x}+C. Then y=13ex+Ce−2xy=\tfrac13e^{x}+Ce^{-2x}. With y(0)=1y(0)=1: 13+C=1\tfrac13+C=1, C=23C=\tfrac23. So y=13ex+23e−2xy=\tfrac13e^{x}+\tfrac23e^{-2x}.

Try it yourself

Solve y′+1xy=xy'+\dfrac1xy=x for x>0x>0.

Show the answer

μ=eln⁡x=x\mu=e^{\ln x}=x, so (xy)′=x2(xy)'=x^2 and xy=x33+Cxy=\tfrac{x^3}3+C, giving y=x23+Cxy=\tfrac{x^2}3+\dfrac Cx.

Keep going with practice

Vidi's circuit and mixing-tank lessons all reduce to this equation.