ordinary differential equations
Method of Undetermined Coefficients
You should know: second order differential equation
Overview
The method of undetermined coefficients solves nonhomogeneous linear ODEs with constant coefficients, ay″ + by′ + cy = g(x), when the forcing term g(x) is one of a small family of 'nice' functions: polynomials, exponentials, sines/cosines, or products of these. The idea is to guess a particular solution yₚ with the same functional form as g(x) but with unknown (undetermined) coefficients, substitute it into the ODE, and solve the resulting algebraic system for those coefficients. Combined with the homogeneous solution y_h found from the characteristic equation, the general solution is y = y_h + yₚ. The method fails when g(x) is not of this restricted form (in which case variation of parameters is used instead), and it requires a modification — multiplying the guess by x — whenever the guessed form already solves the homogeneous equation (resonance).
Intuition
The trick works because differentiating an exponential, polynomial, or sine/cosine returns a function of the same family — differentiating eᵃˣ just rescales it, differentiating a degree-n polynomial gives a lower-degree polynomial, and differentiating sin/cos just swaps the two. So if g(x) belongs to one of these families, a particular solution should too, and plugging the guess (with unknown coefficients) into the ODE reduces to comparing like terms — exactly like the series-substitution idea, but with a finite guess instead of an infinite series. The only subtlety is 'resonance': if the guessed exponential eᵃˣ already solves the homogeneous equation (α is a characteristic root), then plugging it in gives 0 = g(x), a contradiction — the fix is to try xeᵃˣ instead (or x²eᵃˣ for a double root), exactly as the repeated-root case needed an extra factor of x for the homogeneous solution.
Formal Definition
For ay″ + by′ + cy = g(x), the general solution combines the homogeneous solution with a particular solution matched in form to g(x):
Applications
Worked Examples
Solve the homogeneous equation first: characteristic equation r²-3r+2=0 factors as (r-1)(r-2)=0.
The forcing term is e^{3x}; since 3 is not a root of the characteristic equation, try y_p = Ae^{3x} directly (no x needed).
Substitute into the ODE and solve for A.
Answer: y = C₁e^x + C₂e^(2x) + (1/2)e^(3x) (verified by direct substitution and matches computer-algebra solution).
Practice Problems
For y″ - 3y′ + 2y = e^{3x}, verify that y_p = (1/2)e^{3x} satisfies the ODE by direct substitution.
What is the correct trial form for y_p if solving y″ - 4y′ + 4y = e^{2x} (note: r=2 is a REPEATED root of r²-4r+4=0)?
A forced spring-mass system obeys x″ + 4x = 3cos(2t) (the driving frequency 2 matches the natural frequency √4=2, i.e. resonance). Explain qualitatively (without solving fully) what trial form for x_p is needed and what physically happens.
Common Mistakes
Forgetting to check whether the guessed particular-solution form overlaps with the homogeneous solution before solving for coefficients.
Always find y_h first and compare its terms against the proposed y_p; if there is overlap, multiply the trial y_p by x (or a higher power for repeated roots) until no term duplicates y_h.
Using undetermined coefficients on a forcing term like g(x) = tan(x) or g(x) = 1/x.
The method only works for forcing terms in the closed family of polynomials, exponentials, sines, cosines, and their finite sums/products; other g(x) require variation of parameters.
Quiz
Summary
- For ay″+by′+cy=g(x) with g(x) a polynomial, exponential, or sinusoid, guess a particular solution y_p of the same form with undetermined coefficients.
- Substitute y_p into the ODE and match coefficients to solve for the unknowns; the general solution is y = y_h + y_p.
- If the guessed form already solves the homogeneous equation (resonance), multiply the trial solution by x (or xᵏ for a root of multiplicity k) before solving.
- The method fails for forcing terms outside this restricted family, where variation of parameters must be used instead.
References
- BookBoyce, W. & DiPrima, R. Elementary Differential Equations, 11th ed., Ch. 3.
Mathematics