§ 01The Non-Homogeneous Problem
In the previous topic we solved ay'' + by' + cy = 0, the homogeneous equation. Now we add a forcing function g(x) on the right and ask: what particular function y satisfies the full equation?
The method of undetermined coefficients applies when g(x) is one of the following types, or a sum or product of them:
- A polynomial: g(x) = xⁿ + … (any degree)
- An exponential: g(x) = eᵅˣ
- A sine or cosine: g(x) = sin(βx) or cos(βx)
- Any product of the above: g(x) = x²e³ˣ, eˣ sin(2x), etc.
If g(x) is something else (like ln x, tan x, or 1/x) the method does not apply and you must use variation of parameters instead.
§ 02Superposition: y = yh + yp
The complete general solution to the non-homogeneous equation is the sum of two parts: the homogeneous solution and a particular solution. This is the superposition principle.
Contains C₁, C₂
No arbitrary constants
Why does this work? If yh satisfies the homogeneous equation and yp satisfies the full non-homogeneous equation, then substituting y = yh + yp into the left-hand side gives:
The arbitrary constants C₁ and C₂ live entirely in yh. The particular solution yp has no free constants, it is a single, specific function. Initial conditions are applied to the complete solution y = yh + yp at the end.
- Solve the homogeneous equation ay''+by'+cy = 0 using the characteristic equation. Write down yh.
- Identify the form of g(x) and choose the appropriate trial particular solution yp from the table in § 03.
- Check for overlap between yp and yh. If any term of the trial yp appears in yh, apply the modification rule (multiply by x, or x² if needed).
- Substitute the trial yp (and its derivatives) into the full ODE. Collect like terms and solve for the undetermined coefficients.
- Write the complete general solution y = yh + yp, then apply initial conditions if given.
§ 03The Trial Solution Table
The trial particular solution yp must be chosen to match the family of functions that g(x) belongs to. This means including all members of that family, not just the exact terms that appear.
| Forcing Function g(x) | Trial Particular Solution yp | Notes |
|---|---|---|
| c (constant) | A | Single undetermined constant |
| bx + c (degree 1) | Ax + B | Include all terms down to degree 0 |
| ax² + bx + c (degree 2) | Ax² + Bx + C | Full quadratic — all three terms required |
| Pₙ(x) (degree n poly) | Aₙxⁿ + … + A₁x + A₀ | n+1 undetermined coefficients |
| eαx | Aeαx | One constant; α must not be a root of char. eq. |
| sin(βx) or cos(βx) | A cos(βx) + B sin(βx) | Always include BOTH sin and cos, even if g has only one |
| eαx sin(βx) or eαx cos(βx) | eαx(A cos βx + B sin βx) | Exponential envelope × both trig terms |
| Pₙ(x)·eαx | (Aₙxⁿ+…+A₀)eαx | Polynomial of same degree × exponential |
| Pₙ(x)·sin(βx) or Pₙ(x)·cos(βx) |
(Aₙxⁿ+…+A₀)cos βx + (Bₙxⁿ+…+B₀)sin βx | Two full polynomials — one for cos, one for sin |
§ 04Polynomial Forcing
When g(x) is a polynomial, the trial solution is a polynomial of the same degree. Substitute and match coefficients of equal powers of x.
Solve: y'' + 3y' + 2y = 10.
Find a particular solution of y'' − y = x² − 1.
x²: −A = 1 → A = −1
x¹: −B = 0 → B = 0
x⁰: 2A − C = −1 → −2 − C = −1 → C = −1
Solve: y'' + y' = 2x + 3, y(0) = 1, y'(0) = 0.
x¹: 2A = 2 → A = 1
x⁰: 2A + B = 3 → 2 + B = 3 → B = 1
Apply y(0)=1: C₁ + C₂ = 1.
y' = −C₂e−x + 2x + 1. Apply y'(0)=0: −C₂ + 1 = 0 → C₂ = 1 → C₁ = 0.
§ 05Exponential Forcing
When g(x) = Keαx, try yp = Aeαx, unless α is a root of the characteristic equation, in which case the modification rule applies.
Solve: y'' − 3y' + 2y = 4e3x.
Solve: y'' − 3y' + 2y = 5ex.
yp' = Aex + Axex = A(1+x)ex
yp'' = Aex + A(1+x)ex = A(2+x)ex
Find a particular solution of y'' − 2y' + y = ex.
yp' = (2Ax + Ax²)ex = Ax(2+x)ex
yp'' = A(2+x)ex + Ax(2+x)ex + Axex = A(2 + 4x + x²)ex
§ 06Trigonometric Forcing
When g(x) involves sin(βx) or cos(βx), the trial solution must include both A cos(βx) and B sin(βx), because differentiation converts one into the other. Never use only one of the pair.
Find a particular solution of y'' + 4y = 3 sin(x).
Find a particular solution of y'' + 4y = 3 cos(2x).
yp' = (A cos 2x + B sin 2x) + x(−2A sin 2x + 2B cos 2x)
yp'' = (−2A sin 2x + 2B cos 2x) + (−2A sin 2x + 2B cos 2x) + x(−4A cos 2x − 4B sin 2x)
yp'' = (−4A sin 2x + 4B cos 2x) − 4x(A cos 2x + B sin 2x)
§ 07Combined and Product Forcing
When g(x) is a sum of terms, the particular solution is the sum of the particular solutions for each term separately. When g(x) is a product (like eαx sin βx), treat the whole product as one unit.
Find a particular solution of y'' + y' − 2y = 2ex + 3.
Derivatives: yp1' = A(1+x)eˣ, yp1'' = A(2+x)eˣ.
Substitute: A(2+x)eˣ + A(1+x)eˣ − 2Axeˣ = 2eˣ → A(3)eˣ = 2eˣ → A = 2/3.
Find a particular solution of y'' + 2y' + 2y = e−x cos(x).
yp' = e−x[(A+B)cos x + (B−A)sin x] + xe−x[(B−A)cos x − (A+B)sin x]
Find a particular solution of y'' − y' = 2xex.
yp' = (2Ax + B)eˣ + (Ax²+Bx)eˣ = (Ax² + (2A+B)x + B)eˣ
yp'' = (Ax² + (4A+B)x + (2A+2B))eˣ
Solve: y'' − 2y' + y = eˣ + 4, y(0) = 2, y'(0) = 3.
Apply y'(0) = 3: C₂ + C₁ + 0 + 0 = 3 → C₂ + (−2) = 3 → C₂ = 5.
§ 08The Modification Rule — Full Summary
The modification rule is the single most important subtlety in the method of undetermined coefficients. Master it and you can handle every case.
| Situation | Action | Example |
|---|---|---|
| No overlap between trial yp and yh | Use trial as-is | g=e³ˣ, roots 1,2 → yp=Ae³ˣ |
| Trial overlaps yh (simple root) | Multiply trial by x | g=eˣ, root 1 → yp=Axeˣ |
| Trial overlaps yh after ×x (double root) | Multiply original trial by x² | g=eˣ, double root 1 → yp=Ax²eˣ |
| Trig trial overlaps (resonance) | Multiply trig trial by x | g=cos 2x, yh has cos 2x → yp=x(Acos 2x+Bsin 2x) |
| Polynomial trial overlaps (root r=0) | Multiply polynomial trial by x | g=3x, r=0 is root → yp=x(Ax+B)=Ax²+Bx |
§ 09Common Mistakes
§ 1010-Question Quiz
Test every aspect of the method, trial selection, modification rule, coefficient matching, and complete solutions.
For y'' + 3y' + 2y = 5x², what is the correct trial particular solution?
For y'' + y' − 6y = 4e2x, the homogeneous solution is yh = C₁e2x + C₂e−3x. Which trial particular solution should be used?
For y'' + 9y = 4 cos(3x), the homogeneous solution is yh = C₁cos(3x) + C₂sin(3x). What is the correct trial yp?
After substituting yp = Ae5x into y'' − 4y' + 3y = 2e5x, which expression do you solve for A?
For y'' − y = 6 with trial yp = A, substituting gives −A = 6. Therefore A = .
The general solution to a non-homogeneous ODE is y = yh + yp. Where should initial conditions be applied?
For y'' + y = sin(x), the homogeneous solution is yh = C₁cos x + C₂sin x. Which trial is correct?
For which type of forcing function does the method of undetermined coefficients NOT apply?
For y'' − y' = 4 (with root r = 0 in yh), the constant trial yp = A would overlap yh. What is the correct modified trial?
For y'' + 4y' + 4y = e−2x, the homogeneous solution is yh=(C₁+C₂x)e−2x (double root r=−2). The modified trial is yp=Ax²e−2x. After substitution, you find 2A = 1, so A = .
Continue in Differential Equations
Undetermined coefficients handles a wide range of forcing functions, but for cases it cannot handle, and for a deeper theoretical understanding, explore these topics next: