3.4 Undetermined Coefficients

INTRODUCTION

To solve a nonhomogeneous linear differential equation

any(n) + an−1y(n−1) + … + a1y′ + a0y = g(x) (1)

we must do two things: (i) find the complementary function yc; and (ii) find any particular solution yp of the nonhomogeneous equation. Then, as discussed in Section 3.1, the general solution of (1) on an interval I is y = yc + yp.

The complementary function yc is the general solution of the associated homogeneous DE of (1), that is,

any(n) + an−1y(n−1) + … + a1y′ + a0y = 0.

In the last section we saw how to solve these kinds of equations when the coefficients were constants. Our goal then in the present section is to examine a method for obtaining particular solutions.

Method of Undetermined Coefficients

The first of two ways we shall consider for obtaining a particular solution yp is called the method of undetermined coefficients. The underlying idea in this method is a conjecture, an educated guess really, about the form of yp motivated by the kinds of functions that make up the input function g(x). The general method is limited to nonhomogeneous linear DEs such as (1) where

  • the coefficients, ai, i = 0, 1, …, n are constants, and
  • where g(x) is a constant, a polynomial function, exponential function eαx, sine or cosine functions sin βx or cos βx, or finite sums and products of these functions.

A constant k is a polynomial function of degree 0.

Strictly speaking, g(x) = k (a constant) is a polynomial function. Since a constant function is probably not the first thing that comes to mind when you think of polynomial functions, for emphasis we shall continue to use the redundancy “constant functions, polynomial functions, ….”

The following functions are some examples of the types of inputs g(x) that are appropriate for this discussion:

g(x) = 10, g(x) = x2 − 5x, g(x) = 15x − 6 + 8ex

g(x) = sin 3x − 5x cos 2x, g(x) = xex sin x + (3x2 − 1)e−4x.

That is, g(x) is a linear combination of functions of the type

P(x) = anxn + an−1xn−1 + … + a1x + a0, P(x)eαx, P(x)eαx sin βx, and P(x)eαx cos βx,

where n is a nonnegative integer and α and β are real numbers. The method of undetermined coefficients is not applicable to equations of form (1) when

g(x) = ln x, g(x) = , g(x) = tan x, g(x) = sin−1x,

and so on. Differential equations in which the input g(x) is a function of this last kind will be considered in Section 3.5.

The set of functions that consists of constants, polynomials, exponentials eαx, sines, and cosines has the remarkable property that derivatives of their sums and products are again sums and products of constants, polynomials, exponentials eαx, sines, and cosines. Since the linear combination of derivatives must be identical to g(x), it seems reasonable to assume that yp has the same form as g(x).

The next two examples illustrate the basic method.

EXAMPLE 1 General Solution Using Undetermined Coefficients

Solve

y″ + 4y′ − 2y = 2x2 − 3x + 6. (2)

SOLUTION

Step 1 We first solve the associated homogeneous equation y″ + 4y′ − 2y = 0. From the quadratic formula we find that the roots of the auxiliary equation m2 + 4m − 2 = 0 are m1 = −2 − and m2 = −2 + . Hence the complementary function is

Step 2 Now, since the function g(x) is a quadratic polynomial, let us assume a particular solution that is also in the form of a quadratic polynomial:

yp = Ax2 + Bx + C.

We seek to determine specific coefficients A, B, and C for which yp is a solution of (2). Substituting yp and the derivatives = 2Ax + B and = 2A into the given differential equation (2), we get

Since the last equation is supposed to be an identity, the coefficients of like powers of x must be equal:

That is,

−2A = 2, 8A − 2B = −3, 2A + 4B − 2C = 6.

Solving this system of equations leads to the values A = −1, B = −, and C = −9. Thus a particular solution is

Step 3 The general solution of the given equation is

EXAMPLE 2 Particular Solution Using Undetermined Coefficients

Find a particular solution of y″y′ + y = 2 sin 3x.

SOLUTION

A natural first guess for a particular solution would be A sin 3x. But since successive differentiations of sin 3x produce sin 3x and cos 3x, we are prompted instead to assume a particular solution that includes both of these terms:

yp = A cos 3x + B sin 3x.

Differentiating yp and substituting the results into the differential equation gives, after regrouping,

or

From the resulting system of equations,

−8A − 3B = 0, 3A − 8B = 2,

we get A = and B = . A particular solution of the equation is

As we mentioned, the form that we assume for the particular solution yp is an educated guess; it is not a blind guess. This educated guess must take into consideration not only the types of functions that make up g(x) but also, as we shall see in Example 4, the functions that make up the complementary function yc.

EXAMPLE 3 Forming yp by Superposition

Solve y″ − 2y′ − 3y = 4x − 5 + 6xe2x. (3)

SOLUTION

Step 1 First, the solution of the associated homogeneous equation y″ − 2y′ − 3y = 0 is found to be yc = c1ex + c2e3x.

Step 2 Next, the presence of 4x − 5 in g(x) suggests that the particular solution includes a linear polynomial. Furthermore, since the derivative of the product xe2x produces 2xe2x and e2x, we also assume that the particular solution includes both xe2x and e2x. In other words, g is the sum of two basic kinds of functions:

g(x) = g1(x) + g2(x) = polynomial + exponentials.

How to use Theorem 3.1.7 in the solution of Example 3.

Correspondingly, the superposition principle for nonhomogeneous equations (Theorem 3.1.7) suggests that we seek a particular solution

yp = yp1 + yp2,

where yp1 = Ax + B and yp2 = Cxe2x + Ee2x. Substituting

yp = Ax + B + Cxe2x + Ee2x

into the given equation (3) and grouping like terms gives

(4)

From this identity we obtain the four equations

−3A = 4, −2A − 3B = −5, −3C = 6, 2C − 3E = 0.

The last equation in this system results from the interpretation that the coefficient of e2x in the right member of (4) is zero. Solving, we find A = −, B = , C = −2, and E = −. Consequently,

Step 3 The general solution of the equation is

In light of the superposition principle (Theorem 3.1.7), we can also approach Example 3 from the viewpoint of solving two simpler problems. You should verify that substituting

= Ax + B into y″ − 2y′ − 3y = 4x − 5

and = Cxe2x + Ee2x into y″ − 2y′ − 3y = 6xe2x

yields, in turn, yp1 = − x + and yp2 = −(2x + )e2x. A particular solution of (3) is then yp = + .

The next example illustrates that sometimes the “obvious” assumption for the form of yp is not a correct assumption.

EXAMPLE 4 A Glitch in the Method

Find a particular solution of y″ − 5y′ + 4y = 8ex.

SOLUTION

Differentiation of ex produces no new functions. Thus, proceeding as we did in the earlier examples, we can reasonably assume a particular solution of the form yp = Aex. But substitution of this expression into the differential equation yields the contradictory statement 0 = 8ex, and so we have clearly made the wrong guess for yp.

The difficulty here is apparent upon examining the complementary function yc = c1ex + c2e4x. Observe that our assumption Aex is already present in yc. This means that ex is a solution of the associated homogeneous differential equation, and a constant multiple Aex when substituted into the differential equation necessarily produces zero.

What then should be the form of yp? Inspired by Case II of Section 3.3, let’s see whether we can find a particular solution of the form

yp = Axex.

Substituting and into the differential equation and simplifying gives

From the last equality we see that the value of A is now determined as A = −. Therefore a particular solution of the given equation is yp = xex.

The difference in the procedures used in Examples 1–3 and in Example 4 suggests that we consider two cases. The first case reflects the situation in Examples 1–3.

Case I: No function in the assumed particular solution is a solution of the associated homogeneous differential equation.

In Table 3.4.1 we illustrate some specific examples of g(x) in (1) along with the corresponding form of the particular solution. We are, of course, taking for granted that no function in the assumed particular solution yp is duplicated by a function in the complementary function yc.

TABLE 3.4.1. Trial Particular Solutions
g(x) Form of yp
1. 1 (any constant) A
2. 5x + 7 Ax + B
3. 3x2 − 2 Ax2 + Bx + C
4. x3x + 1 Ax3 + Bx2 + Cx + E
5. sin 4x A cos 4x + B sin 4x
6. cos 4x A cos 4x + B sin 4x
7. e5x Ae5x
8. (9x − 2)e5x (Ax + B)e5x
9. x2e5x (Ax2 + Bx + C)e5x
10. e3x sin 4x Ae3x cos 4x + Be3x sin 4x
11. 5x2 sin 4x (Ax2 + Bx + C) cos 4x + (Ex2 + Fx + G) sin 4x
12. xe3x cos 4x (Ax + B)e3x cos 4x + (Cx + E)e3x sin 4x

EXAMPLE 5 Forms of Particular Solutions—Case I

Determine the form of a particular solution of

(a) y″ − 8y′ + 25y = 5x3ex − 7ex (b) y″ + 4y = x cos x.

SOLUTION

(a) We can write g(x) = (5x3 − 7)ex. Using entry 9 in Table 3.4.1 as a model, we assume a particular solution of the form

yp = (Ax3 + Bx2 + Cx + E)ex.

Note that there is no duplication between any of the terms in yp and the terms in the complementary function yc = e4x(c1 cos 3x + c2 sin 3x).

(b) The function g(x) = x cos x is similar to entry 11 in Table 3.4.1 except, of course, that we use a linear rather than a quadratic polynomial and cos x and sin x instead of cos 4x and sin 4x in the form of yp:

yp = (Ax + B) cos x + (Cx + E) sin x.

Again observe that there is no duplication of terms between yp and yc = c1 cos 2x + c2 sin 2x.

If g(x) consists of a sum of, say, m terms of the kind listed in the table, then (as in Example 3) the assumption for a particular solution yp consists of the sum of the trial forms corresponding to these terms:

The foregoing sentence can be put another way.

Form Rule for Case I: The form of yp is a linear combination of all linearly independent functions that are generated by repeated differentiations of g(x).

EXAMPLE 6 Finding yp by Superposition—Case I

Determine the form of a particular solution of

y″ − 9y′ + 14y = 3x2 − 5 sin 2x + 8xe6x.

SOLUTION

The right-hand side of the equation g(x) = 3x2 − 5 sin 2x + 8xe6x consists of three different types of functions x2, sin 2x, and xe6x. The derivatives of these functions yield, in turn, the additional functions x, 1; cos 2x; and e6x. Therefore:

corresponding to x2 we assume

corresponding to sin 2x we assume

corresponding to xe6x we assume

The assumption for a particular solution of the given nonhomogeneous differential equation is then

Note that none of the seven terms in this assumption for yp duplicates a term in the complementary function yc = c1e2x + c2e7x.

Case II: A function in the assumed particular solution is also a solution of the associated homogeneous differential equation.

The next example is similar to Example 4.

EXAMPLE 7 Particular Solution—Case II

Find a particular solution of y″ − 2y′ + y = ex.

SOLUTION

The complementary function is yc = c1ex + c2xex. As in Example 4, the assumption yp = Aex will fail since it is apparent from yc that ex is a solution of the associated homogeneous equation y″ − 2y′ + y = 0. Moreover, we will not be able to find a particular solution of the form yp = Axex since the term xex is also duplicated in yc. We next try

yp = Ax2ex.

Substituting into the given differential equation yields 2Aex = ex and so A = . Thus a particular solution is yp = x2ex.

Suppose again that g(x) consists of m terms of the kind given in Table 3.4.1, and suppose further that the usual assumption for a particular solution is

where the , i = 1, 2, …, m are the trial particular solution forms corresponding to these terms. Under the circumstances described in Case II, we can make up the following general rule.

Multiplication Rule for Case II: If any contains terms that duplicate terms in yc, then that must be multiplied by xn, where n is the smallest positive integer that eliminates that duplication.

EXAMPLE 8 An Initial-Value Problem

Solve the initial-value problem y″ + y = 4x + 10 sin x, y(π) = 0, y′(π) = 2.

SOLUTION

The solution of the associated homogeneous equation y″ + y = 0 is yc = c1 cos x + c2 sin x. Since g(x) = 4x + 10 sin x is the sum of a linear polynomial and a sine function, our normal assumption for yp, from entries 2 and 5 of Table 3.4.1, would be the sum of = Ax + B and = C cos x + E sin x:

yp = Ax + B + C cos x + E sin x. (5)

But there is an obvious duplication of the terms cos x and sin x in this assumed form and two terms in the complementary function. This duplication can be eliminated by simply multiplying by x. Instead of (5) we now use

yp = Ax + B + Cx cos x + Ex sin x.

Differentiating this expression and substituting the results into the differential equation gives

(6)

and so A = 4, B = 0, −2C = 10, 2E = 0. The solutions of the system are immediate: A = 4, B = 0, C = −5, and E = 0. Therefore from (6) we obtain yp = 4x − 5x cos x. The general solution of the given equation is

y = yc + yp = c1 cos x + c2 sin x + 4x − 5x cos x.

We now apply the prescribed initial conditions to the general solution of the equation. First, y(π) = c1 cos π + c2 sin π + 4π − 5π cos π = 0 yields c1 = 9π since cos π = −1 and sin π = 0. Next, from the derivative

y′ = −9π sin x + c2 cos x + 4 + 5x sin x − 5 cos x

and

y′(π) = −9π sin π + c2 cos π + 4 + 5π sin π − 5 cos π = 2

we find c2 = 7. The solution of the initial value is then

y = 9π cos x + 7 sin x + 4x − 5x cos x.

EXAMPLE 9 Using the Multiplication Rule

Solve y″ − 6y′ + 9y = 6x2 + 2 − 12e3x.

SOLUTION

The complementary function is yc = c1e3x + c2xe3x. And so, based on entries 3 and 7 of Table 3.4.1, the usual assumption for a particular solution would be

Inspection of these functions shows that the one term in is duplicated in yc. If we multiply by x, we note that the term xe3x is still part of yc. But multiplying by x2 eliminates all duplications. Thus the operative form of a particular solution is

yp = Ax2 + Bx + C + Ex2e3x.

Differentiating this last form, substituting into the differential equation, and collecting like terms gives

It follows from this identity that A = , B = , C = , and E = − 6. Hence the general solution y = yc + yp is

EXAMPLE 10 Third-Order DE—Case I

Solve y‴ + y″ = ex cos x.

SOLUTION

From the characteristic equation m3 + m2 = 0 we find m1 = m2 = 0 and m3 = −1. Hence the complementary function of the equation is yc = c1 + c2x + c3ex. With g(x) = ex cos x, we see from entry 10 of Table 3.4.1 that we should assume

yp = Aex cos x + Bex sin x.

Since there are no functions in yp that duplicate functions in the complementary solution, we proceed in the usual manner. From

we get −2A + 4B = 1, − 4A − 2B = 0. This system gives A = − and B = , so that a particular solution is yp = − ex cos x + ex sin x. The general solution of the equation is

EXAMPLE 11 Fourth-Order DE—Case II

Determine the form of a particular solution of y(4) + y‴ = 1 − x2ex.

SOLUTION

Comparing yc = c1 + c2x + c3x2 + c4ex with our normal assumption for a particular solution

we see that the duplications between yc and yp are eliminated when is multiplied by x3 and is multiplied by x. Thus the correct assumption for a particular solution is

yp = Ax3 + Bx3ex + Cx2ex + Exex.

