Introduction
A first-order linear differential equation looks like this.
$$y' + P(x)\,y = Q(x)$$Here \(y' = dy/dx\) is the derivative of \(y\), \(P(x)\) is the coefficient attached to \(y\), and \(Q(x)\) is the function on the right-hand side. Many phenomena are written in this form — RC electric circuits (charging a capacitor), changes in drug concentration, population models, and more.
When solving this equation, textbooks say the following.
"Multiply both sides by the integrating factor \(\mu(x) = e^{\int P(x)\,dx}\) and it solves."
When you first hear this, a question arises.
"Why that particular factor? Where did it come from?"
To answer in one sentence first — \(\mu\) is reverse-engineered so that the two terms \(y' + Py\) can be written as a single derivative \((\mu y)'\). Below we derive that process step by step.
The problem: why is direct integration hard?
Let's look at the simplest case.
$$y' + y = 2$$What happens if we integrate both sides with respect to \(x\)?
$$\int y'\,dx + \int y\,dx = \int 2\,dx$$The first term on the left becomes \(y\), but the second term \(\int y\,dx\) contains \(y\) itself, so we cannot evaluate it without knowing the unknown function \(y\).
This is why the "just integrate both sides" approach gets blocked.
If the left-hand side \(y' + y\) were the result of differentiating some function exactly once — then we could find that function and take its antiderivative. Making this idea concrete is the next step.
The key idea: using the product rule in reverse
Recall the product rule you learned in calculus. Differentiating the product of two functions \(\mu(x)\) and \(y(x)\) gives:
$$\frac{d}{dx}[\mu(x)\cdot y(x)] = \mu'(x)\cdot y(x) + \mu(x)\cdot y'(x)$$What condition do we need for the two terms on the right to equal \(\mu(x)\cdot(y' + Py)\)?
$$\mu'\cdot y + \mu\cdot y' = \mu\cdot y' + \mu\cdot P\cdot y$$Canceling \(\mu\cdot y'\) from both sides:
$$\mu' = P\cdot\mu$$As long as this single condition holds, the entire left-hand side bundles into \((\mu y)'\).
$$\mu'= P\mu \;\Longrightarrow\; \frac{d}{dx}[\mu y] = \mu(y' + Py)$$Multiplying both sides of the equation by this \(\mu\):
$$\mu(y' + Py) = \mu Q \;\Longrightarrow\; \frac{d}{dx}[\mu y] = \mu Q$$Now both sides are, respectively, the derivative of \(\mu y\) and the known function \(\mu Q\). Integrating both sides:
$$\mu\cdot y = \int \mu\,Q\,dx$$$$y = \frac{1}{\mu}\int \mu\,Q\,dx$$We can now find the unknown function \(y\) explicitly.
Finding the integrating factor μ
The remaining problem is to find a \(\mu\) that satisfies \(\mu' = P\mu\).
This is also a differential equation, but it is separable, so it solves easily.
$$\frac{d\mu}{\mu} = P\,dx$$Integrating both sides:
$$\ln|\mu| = \int P\,dx$$$$\mu = e^{\int P\,dx}$$This is the integrating factor. It looks like it comes out of nowhere at first, but it is simply "the shape that results from reverse-engineering a function that can turn the left-hand side into a derivative."
Checking with an example: y′ + y = 2, y(0) = 0
Since \(P = 1\) and \(Q = 2\), the integrating factor is:
$$\mu = e^{\int 1\,dx} = e^x$$Multiply both sides by \(e^x\).
$$e^x y' + e^x y = 2e^x$$Let's check whether the left side is in product-rule form.
$$\frac{d}{dx}[e^x y] = e^x y + e^x y' = e^x y' + e^x y \checkmark$$Therefore:
$$\frac{d}{dx}[e^x y] = 2e^x$$Integrate both sides.
$$e^x y = 2e^x + C$$$$y = 2 + Ce^{-x}$$Substituting the initial condition \(y(0) = 0\) gives \(0 = 2 + C\), that is \(C = -2\), so:
$$y = 2 - 2e^{-x}$$Let's verify.
| \(x\) | \(y(x)\) | \(y'(x)\) | \(y' + y\) | Match? |
|---|---|---|---|---|
| 0 | 0 | 2 | 2 | ✓ |
| 1 | ≈ 1.26 | ≈ 0.74 | 2 | ✓ |
| 2 | ≈ 1.73 | ≈ 0.27 | 2 | ✓ |
| 3 | ≈ 1.90 | ≈ 0.10 | 2 | ✓ |
At every \(x\), \(y' + y = 2\) holds.
Try it yourself
In the interactive below, change \(P\), \(Q\), and the initial value \(y(0)\), and move the \(x\) slider. At each \(x\) position, two bars appear — the blue bar is \(\mu' \cdot y\), and the orange bar is \(\mu \cdot y'\). Their sum always equals \(\mu \cdot Q\). This holds no matter which values of \(P\), \(Q\), \(y(0)\), or \(x\) you choose.
If you set \(y(0)\) larger than \(Q/P\) (for example, P=1, Q=2, y(0)=3), then \(y'\) becomes negative and the orange bar points in the opposite direction, but the sum of the two bars still equals \(\mu Q\).
Why a power of e — one-sentence summary
The condition \(\mu' = P\mu\) requires that "a function's derivative is a multiple of itself." The only function with this property is the exponential function.
$$\mu' = P\mu \;\Longrightarrow\; \mu = e^{\int P\,dx}$$The reason Euler's number \(e\) shows up as the integrating factor in a differential equation is that the exponential function is the function that "is its own derivative."
Key takeaways
| Question | Answer |
|---|---|
| Why multiply by something? | To turn the left side \(y'+Py\) into the form \((\mu y)'\) so it can be integrated |
| What is the condition on \(\mu\)? | \(\mu' = P\cdot\mu\) — only then is \((\mu y)' = \mu(y'+Py)\) |
| How do we find \(\mu\)? | Separation of variables → \(\mu = e^{\int P\,dx}\) |
| What's the strategy after multiplying? | \((\mu y)' = \mu Q\) → integrate → \(\mu y = \int\mu Q\,dx\) → \(y = (1/\mu)\int\mu Q\,dx\) |
| Why a power of e? | The only function whose derivative is a multiple of itself is the exponential function |
Studying this with AI
You can ask AI about the integrating factor method step by step.
Useful example questions:
- "Solve \(y' + 2y = 4\) using the integrating factor method. Explain why we do each step."
- "How does the integrating factor change when \(P(x)\) is not constant, like \(P(x) = 1/x\)?"
- "Show me how the left-hand side changes before and after multiplying by \(e^{\int P\,dx}\)."
Wrapping up
The integrating factor is not a formula handed to you out of nowhere. Starting from the goal "I want to turn the left side into a derivative," and applying the product rule in reverse to derive the required condition \(\mu' = P\mu\), the form \(e^{\int P\,dx}\) emerges naturally. If you trace this derivation by hand once before memorizing the formula, you'll see that more complex differential-equation techniques are built on the same logic.
Related reading — Read first: Why Is the Chain Rule a "Multiplication" · Why Is Integration the Reverse of Differentiation → Up next: What Exactly Are the du and dv in Integration by Parts · Solve it yourself: Wolfram Alpha · Desmos