The method of undetermined coefficients finds a particular solution of a nonhomogeneous linear ODE by guessing its form (with unknown coefficients) and solving for the coefficients algebraically. Only works when the forcing function has a nice structural form — polynomials, exponentials, sines/cosines, or products of these.
For a nonhomogeneous ODE :
- Solve the homogeneous part for (via Characteristic equation).
- Guess based on (using a guess table — see below).
- If the guess overlaps with , multiply by until it doesn’t.
- Plug and its derivatives into the ODE.
- Match coefficients on both sides; solve for the unknowns.
The general solution is .
Guess table
The standard guess for each form of forcing function:

| Forcing | Guess |
|---|---|
| Polynomial of degree : | |
| or | — always include both |
| Product of these | Product of corresponding guesses |
Why both sine and cosine? Because differentiating produces (and vice versa), so any forcing involving one of them naturally produces both in the derivatives. You need both terms in the guess to match all the coefficients.
Modification rule (resonance)
If the natural guess matches a homogeneous solution, you must multiply by (or higher powers if needed) to make it linearly independent.
For example, if contains and the forcing is , the natural guess would just produce 0 when plugged into the ODE (since already satisfies the homogeneous equation). Instead, use .
If a double root in the characteristic equation produces and , you’d need to be independent.
This is the modification rule — multiply by the smallest power of that makes the guess linearly independent of .
Worked example 1: exponential forcing
.
.
is not a root of the characteristic equation, so guess .
, . Plug in:
General solution: .
Worked example 2: trigonometric forcing
.
Guess (both, because the derivatives mix them).
, .
Substituting:
Group:
Solve the system. From , . Substitute into the second equation: , so and .
So .
General solution: .
Worked example 3: polynomial forcing
.
Guess (polynomial of degree 2 since the forcing is degree 2).
, .
Plug in:
Match coefficients:
- : , so .
- : , so , .
- Constant: , so , , .
So .
Worked example 4: forcing matches (resonance)
.
. The forcing matches the term in .
Modify the guess: (one factor of since is a simple root).
Compute, plug in, solve: . So .
General solution: .
Worked example 5: sum of forcings
.
Use Superposition principle for the particular solution: solve for each piece separately.
= particular solution of : guess .
= particular solution of : guess .
Total: .
This works because the ODE is linear: each piece of the forcing contributes its own piece of the particular solution.
When the method fails
Undetermined coefficients works only for forcing terms whose derivatives stay within a finite-dimensional family. Polynomials → polynomials; exponentials → exponentials; → . Products and sums work too.
It fails for things like , , , or forcing terms whose derivatives keep producing new types. For these, use Method of variation of parameters.