DifferentialEquations
Chapter 4 · Section 4.3

4.3 The Method of Undetermined Coefficients

By Theorem 4.1.8 the general solution of a nonhomogeneous linear equation is . Section 4.2 showed how to find when the coefficients are constant. What is still missing is one particular solution . In this section we learn the fastest way to get it for the right-hand sides that occur most often in engineering: polynomials, exponentials, sines and cosines, and their products. These describe constant loads, ramps, decaying pulses and harmonic forcing.

Throughout this section the equation is

and we write for its characteristic polynomial, exactly as in Section 4.2.

The key idea: guess a family that is closed under differentiation

Suppose we must solve (a simple warm-up). The left side combines , , . If we try with an unknown constant , every derivative is again a multiple of :

Setting gives , and . The guess worked because differentiating never produces a new kind of function.

Compare with . Its derivatives are , , : every differentiation produces new functions, and no finite list of guesses can absorb them. The method of this section works precisely for right-hand sides whose derivatives stay inside a finite family. We give that family a name.

UC functions and UC sets

Definition 4.3.1 (UC function)

Start from four kinds of building blocks: powers (), exponentials (), and the sinusoids and (). A UC function (UC stands for "undetermined coefficients") is any building block, or any product of finitely many building blocks. Examples: , , , , .

Definition 4.3.2 (UC set)

The UC set of a UC function is the smallest set of UC functions, with itself included, such that and every derivative of is a linear combination of members of the set. (We drop constant factors, so and count as the same member.)

Here is how to find a UC set: differentiate repeatedly and collect every new "shape" that appears.

  • : the derivatives are . The UC set is .
  • : the derivatives are , , , alternating between the two. The UC set is .
  • : the first derivative is , the second is , and so on; only , , ever appear. The UC set is .
  • : this is a product. Its UC set consists of all products of a member of (the UC set of ) with a member of : .

The last example illustrates a general rule: the UC set of a product is the set of all products of members of the factors' UC sets. Table 4.3.1 collects the cases you will need.

Table 4.3.1: UC sets ( integer, , )
UC functionUC set
or
a product, e.g. all products formed by taking one member from the UC set of each factor; here . Leave out any factor that is not present (for the set is ).

The basic method

If is a UC function (or a combination of them), the natural guess for is a linear combination of all members of its UC set, with unknown coefficients. Substituting into the equation turns the differential equation into an algebra problem: match the coefficients of each function on both sides. That is where the name "undetermined coefficients" comes from.

Why must we include every member of the UC set, and not just itself? Because the left-hand side involves derivatives of , and these produce all the other members. If some member were missing from the guess, the corresponding term on the left could not be balanced.

Example 4.3.1 (Polynomial right-hand side)

Find the general solution of .

Solution
  1. Complementary function. , so .
  2. Trial form. The UC set of is , and it contains the UC set of . None of solves the homogeneous equation. So Note the constant : it is needed even though the right-hand side has no constant term.
  3. Derivatives. , .
  4. Substitute and collect powers of .
  5. Match with .
  6. Answer. and
Example 4.3.2 (Sinusoidal forcing)

Find the general solution of .

Solution
  1. Complementary function. , so .
  2. Trial form. The UC set of is , so We need the cosine even though contains only a sine: the term turns sines into cosines.
  3. Derivatives. , .
  4. Substitute.
  5. Match with . From the first, . Substituting in the second: , so and .
  6. Answer. and
Example 4.3.3 (Product of a polynomial and an exponential)

Find the general solution of .

Solution
  1. Complementary function. gives , so .
  2. Trial form. The UC set of is . Neither function appears in , so
  3. Derivatives. By the product rule,
  4. Substitute and divide by .
  5. Match with . gives ; gives .
  6. Answer. and

When the guess fails: the modification rule

Try the basic method on . The UC set of is , so we would guess . But these functions solve the homogeneous equation ! Substituting gives on the left, whatever and are, and is impossible. The guess has collapsed into .

The cure, which we justify below, is to multiply the guess by a power of . In the language of UC sets (this is how the rule is often stated):

Theorem 4.3.1 (Modification rule, UC-set form)

If the UC set of a term of contains a solution of the associated homogeneous equation, replace by (multiply every member by ), where is the smallest positive integer such that no member of solves the homogeneous equation. Then use the revised set to build the trial form.

There is an equivalent and quicker way to find directly from the characteristic polynomial. Attach to each type of term the number

Then is the multiplicity of this number as a root of , and if it is not a root at all. For example, the term has number , which is a simple root of ; so , and the correct trial form is .

Table 4.3.2: trial forms

, denote given polynomials of degree at most (with at least one of degree exactly ); , are the unknown coefficients; is the multiplicity of the indicated number as a root of ( if it is not a root).

Term in NumberTrial form for

A constant right-hand side is the case of the first row; a single or still needs both and in the trial.

Why multiplying by xk works

Take the case and look for . Since , applying this repeatedly gives

If is a root of multiplicity , then with , so . The equation for becomes . Because has nonzero constant term , it maps polynomials of degree one-to-one onto polynomials of degree , so we can take to be a polynomial of degree , and a polynomial of degree . The lowest coefficients of are wiped out by (they only add homogeneous solutions ), so we may drop them. What remains is exactly . The trigonometric cases follow in the same way using complex exponentials.

Example 4.3.4 (Forcing at the natural frequency)

Find the general solution of .

Solution
  1. Complementary function. gives , so .
  2. Compare. The number of is , a simple root. So :
  3. Derivatives. Write , so . By the product rule,
  4. Substitute. because solves the homogeneous equation, so .
  5. Compute . , so .
  6. Match with . gives ; gives .
  7. Answer. and

