Nonhomogeneous Equations: Undetermined Coefficients
Solve ay″ + by′ + cy = g(t) by adding a particular solution to the homogeneous one, guess its form from g(t), and fix guesses that collide with resonance.
Welcome back!
Step 1 of 12Learn
Homogeneous plus particular
Now add a forcing term: a·y″ + b·y′ + c·y = g(t). This is a nonhomogeneous equation. A push on a spring, a voltage source in a circuit and a seasonal input to a population all appear as g(t).
The structure of the solution is the key fact:
y = y_h + y_p
- y_h is the general solution of the homogeneous equation (with g replaced by 0), which you already know how to find. It contains the two arbitrary constants.
- y_p is any one particular solution of the full equation. No constants needed.
Why does this work? If y_p is one solution, and y is any other, then y − y_p satisfies the homogeneous equation, because the forcing cancels. So every solution is y_p plus something from the homogeneous family.
Example. y″ + 3y′ + 2y = 10e^(3t).
- Homogeneous part. r2 + 3r + 2 = (r + 1)(r + 2), so y_h = C₁e^(−t) + C₂e^(−2t).
- Particular part. The forcing is an exponential, so guess y_p = Ae^(3t). Then y_p′ = 3Ae^(3t) and y_p″ = 9Ae^(3t). Substituting: 9A + 9A + 2A = 20A = 10, so A = ½.
- Full solution. y = C₁e^(−t) + C₂e^(−2t) + ½e^(3t).
Only now do you apply initial conditions, to the full solution. A common mistake is fitting initial conditions to y_h before adding y_p.
Step 2 of 12Diagram
The road map for a nonhomogeneous equation
Two separate problems, combined at the end. Tap each step.
Tap a shape with to see more.
- Solve the homogeneous part
Set g(t) = 0 and use the characteristic equation: y_h contains C₁ and C₂.
- Guess y_p from g(t)
Same family as the forcing, with unknown coefficients.
- Substitute, match coefficients
Solve the resulting linear equations for A, B, ….
- y = y_h + y_p
The general solution of the full equation.
- Apply initial conditions last
Only now solve for C₁ and C₂.
Step 3 of 12Learn
Choosing the guess
The method of undetermined coefficients works when g(t) is a polynomial, an exponential, a sine or cosine, or a sum or product of these. The guess has the same form as g, with unknown coefficients:
| Forcing g(t) | Guess for y_p |
|---|---|
| Constant k | A |
| Polynomial of degree n | A_ntn + … + A₁t + A₀ (all powers) |
| e^(kt) | Ae^(kt) |
| sin(ωt) or cos(ωt) | A cos(ωt) + B sin(ωt) (both!) |
| e^(kt)·cos(ωt) | e^(kt)(A cos ωt + B sin ωt) |
| t·e^(kt) | (At + B)e^(kt) |
Example: polynomial forcing. y″ − 3y′ + 2y = 4t. Guess y_p = At + B. Then y_p′ = A and y_p″ = 0, so −3A + 2(At + B) = 4t. Matching coefficients: t-terms give 2A = 4, so A = 2; constants give −3A + 2B = 0, so B = 3. So y_p = 2t + 3.
Example: trig forcing. y″ + 4y = 3 sin t. Guess y_p = A cos t + B sin t. Then y_p″ = −A cos t − B sin t, and y_p″ + 4y_p = 3A cos t + 3B sin t = 3 sin t. So A = 0 and B = 1: y_p = sin t.
Why include both sine and cosine? Derivatives turn sines into cosines. If there's a y′ term, a pure sine guess generates cosine terms that nothing can cancel.
Sums of forcings. For g = g₁ + g₂, find particular solutions for each separately and add them. That's superposition again.
Step 4 of 12Practice · Work it out
Find the particular solution of y″ + 2y′ + 5y = 15 (a constant forcing). What constant A works?
Step 5 of 12Practice · Sort into groups
Choose the correct initial guess for y_p (before checking for overlap with y_h).
Tap an item, then tap its group (or drag it there).
Step 6 of 12Compare
Forcing term and first guess for y_p
| Aspect | Forcing g(t) | First guess y_p |
|---|---|---|
| Constant | 5 | A |
| Polynomial | 3t2 − 1 | At2 + Bt + C (all lower powers too) |
| Exponential | 4e^(2t) | Ae^(2t) |
| Sine or cosine | 5 sin 3t | A cos 3t + B sin 3t (both) |
| Product | t·e^(t) | (At + B)e^(t) |
| Overlap with y_h | Guess already solves the homogeneous equation | Multiply the guess by t (or t2) |
Step 7 of 12Learn
When the guess fails: resonance
Try y″ + 4y = cos 2t. The natural guess is A cos 2t + B sin 2t. But those functions solve the homogeneous equation y″ + 4y = 0. Substituting gives 0 = cos 2t, a contradiction. The guess is already "used up" by y_h.
The modification rule: if any term of your guess solves the homogeneous equation, multiply the guess by t. If it still overlaps (which happens with repeated roots), multiply by t again.
So guess y_p = t(A cos 2t + B sin 2t). After differentiating twice and substituting, everything except the new terms cancels, leaving −4A sin 2t + 4B cos 2t = cos 2t. So A = 0 and B = ¼:
y_p = (t/4)·sin 2t
That t in front means the amplitude grows linearly forever. Forcing a system at exactly its natural frequency, with no damping, produces resonance: each push arrives in step with the motion and adds energy. You'll see the physics in the next module.
Example with exponentials. y″ − 3y′ + 2y = et. The roots of r2 − 3r + 2 are 1 and 2, so et is in y_h. Guess y_p = Atet. Substituting gives −A et = et, so A = −1 and y_p = −tet.
Beyond this method. For forcings like tan t or 1/t, guesses don't work. The general technique is variation of parameters, which builds y_p from y_h with integrals, and works for any continuous g.
Step 8 of 12Chart
Resonance: y_p = (t/4)·sin 2t
Forcing y″ + 4y = cos 2t exactly at the natural frequency adds energy every cycle. The peaks (sampled here) grow along the envelope t/4 without bound.
| t | y_p at successive peaks | Envelope t/4 |
|---|---|---|
| 0.8 | 0.2 | 0.2 |
| 2.4 | -0.59 | 0.59 |
| 3.9 | 0.98 | 0.98 |
| 5.5 | -1.37 | 1.37 |
| 7.1 | 1.77 | 1.77 |
| 8.6 | -2.16 | 2.16 |
| 10.2 | 2.55 | 2.55 |
Step 9 of 12Practice · Work it out
For y″ − y′ − 6y = 5e^(3t), the homogeneous roots are 3 and −2. Using the guess y_p = Ate^(3t), what is A?
Step 10 of 12Note
Step 11 of 12Practice · Spot the mistake
A student solves y″ + y = 2t. Find the step that contains the error.
Step 12 of 12Practice · Choose one
Which is the correct form of the particular solution guess for y″ + 9y = sin 3t?
Lesson complete!