A single clever function μ(x) (multiplied onto both sides of your ODE) transforms a messy equation into a perfect derivative. One elegant idea that solves an entire class of first-order equations.
§ 01The Problem — Why Separation Isn't Always Enough
Separable equations let you move all the y terms to one side and all the x terms to the other. But what happens when y appears mixed with a function of x in a way that cannot be separated?
Consider the equation dy/dx + 2xy = x. You cannot write this as f(y) dy = g(x) dx because the term 2xy mixes x and y inseparably. This equation belongs to the class of first-order linear ODEs: the most important and most common class of first-order differential equations in applications.
The standard form of a first-order linear ODE is:
Standard Form — First-Order Linear ODE
dy/dx + P(x)·y = Q(x)
Here P(x) and Q(x) are any continuous functions of x. When Q(x) = 0 the equation is called homogeneous and can be solved by separating variables directly. The interesting, and harder, case is when Q(x) ≠ 0, which is called the non-homogeneous case. The integrating factor is the key to unlocking it.
What makes an ODE "linear"?
A first-order ODE is linear if y and dy/dx each appear to the first power, with no products like y·(dy/dx) or powers like y². The coefficients of y and dy/dx can be any functions of x. Examples of linear ODEs: dy/dx + 3y = ex, dy/dx − (sin x)y = x². Non-linear counter-example: dy/dx + y² = x (the y² makes it non-linear).
Real-World Motivation: Newton's Law of Cooling
When a cup of coffee cools in a room held at temperature Troom = 20°C, Newton's Law of Cooling gives the ODE:
Newton's Law of Cooling
dT/dt + k·T = k·Troom
Here T is the temperature at time t, and k > 0 is a cooling constant. This is a first-order linear ODE in standard form with P(t) = k and Q(t) = k·Troom. The integrating factor method solves it in four clean steps: and we will come back to this example later.
§ 02Derivation — Where Does μ(x) = e∫P dx Come From?
The integrating factor is not a magic trick: it falls out of one simple idea: the product rule for differentiation, run in reverse.
Start with the standard form equation:
Step 0 — Start here
dy/dx + P(x)·y = Q(x)
Now ask: is there a function μ(x) such that, when we multiply both sides by μ(x), the left-hand side becomes a perfect derivative of the form d/dx[μ(x)·y]? That would let us integrate both sides immediately.
Expand d/dx[μ·y] using the product rule:
Product Rule Expansion
d/dx[μ·y] = μ·(dy/dx) + (dμ/dx)·y
Now multiply the original ODE through by μ:
Multiply through by μ
μ·(dy/dx) + μ·P(x)·y = μ·Q(x)
Comparing the two boxed expressions: the left-hand sides match if and only if dμ/dx = μ·P(x). This is a separable ODE for μ itself:
ODE for the integrating factor
dμ/dx = μ·P(x)
(1/μ) dμ = P(x) dx
∫(1/μ) dμ = ∫P(x) dx
ln|μ| = ∫P(x) dx
μ(x) = e∫P(x) dx
We drop the constant of integration here because any particular μ will do, adding a constant would just scale μ, which cancels out when we divide at the end.
With this choice of μ, the left-hand side of the multiplied equation is exactly d/dx[μ·y], and so:
The key collapse
d/dx[μ(x)·y] = μ(x)·Q(x)
μ(x)·y = ∫μ(x)·Q(x) dx
y = (1/μ(x)) · ∫μ(x)·Q(x) dx
This single formula contains the entire method. Everything that follows is an application of these four algebraic moves: compute μ, multiply through, integrate, divide by μ.
Why e∫P dx and not something simpler?
The exponential function is the only function whose derivative is proportional to itself: d/dx[ef] = f′·ef. This is precisely the property that makes dμ/dx = μ·P(x) solvable with a clean exponential answer. The product rule and the exponential function are tailor-made for each other.
§ 03The 5-Step Strategy
Every first-order linear ODE can be solved by the same five moves, in the same order, every time.
Integrating Factor — 5-Step Method
1
Write in standard form
Rearrange so the equation reads dy/dx + P(x)·y = Q(x). Divide through by any coefficient on dy/dx if necessary. Identify P(x) and Q(x) explicitly before doing anything else.
2
Compute the integrating factor
Calculate μ(x) = e∫P(x) dx. You only need one antiderivative of P — omit the +C. Simplify μ as much as possible (e.g. eln x = x).
3
Multiply both sides by μ(x)
The left-hand side must now equal d/dx[μ·y]. Always verify this by expanding the product rule — it confirms you have the right μ before proceeding.
4
Integrate both sides with respect to x
The left side integrates to μ(x)·y. The right side gives ∫μ(x)·Q(x) dx + C. Include the constant of integration C — you need it for the general solution.
5
Solve for y; apply initial condition if given
Divide both sides by μ(x) to isolate y. If an initial condition y(x0) = y0 is given, substitute to find the numerical value of C.
§ 04Worked Examples
Ten fully solved problems, escalating from constant coefficients to variable P(x), IVPs, and applications.
Example 1Constant P(x) — simplest case
Solve: dy/dx + 3y = 6
Step 1 — Standard form
P(x) = 3, Q(x) = 6
Step 2 — Integrating factor
μ = e∫3 dx = e3x
Step 3 — Multiply through
e3x(dy/dx) + 3e3x·y = 6e3xd/dx[e3x·y] = 6e3x
Step 4 — Integrate
e3x·y = ∫6e3x dx = 2e3x + C
Step 5 — Solve for y
y = 2 + Ce−3x
y = 2 + Ce−3x
As x → ∞, the Ce−3x term decays to zero, so y → 2. The particular solution y = 2 is the steady state.
Example 2Constant P(x) with IVP
Solve the IVP: dy/dx − 2y = 4ex, y(0) = 1
Standard form
P(x) = −2, Q(x) = 4ex
Integrating factor
μ = e∫(−2) dx = e−2x
Multiply and collapse
d/dx[e−2x·y] = 4ex·e−2x = 4e−x
Integrate
e−2x·y = ∫4e−x dx = −4e−x + C
Solve for y
y = −4ex + Ce2x
Apply y(0) = 1
1 = −4 + C → C = 5
y = −4ex + 5e2x
Example 3Variable P(x) = 1/x — factor simplifies to x
Solve: x(dy/dx) + y = x3 (for x > 0)
Divide by x to reach standard form
dy/dx + (1/x)·y = x2P(x) = 1/x, Q(x) = x2
Integrating factor
μ = e∫(1/x) dx = eln x = x
Multiply and collapse
d/dx[x·y] = x·x2 = x3
Integrate
x·y = ∫x3 dx = x4/4 + C
Solve for y
y = x3/4 + C/x
y = x3/4 + C/x
Notice how μ = x cleaned up the left side instantly. Whenever P(x) = n/x, the integrating factor is xn.
Example 4P(x) = 2x — factor is ex²
Solve: dy/dx + 2xy = 2x
Standard form: P(x) = 2x, Q(x) = 2x
Integrating factor
μ = e∫2x dx = ex²
Multiply and collapse
d/dx[ex²·y] = 2x·ex²
Integrate (recognise 2x·ex² as d/dx[ex²])
ex²·y = ∫2x·ex² dx = ex² + C
Solve for y
y = 1 + Ce−x²
y = 1 + Ce−x²
Example 5P(x) = tan x — factor involves sec x
Solve: dy/dx + (tan x)·y = cos x
P(x) = tan x, Q(x) = cos x
Integrating factor
μ = e∫tan x dx = e−ln|cos x| = eln|sec x| = sec x
Using ∫tan x dx = −ln|cos x| = ln|sec x|.
Multiply and collapse
d/dx[sec x · y] = sec x · cos x = 1
Integrate
sec x · y = x + C
Solve for y
y = (x + C) cos x
y = (x + C) cos x
Example 6Must divide first — coefficient ≠ 1 on dy/dx
y/x² = ∫sin x dx = −cos x + Cy = x²(−cos x + C) = −x²cos x + Cx²
Apply y(π) = 0
0 = −π²cos π + Cπ² = π² + Cπ² → C = −1
y = −x²cos x − x² = −x²(cos x + 1)
§ 05Quick Reference — Common Integrating Factors
These patterns cover the majority of exam questions. Recognise the form of P(x) and write down μ immediately.
P(x) in dy/dx + P(x)y = Q(x)
∫P(x) dx
μ(x) = e∫P dx
Simplification used
k (constant)
kx
ekx
—
1/x
ln x
eln x = x
eln f = f
n/x
n ln x
xn
en ln x = xn
2x
x²
ex²
—
tan x
−ln|cos x|
sec x
e−ln|cos x| = 1/|cos x|
2x/(1+x²)
ln(1+x²)
1 + x²
eln f = f
−1/x
−ln x
1/x
e−ln x = 1/x
cot x
ln|sin x|
sin x
eln|sin x| = |sin x|
The exponential simplification rule
The most important simplification: whenever your integral ∫P(x) dx produces a logarithm, write eln(f(x)) = f(x) immediately. This turns abstract exponentials into recognisable functions and makes the subsequent integration far easier.
§ 06Common Mistakes
⚠ Not dividing through first — coefficient on dy/dx ≠ 1
If the equation is 2(dy/dx) + 6y = 4, then P(x) = 3, not 6. Always divide every term by the coefficient of dy/dx before reading off P(x). If you skip this step μ will be wrong and the left side will not collapse to a perfect derivative.
⚠ Dropping the constant of integration
When you integrate both sides in Step 4, the right side produces a +C. This constant is essential — it generates the full family of solutions. Without it, you only have a particular solution, not the general solution. The constant gets determined by an initial condition if one is given.
⚠ Adding +C when computing the integrating factor
Conversely, when computing μ = e∫P dx, do NOT include the +C. Any particular antiderivative of P works. Adding a constant would give μ = e∫P dx + C = eC · e∫P dx, and since eC is just another constant that factors out harmlessly, it is convention to set it to 1.
⚠ Forgetting to multiply Q(x) by μ
After multiplying the left side by μ(x), the right side must also be multiplied by μ(x). The new right side is μ(x)·Q(x), not Q(x) alone. Then the integral you compute is ∫μ(x)·Q(x) dx, which may be more complex than ∫Q(x) dx.
⚠ Treating the method as a formula to memorise, not a process
The formula y = (1/μ)∫μQ dx is a useful shortcut once you understand why it works, but relying on it without understanding the five steps leads to errors with harder equations. Work through the steps explicitly — write d/dx[μy] on the left side — until the method feels natural.
§ 07Practice Quiz — 10 Questions
Find integrating factors, identify standard forms, compute solutions, and apply initial conditions.
Score: 0 / 0
Question 1 — Standard Form
Which of the following is a first-order linear ODE in standard form?
Question 2 — Integrating Factor
For dy/dx + 5y = ex, the integrating factor is μ = ekx. What is k?
P(x) = 5. Compute μ = e∫5 dx.
Question 3 — Factor Simplification
For the ODE dy/dx + (3/x)y = x², what is the integrating factor?
P(x) = 3/x, so ∫P dx = 3 ln x
μ = e3 ln x = eln(x³) = x³
Question 4 — Steady State
The general solution to dy/dx + 4y = 8 is y = A + Ce−4x. What is the steady-state value A (i.e. the value as x → ∞)?
Solve using the integrating factor method: μ = e4x. Alternatively, set dy/dx = 0 in the original ODE to find the equilibrium.
Question 5 — Process
After multiplying dy/dx + P(x)y = Q(x) through by integrating factor μ(x), what does the left-hand side always equal?
Question 6 — IVP Constant
Solve dy/dx + 2y = 0 with y(0) = 5. The solution is y = Ce−2x. What is C?
Question 7 — Identify P(x)
For the ODE 3(dy/dx) + 9y = 12x, what is P(x) after writing in standard form?
Divide every term by 3: dy/dx + 3y = 4x
P(x) = 3, Q(x) = 4x
Question 8 — Evaluate Solution
The solution to dy/dx + y = ex with y(0) = 0 is y = (ex/2)(ex − 1)·e−x... actually y = (ex − e−x)/2. Evaluate y(0).
μ = ex, so d/dx[exy] = ex·ex = e2x
exy = e2x/2 + C → y = ex/2 + Ce−x
y(0) = 0: 0 = 1/2 + C → C = −1/2
y = ex/2 − e−x/2 = (ex − e−x)/2 = sinh x
y(0) = (1 − 1)/2 = 0 ✓
Question 9 — Physical Application
Newton's Law of Cooling gives dT/dt + kT = kT∞. The integrating factor for this ODE (treating t as the variable) is:
Question 10 — Full Solve
Solve the IVP: x(dy/dx) + 2y = 4x², y(1) = 2. The solution has the form y = x² + C/x². What is C?
Divide by x first: dy/dx + (2/x)y = 4x. Then μ = x². After solving, apply y(1) = 2.
Standard form: dy/dx + (2/x)y = 4x → P(x) = 2/x
μ = e∫(2/x)dx = e2 ln x = x²
d/dx[x²y] = 4x·x² = 4x³
x²y = ∫4x³ dx = x⁴ + C
y = x² + C/x²
y(1) = 2: 2 = 1 + C → C = 1
Solution: y = x² + 1/x²
§ 08What to Study Next
The integrating factor method solves first-order linear ODEs completely. The natural next steps take you to harder classes of equations:
Second-Order Linear ODEs, the characteristic equation handles constant-coefficient second-order equations.
Undetermined Coefficients: finding particular solutions to non-homogeneous second-order ODEs when the forcing term is a polynomial, exponential, or sinusoid.
Laplace Transforms: a powerful algebraic approach to ODEs, especially useful for discontinuous forcing functions.