Physical meaning. For an undamped mass–spring system, describes free oscillation with angular frequency . Pushing it with a force of the same frequency gives a response whose amplitude grows like without bound. This is resonance, studied in detail in Chapter 5.

Figure 4.3.1. The particular solution of Example 4.3.4. Forcing at the natural frequency makes the amplitude grow linearly, between the dashed lines . This is resonance.
Example 4.3.5 (Double root)

Find the general solution of .

Solution
  1. Complementary function. , so is a double root and .
  2. Compare. The number of is , a root of multiplicity . So : (In UC-set language: and both contain homogeneous solutions; is the first that does not. Both and would give on the left.)
  3. Derivatives.
  4. Substitute and divide by . So the left side equals . (The shift formula above predicts this directly: , and .)
  5. Match. gives .
  6. Answer. .

Sums of terms: superposition

When is a sum of several terms, use Theorem 4.1.9: find a particular solution for each term separately and add them. In practice:

  • Group the terms of by their number (, , or ). Terms with the same number belong to one group; for example and form one group with , while and are different groups, and so are and .
  • For each group, write one trial form from Table 4.3.2 using the highest degree in the group, and multiply it by its own .
  • The modification is applied group by group: a group whose number is not a root gets no extra factor of , even if another group needs one.
Example 4.3.6 (Two modified terms and an IVP)

Solve , , .

Solution
  1. Complementary function. , roots and . So .
  2. Term . Its number is , a simple root, so : . (The plain guess fails: its constant part is a homogeneous solution, and the equations for would have no solution.)
  3. Solve for . , , so Hence and . So .
  4. Term . Its number is , a simple root, so : .
  5. Solve for . So and , giving .
  6. General solution.
  7. Derivative. .
  8. Initial conditions (applied to the full ): Then .
  9. Answer. .
Figure 4.3.2. The solution of Example 4.3.6, written as . The exponential part dies out within a couple of units of , and after that is practically the polynomial .
Example 4.3.7 (Setting up the trial form only)

The equation has characteristic polynomial . Write the correct trial form for (do not compute the coefficients).

Solution
  1. Roots. (double) and (simple). So .
  2. : number , multiplicity , degree . Trial: . (UC-set check: and both contain homogeneous solutions; does not.)
  3. : number , multiplicity . Trial: .
  4. : number , not a root. Trial: .
  5. : number , not a root (the roots are and , not ). Trial: .
  6. Total. There are nine unknowns. Finding them is routine but long, and the values involve fractions; this is a good job for the solver or a computer algebra system.
Method in a nutshell
  1. Check that the equation has constant coefficients and that is a sum of UC functions (rewrite with identities if needed, see below).
  2. Solve the homogeneous equation: find the roots of and write .
  3. Group the terms of by their number (, , , ). For each group write the trial form from Table 4.3.2 (full polynomials, both and ).
  4. For each group, find = multiplicity of its number as a root of , and multiply that group's trial by .
  5. Substitute into the equation, collect like functions and solve the linear equations for the coefficients.
  6. Write . For an IVP, apply the initial conditions to this complete .
  7. Check: substitute back (or use the solver).

Practice with the solver below. Enter the coefficients (highest derivative first) and a right-hand side made of polynomials, exponentials, sines and cosines. Compare its trial form and coefficients with your own work. Then try changing to (is a root?) or to (is a root?) and predict the new trial form before you run it.

Here is the equation of Example 4.3.6, where both terms need modification:

Right-hand sides that need rewriting first

Some functions are not UC functions as written but become sums of UC functions after a standard identity:

For example, to handle write it as and treat the two terms separately (see Exercise 12).

When the method does not apply

  • Variable coefficients. For , for instance, the trial gives on the left, and the new term cannot be balanced. Enlarging the trial only creates higher powers of : derivatives get multiplied by powers of , and the "closed family" idea breaks down.
  • Non-UC right-hand sides. Functions such as , , , , and have infinitely many independent derivatives. No finite trial form can work.

In both situations use variation of parameters (Section 4.4), which works for any continuous right-hand side once is known (and for Cauchy–Euler equations see Section 4.5).

Common mistakes

Avoid these
  1. Missing partner function. For (or ) the trial must contain both and .
  2. Missing lower powers. For the trial is , not . The same applies to the polynomials multiplying exponentials and sinusoids.
  3. Choosing the trial before finding . Always solve the homogeneous equation first; otherwise you cannot see whether modification is needed.
  4. Using the wrong power of . The power is the multiplicity of the root: for a simple root, for a double root, and so on. Using when is needed leads to an impossible system (Example 4.3.5).
  5. Modifying the wrong terms. Multiply by only the group whose number is a root, and multiply every member of that group (for with a simple root: , not ).
  6. Confusing similar-looking terms. (number ) is not related to (number ) or to (number ); check each against the roots separately.
  7. Applying initial conditions to only. Apply them to .
  8. Using the method where it does not apply (variable coefficients, , , , ...).
  9. Arithmetic slips. If the linear system for the coefficients has no solution, either the trial form is wrong (usually a missing modification) or there is an algebra error. Substituting back is the best check.

Exercises

In Exercises 1–8 find the general solution.

  1. Answer
  2. Answer
  3. Answer
  4. Answer
  5. Answer
  6. Answer Trial ;
  7. Answer Trial ;
  8. Answer
  9. Write (do not solve for the coefficients) the trial form for .
    Answer Roots .
  10. Write (do not solve for the coefficients) the trial form for .
    Answer Roots , , all simple.
  11. Solve the IVP , , .
    Answer
  12. Find the general solution of . (Hint: rewrite the right-hand side first.)
    Answer ;