REMARKS

  1. In Problems 27–36 of Exercises 3.4, you are asked to solve initial-value problems, and in Problems 37–40, boundary-value problems. As illustrated in Example 8, be sure to apply the initial conditions or the boundary conditions to the general solution y = yc + yp. Students often make the mistake of applying these conditions only to the complementary function yc since it is that part of the solution that contains the constants.
  2. From the “Form Rule for Case I” on page 136 of this section you see why the method of undetermined coefficients is not well suited to nonhomogeneous linear DEs when the input function g(x) is something other than the four basic types listed in red on page 132. If P(x) is a polynomial, continued differentiation of P(x)eαx sin βx will generate an independent set containing only a finite number of functions—all of the same type, namely, polynomials times eαx sin βx or eαx cos βx. On the other hand, repeated differentiations of input functions such as g(x) = ln x or g(x) = tan−1x generate an independent set containing an infinite number of functions:

    derivatives of ln x:

    derivatives of tan−1x:

3.4 Exercises Answers to selected odd-numbered problems begin on page ANS-5.

In Problems 1–26, solve the given differential equation by undetermined coefficients.

  1. y″ + 3y′ + 2y = 6
  2. 4y″ + 9y = 15
  3. y″ − 10y′ + 25y = 30x + 3
  4. y″ + y′ − 6y = 2x
  5. y″ + y′ + y = x2 − 2x
  6. y″ − 8y′ + 20y = 100x2 − 26xex
  7. y″ + 3y = −48x2e3x
  8. 4y″ − 4y′ − 3y = cos 2x
  9. y″y′ = −3
  10. y″ + 2y′ = 2x + 5 − e−2x
  11. y″y′ + y = 3 + ex/2
  12. y″ − 16y = 2e4x
  13. y″ + 4y = 3 sin 2x
  14. y″ − 4y = (x2 − 3) sin 2x
  15. y″ + y = 2x sin x
  16. y″ − 5y′ = 2x3 − 4x2x + 6
  17. y″ − 2y′ + 5y = ex cos 2x
  18. y″ − 2y′ + 2y = e2x(cos x − 3 sin x)
  19. y″ + 2y′ + y = sin x + 3 cos 2x
  20. y″ + 2y′ − 24y = 16 − (x + 2)e4x
  21. y‴ − 6y″ = 3 − cos x
  22. y‴ − 2y″ − 4y′ + 8y = 6xe2x
  23. y‴ − 3y″ + 3y′ − y = x − 4ex
  24. y‴ − y″ − 4y′ + 4y = 5 − ex + e2x
  25. y(4) + 2y″ + y = (x − 1)2
  26. y(4)y″ = 4x + 2xex

In Problems 27–36, solve the given initial-value problem.

  1. y″ + 4y = −2,
  2. 2y″ + 3y′ − 2y = 14x2 − 4x − 11,

    y(0) = 0, y′(0) = 0

  3. 5y″ + y′ = −6x, y(0) = 0, y′(0) = −10
  4. y″ + 4y′ + 4y = (3 + x)e−2x, y(0) = 2, y′(0) = 5
  5. y″ + 4y′ + 5y = 35e−4x, y(0) = −3, y′(0) = 1
  6. y″y = cosh x, y(0) = 2, y′(0) = 12
  7. + ω2x = F0 sin ω t, x(0) = 0, x′(0) = 0
  8. + ω2x = F0 cos γt, x(0) = 0, x′(0) = 0
  9. y‴ − 2y″ + y′ = 2 − 24ex + 40e5x, y(0) = , y′(0) = ,
    y″(0) = −
  10. y‴ + 8y = 2x − 5 + 8e−2x, y(0) = −5, y′(0) = 3, y″(0) = − 4

In Problems 37–40, solve the given boundary-value problem.

  1. y″ + y = x2 + 1, y(0) = 5, y(1) = 0
  2. y″ − 2y′ + 2y = 2x − 2, y(0) = 0, y(π) = π
  3. y″ + 3y = 6x, y(0) = 0, y(1) + y′(1) = 0
  4. y″ + 3y = 6x, y(0) + y′(0) = 0, y(1) = 0

In Problems 41 and 42, solve the given initial-value problem in which the input function g(x) is discontinuous. [Hint: Solve each problem on two intervals, and then find a solution so that y and y′ are continuous at x = π/2 (Problem 41) and at x = π (Problem 42).]

