What the formula says
y′ + ay = f(x)
Holds when a is a constant and f is continuous on an interval.
A first-order linear differential equation with a constant coefficient a. First-order because only
y′ appears, linear because y and y′ appear on their own, never squared or inside a function. f(x) is
any function of x. With f(x) = 0 it is y′ = ky
with k = −a.
The method is the integrating factor e^(ax). Multiply both sides by it:
e^(ax)y′ + a·e^(ax)y = e^(ax)f(x)
The left side is now what the product rule gives for (e^(ax)·y)′. So
(e^(ax)·y)′ = e^(ax)f(x), e^(ax)·y = ∫ e^(ax)f(x) dx + C, y = e^(−ax)(∫ e^(ax)f(x) dx + C)
Worked example
Solve y′ + 2y = 4x with y(0) = 2.
- The integrating factor is e^(2x). Multiplied through: (e^(2x)y)′ = 4x·e^(2x).
- Integrate (by parts): e^(2x)y = 2x·e^(2x) − e^(2x) + C.
- Divide by e^(2x): y = 2x − 1 + C·e^(−2x).
- The condition: y(0) = −1 + C = 2, so C = 3, and y = 2x − 1 + 3e^(−2x).
Check: y′ = 2 − 6e^(−2x), and y′ + 2y = 2 − 6e^(−2x) + 4x − 2 + 6e^(−2x) = 4x. Right.
The C that has to be divided too
A common mistake is in step 3. The constant was added before dividing by e^(2x), so it is divided as well: C·e^(−2x), not C. Writing y = 2x − 1 + C looks like a family of solutions and is not one — y′ + 2y then comes to 4x + 2C, which is 4x only when C = 0.
A second example: cooling
Coffee at 90 °C in a 20 °C room cools by Newton’s law, T′ = −0.1(T − 20), with t in minutes. Written in the standard form: T′ + 0.1T = 2.
The integrating factor e^(0.1t) gives (e^(0.1t)T)′ = 2e^(0.1t), so e^(0.1t)T = 20e^(0.1t) + C and T = 20 + C·e^(−0.1t). With T(0) = 90, C = 70. After 10 minutes: T = 20 + 70e^(−1) ≈ 45.8 °C.
The constant right-hand side gives a constant particular solution, T = 20, the temperature the coffee approaches.
The other route: homogeneous plus particular
Upper-secondary courses often solve the same equation without the integrating factor: the general solution is the solution of y′ + ay = 0, which is C·e^(−ax), plus one solution of the full equation, found by guessing its form.
| f(x) | Guess for the particular solution |
|---|---|
| a constant | y = A |
| a polynomial of degree n | a polynomial of degree n |
| e^(bx), b ≠ −a | y = A·e^(bx) |
| sin bx or cos bx | y = A sin bx + B cos bx |
For y′ + 2y = 4x, guess y = Ax + B: A + 2(Ax + B) = 4x gives A = 2 and B = −1, and with the homogeneous part, y = 2x − 1 + C·e^(−2x) — the same answer as above.
When a depends on x
y′ + a(x)·y = f(x) is solved the same way, with the factor e^(∫a(x) dx) in place of e^(ax). The product rule still turns the left side into (e^(∫a dx)·y)′.
Common mistakes
- A constant that is not divided. y = e^(−ax)∫ … + C is wrong; the C is inside the bracket.
- The wrong sign in the factor. For y′ + ay the factor is e^(+ax). For y′ − ay it is e^(−ax).
- Not in standard form. 2y′ + 6y = 4 has to be divided by 2 first: y′ + 3y = 2, factor e^(3x).
- Forgetting the initial condition. Without it the answer is a family of functions, not one.
Common questions
Why does the integrating factor work?
Because the derivative of e^(ax) is a·e^(ax). Multiplying y′ + ay by e^(ax) produces exactly the two
terms the product rule gives for (e^(ax)y)′, so the left side becomes a single derivative and can be
integrated.
Integrating factor or guessing — which should I use?
Guessing is quicker when f(x) is a polynomial, an exponential or a sine, and it is the method many
upper-secondary courses teach. The integrating factor works for any f(x) whose integral you can find,
and for a coefficient that varies with x.