First-Order Linear Equations
A first-order linear equation \(y' + P(x)y = Q(x)\) usually can't be separated — but multiply it by the integrating factor \(\mu = e^{\int P\,dx}\) and the left side collapses into \((\mu y)'\), so both sides integrate directly.
By the end you'll be able to put a first-order linear equation into standard form, compute its integrating factor \(\mu = e^{\int P\,dx}\), and integrate both sides of \((\mu y)' = \mu Q\) to solve for \(y\).
Predict: the integrating factor turns the left side into the derivative of what product? Step k below and watch the middle line of the pipeline to check.
This is the family \(y' + \frac{k}{x}y = 4x - 3\) (for \(x > 0\)). Stepping k changes \(P(x) = k/x\), which changes μ = xk — and the collapsed left side and the solution curve follow. Drag C to see how the constant of integration picks one curve from the family. Hover the chart (or focus the dot at x = 1) for exact values.
A first-order linear equation \(y' + P(x)y = Q(x)\) is solved by multiplying through by the integrating factor \(\mu = e^{\int P\,dx}\), which turns the left side into \((\mu y)'\) so both sides can be integrated.
Why does this particular \(\mu\) work? Because \(\mu = e^{\int P\,dx}\) is the exponential of an antiderivative of \(P\), the chain rule gives \(\mu' = \mu P\). Multiply the standard form equation by \(\mu\): $$\mu y' + \mu P y = \mu Q.$$ Substituting \(\mu P = \mu'\), the left side reads \(\mu y' + \mu' y\) — exactly the product-rule expansion of \((\mu y)'\). So the equation becomes \((\mu y)' = \mu Q\), and integrating both sides gives $$\mu y = \int \mu Q\,dx \quad\Rightarrow\quad y = \frac{1}{\mu}\int \mu Q\,dx.$$ You saw this collapse live in the middle line of the pipeline above — that's what stepping k re-derives.
The recipe is the same every time. (1) Put the equation in standard form \(y' + P(x)y = Q(x)\) — divide through so the \(y'\) coefficient is 1. (2) Compute \(\mu = e^{\int P\,dx}\). (3) Multiply through by \(\mu\); the left side becomes \((\mu y)'\) by construction — if it doesn't, recheck steps 1–2. (4) Integrate both sides, keeping the constant of integration \(C\). (5) Divide by \(\mu\) to isolate \(y\), and use an initial condition (if given) to pin down \(C\). Contrast this with separable equations from the earlier lesson: there you factor \(y'\) as \(f(x)g(y)\) and split the variables. When \(y\) and \(x\) terms appear as a sum — like \(Q(x) - P(x)y\) — you can't factor, and the integrating factor is the tool instead.
Solve \(xy' + 3y = 4x^2 - 3x\) for \(x > 0\).
- Standard form — divide by \(x\): \(y' + \frac{3}{x}y = 4x - 3\), so \(P(x) = \frac{3}{x}\).
- Integrating factor: \(\int \frac{3}{x}\,dx = 3\ln x\), so \(\mu = e^{3\ln x} = x^3\).
- Multiply through: \(x^3y' + 3x^2y = 4x^4 - 3x^3\), i.e. \(\frac{d}{dx}\!\left[x^3 y\right] = 4x^4 - 3x^3\).
- Integrate: \(x^3 y = \frac{4x^5}{5} - \frac{3x^4}{4} + C\).
- Divide by \(\mu = x^3\): \(y = \frac{4x^2}{5} - \frac{3x}{4} + Cx^{-3}\).
Same method, new numbers: solve \(y' + \frac{4}{x}y = x\) for \(x > 0\). Here \(P(x) = \frac{4}{x}\), so \(\int \frac{4}{x}\,dx = 4\ln x\) and \(\mu = e^{4\ln x} = \) ____. Multiplying through gives \((\mu\,y)' = x\cdot\mu\); integrate and divide by \(\mu\) to finish: \(y = \) ____.
Reveal the answer
\(\mu = e^{4\ln x} = x^4\). Multiplying through: \((x^4 y)' = x\cdot x^4 = x^5\). Integrate: \(x^4 y = \frac{x^6}{6} + C\). Divide by \(x^4\): \(y = \frac{x^2}{6} + Cx^{-4}\). Set k = 4 on the slider above to watch the same collapse happen for \(P(x) = 4/x\) (the demo's right-hand side differs, but μ depends only on P).
More info — the terminal-velocity view of the same method
The method isn't just for \(P(x) = k/x\). A falling object with air resistance satisfies \(v' + 0.196v = 9.8\) with \(v(0) = 48\) — a first-order linear equation with constant \(P(t) = 0.196\). Then \(\mu = e^{\int 0.196\,dt} = e^{0.196t}\), the collapse gives \(\left(e^{0.196t}v\right)' = 9.8\,e^{0.196t}\), and integrating yields \(e^{0.196t}v = 50\,e^{0.196t} + C\), so \(v(t) = 50 + Ce^{-0.196t}\). The initial condition forces \(C = -2\), giving \(v(t) = 50 - 2e^{-0.196t}\): the object approaches a terminal velocity of 50, exactly the equilibrium where \(9.8 - 0.196v = 0\). Follow the full derivation in the Paul's Online Math Notes link under Dive deeper below.
Check your understanding
Find the integrating factor for \(y' + \frac{2}{x}y = x^3\) (for \(x > 0\)).
Multiplying \(y' + P(x)y = Q(x)\) through by \(\mu = e^{\int P\,dx}\) turns the left-hand side into which single expression?
Which of these first-order equations requires the integrating-factor method, because it cannot be solved by separation of variables?
A falling object satisfies \(v' + 0.196v = 9.8\). Multiplying by \(\mu = e^{0.196t}\) and integrating gives \(v(t) = 50 + Ce^{-0.196t}\), and \(v(0) = 48\) forces \(C = -2\). What velocity does the object approach as \(t \to \infty\)?
Recap
- Standard form first: \(y' + P(x)y = Q(x)\), with the \(y'\) coefficient equal to 1.
- The integrating factor is \(\mu = e^{\int P\,dx}\); by construction \(\mu' = \mu P\).
- Multiplying through by \(\mu\) collapses the left side into \((\mu y)'\), so \((\mu y)' = \mu Q\) and \(y = \frac{1}{\mu}\int \mu Q\,dx\).
- Keep the constant of integration; an initial condition pins down \(C\).
- Choose the technique by structure: a product \(f(x)g(y)\) separates; a sum like \(Q(x) - P(x)y\) is linear — use the integrating factor.
Dive deeper
- Linear Differential Equations — Paul's Online Math Notes Follow the integrating-factor derivation and the terminal-velocity example.
- OpenStax Calculus Volume 2, §4.5 First-order Linear Equations Work through the xy' + 3y = 4x^2 - 3x integrating-factor example.
Sources
- First-order linear differential equations and the integrating factor