Discussion Problems

  1. Consider the differential equation ay″ + by′ + cy = ekx, where a, b, c, and k are constants. The auxiliary equation of the associated homogeneous equation is

    am2 + bm + c = 0.


    1. If k is not a root of the auxiliary equation, show that we can find a particular solution of the form yp = Aekx, where A = 1/(ak2 + bk + c).
    2. If k is a root of the auxiliary equation of multiplicity one, show that we can find a particular solution of the form yp = Axekx, where A = 1/(2ak + b). Explain how we know that k ≠ − b/(2a).
    3. If k is a root of the auxiliary equation of multiplicity two, show that we can find a particular solution of the form y = Ax2ekx, where A = 1/(2a).
  2. Discuss how the method of this section can be used to find a particular solution of y″ + y = sin x cos 2x. Carry out your idea.

In Problems 45–48, without solving match a solution curve of y″ + y = f(x) shown in each figure with one of the following functions:

  1. f(x) = 1,
  2. f(x) = ex,
  3. f(x) = ex,
  4. f(x) = sin 2x,
  5. f(x) = ex sin x,
  6. f(x) = sin x.

Briefly discuss your reasoning.

  1. The curve is graphed on an x y coordinate plane. It consists of two parts each following an oscillatory pattern. The first part follows decaying oscillation pattern. It starts in the second quadrant, goes down and to the right to the third quadrant, goes up and to the right to the second quadrant, again goes down and to the right to the third quadrant, and goes up and to the right to the second quadrant. Then, it goes down and to the right to the third quadrant, goes up and to the right to the second quadrant, and ends at the origin. The second part follows increasing oscillation pattern. It starts at the origin, goes up and to the right to the first quadrant, goes down and to the right to the fourth quadrant, again goes up and to the right to the first quadrant, and goes down and to the right to the fourth quadrant. Then, it goes up and to the right to the first quadrant, goes down and to the right, and exits the bottom of the fourth quadrant.

    FIGURE 3.4.1 Graph for Problem 45

  2. The curve is graphed on an x y coordinate plane. It starts from the top of the second quadrant, goes down and to the right to the origin, goes up and to the right to the first quadrant, and goes down and to the right to the fourth quadrant. Again, it goes up and to the right to the first quadrant, goes down and to the right to the fourth quadrant, and ends at the right of the fourth quadrant.

    FIGURE 3.4.2 Graph for Problem 46

  3. The curve is graphed on an x y coordinate plane. It follows a wave pattern with a very small flat region at the start of each oscillation. It enters the left on the negative x axis, goes up and to the right to the second quadrant, goes down and to the right to the third quadrant, again goes up and to the right, and reaches the negative x axis. It becomes flat and goes to the right, then goes up and to the right to the second quadrant, goes down and to the right to the third quadrant, again goes up and to the right, and reaches the negative x axis. It becomes flat and goes to the right to the origin. From the origin, it goes up and to the right following the same wave pattern, completes two cycles, and exits the right on the positive x axis.

    FIGURE 3.4.3 Graph for Problem 47

  4. The curve is graphed on an x y coordinate plane. It follows a constant-amplitude wave pattern. It enters the left on the negative x axis, goes up and to the right to the second quadrant, goes down and to the right, and reaches the negative x axis. Again, it goes up and to the right to the second quadrant, and goes down and to the right to the origin. From the origin, it goes up and to the right following the same wave pattern, completes two cycles, and exits the right on the positive x axis.

    FIGURE 3.4.4 Graph for Problem 48

Computer Lab Assignments

In Problems 49 and 50, find a particular solution of the given differential equation. Use a CAS as an aid in carrying out differentiations, simplifications, and algebra.

  1. y″ − 4y′ + 8y = (2x2 − 3x)e2x cos 2x + (10x2x − 1)e2x sin 2x
  2. y(4) + 2y″ + y = 2 cos x − 3x sin x