Mathematics.

ordinary differential equations

Method of Undetermined Coefficients

Differential Equations30 minDifficulty6 out of 10

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

Definition

For ay″ + by′ + cy = g(x), the general solution combines the homogeneous solution with a particular solution matched in form to g(x):

y=yh+ypy = y_h + y_p
General solution: homogeneous plus particular
ayh+byh+cyh=0ay_h'' + by_h' + cy_h = 0
y_h solves the associated homogeneous equation
ayp+byp+cyp=g(x)ay_p'' + by_p' + cy_p = g(x)
y_p is a specific solution matching the forcing term
g(x)=eαx    try yp=xs(Aeαx),s=multiplicity of α as a characteristic rootg(x) = e^{\alpha x} \implies \text{try } y_p = x^s(A e^{\alpha x}),\quad s = \text{multiplicity of } \alpha \text{ as a characteristic root}
Exponential forcing; s is the resonance-correction exponent

Applications

Forced mechanical vibration mx″ + cx′ + kx = F₀cos(ωt) and forced RLC circuits are solved by guessing a particular solution of the same sinusoidal form as the forcing term, revealing resonance when the driving frequency ω matches the system's natural frequency.

Worked Examples

  1. Solve the homogeneous equation first: characteristic equation r²-3r+2=0 factors as (r-1)(r-2)=0.

    r1=1, r2=2    yh=C1ex+C2e2xr_1=1,\ r_2=2 \implies y_h = C_1e^x + C_2e^{2x}
  2. 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).

    yp=Ae3x    yp=3Ae3x, yp=9Ae3xy_p = Ae^{3x} \implies y_p' = 3Ae^{3x},\ y_p'' = 9Ae^{3x}
  3. Substitute into the ODE and solve for A.

    9Ae3x3(3Ae3x)+2Ae3x=e3x    2Ae3x=e3x    A=129Ae^{3x} - 3(3Ae^{3x}) + 2Ae^{3x} = e^{3x} \implies 2Ae^{3x} = e^{3x} \implies A = \tfrac{1}{2}

Answer: y = C₁e^x + C₂e^(2x) + (1/2)e^(3x) (verified by direct substitution and matches computer-algebra solution).

Practice Problems

Difficulty 5/10

For y″ - 3y′ + 2y = e^{3x}, verify that y_p = (1/2)e^{3x} satisfies the ODE by direct substitution.

Difficulty 6/10

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)?

Difficulty 7/10

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

Common Mistake

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.

Common Mistake

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

The method of undetermined coefficients applies when the forcing term g(x) is:
If the guessed particular solution's exponential rate matches a root of the characteristic equation, you must:
In solving y″-3y′+2y=e^x, why does the plain guess y_p=Ae^x fail?

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

  1. BookBoyce, W. & DiPrima, R. Elementary Differential Equations, 11th ed., Ch. 3.