Undetermined coefficients

18.03, Spring, 1999

1. The method of undetermined coefficients is successful and efficient at solving linear ordinary differential equations with constant coefficients in case the “right-hand side” of the equation is polynomial times exponential:

y^{(n)} + p_{1}y^{(n−1)} + ⋯ + p_{n−1}y′ + p_{n}y = x^{m}e^{sx}.  (1)

Here p_{1}, …, p_{n}, and s are constants and m is one of the “natural numbers” 0, 1, 2, . . .. Functions involving sine and cosine can be dealt with using complex exponentials.

I’ll write L for the differential operator

L = D^{n} + p_{1}D^{n−1} + ⋯ + p_{n−1}D + p_{n}I

(where I denotes the “identity operator”: Iy = y for any function y), so that (1) reads

Ly = x^{m}e^{sx}.

The differential operator L has characteristic polynomial

f(r) = r^{n} + p_{1}r^{n−1} + ⋯ + p_{n−1}r + p_{n}.

Here is the method, expressed as a theorem.

Theorem. Suppose that s occurs as a root of the characteristic polynomial f(r) exactly k times. Then (1) has exactly one solution of the form

y = (a_{k}x^{k} + a_{k+1}x^{k+1} + ⋯ + a_{k+m}x^{k+m})e^{sx}.

Remark 1: Since L is linear we may make exactly the same statement for the equation Ly = g(x)e^{sx} for any polynomial g(x) of degree m.

Remark 2: Note that L(x^{j}e^{sx}) = 0 for j = 0, 1, …, k−1 (from our work on homogeneous linear equations or from the ESL below). So we can add in lower terms to the polynomial in the solution but we lose uniqueness if we do. Conversely, the general solution of (1) can be obtained by adding a solution to the homogeneous equation Ly = 0 to the particular solution of (1) found by the method of undetermined coefficients.

Special Case 1: s = 0. Then e^{sx} is the constant function with value 1, and we have a solution to Ly = g(x) (for any degree m polynomial g(x)) which is polynomial of degree k + m and begins with the term of degree x^{k}, where k is the number of times 0 occurs as a root of f(r), i.e., the least j for which p_{j} ≠ 0.

Example: y′′ + 4y′ + 4y = x^{2}. The solution has the form y = ax^{2} + bx + c since k = 0, m = 2. Computing y′ and y′′, forming Ly, and equating coefficients of powers of x we find y = (2x^{2} − 4x + 3)/8.

Example: y′′ + 4y′ = x^{2} + 1. Two changes here: 0 is now a root of the characteristic polynomial (k = 1), and there is a polynomial rather than a monomial on the right hand side. The latter makes no difference to our method. The former requires us to consider y = ax^{3} + bx^{2} + cx. Carrying out the same series of steps leads to y = (1/12)x^{3} − (1/16)x^{2} + (9/32)x. One of the solutions to the homogeneous equation Ly = 0 is y_{h} = 1, so y = (1/12)x^{3} − (1/16)x^{2} + (9/32)x + a is also a solution for any constant a. (e^{−4x} is a second and independent solution to Ly = 0 so we can add a multiple of that as well.)

Special Case 2: m = 0 and k = 0. Then s does not occur at all as a root of the characteristic polynomial: f(s) ≠ 0. We have a solution of the form ae^{sx}. The constant a is easy to find: L(ae^{sx}) = af(s)e^{sx} so a = 1/f(s).

This is real if p_{1}, …, p_{n} are real (as you have no doubt assumed) and s is real, and then e^{sx}/f(s) is our solution. If the p_{j} are real but s is not, then a will probably not be real either. Then one must return to the original real problem by taking real or imaginary parts.

Example: y′′ + 2y′ + y = e^{x}. Here s = 1 and f(r) = r^{2} + 2r + 1 so f(1) = 4 ≠ 0 and so k = 0. e^{x}/4 is a solution.

Example: y′′ + 2y′ + y = 3 sin x. Step 1: Replace this with a different problem involving a complex exponential: Lz = 3e^{ix}. If z is a solution to this, then y = Im z is a solution to Ly = 3 sin x, since 3 sin x = Im 3e^{ix}. Step 2: Solve the resulting equation. s = i. This is not a root of the characteristic polynomial: f(i) = 2i. Thus k = 0 and the solution is z = 3e^{ix}/2i. Step 3: Obtain a real solution to the original problem. y = Im z = (−3/2) cos x.

2. The exponential shift law.

The product rule and the formula for the derivative of an exponential imply that

D(ue^{sx}) = e^{sx}(D + sI)u.

Iterating, we have D^{j}(ue^{sx}) = e^{sx}(D + sI)^{j}u. Using linearity and the fact that our constant coefficient linear operator L satisfies L = f(D), we find the exponential shift law

L(ue^{sx}) = e^{sx}f(D + sI)u.  (2)

This formula is very useful in solving the undetermined coefficients problem whenever the proposed solution is not purely exponential/trigonometric or purely polynomial: whenever s and m + k are both nonzero. It eliminates the exponential, returning us to the situation of Case 1 (s = 0) above but for a different operator, f(D+sI). That is, y = ue^{sx} satisfies Ly = x^{m}e^{sx} exactly when u satisfies f(D + sI)u = x^{m}.

Example. y′′ +2y′ +y = x^{2}e^{x}. Here s = 1 is not a root of f(r) = r^{2} +2r +1, so k = 0, but m = 2 so the ESL is useful. With y = ue^{x}, the ESL says Ly = e^{x}f(D+I)u. Now f(D) = (D +I)^{2}, so f(D +I) = ((D +I)+I)^{2} = D^{2} +4D +4I and we want f(D +I)u = x^{2}. This is an example with k = s = 0 which was done above: u = (1/12)x^{3} − (1/16)x^{2} + (9/32)x. So the original problem has a particular solution y = ((1/12)x^{3} − (1/16)x^{2} + (9/32)x)e^{x}.

Example. y′′ + 2y′ + y = x^{2}e^{−x}. Here s = −1 is a double root of f(r) = r^{2} + 2r + 1: k = 2. With y = ue^{−x}, the ESL says Ly = e^{−x}f(D − I)u. Now f(D − I) = D^{2} so we want D^{2}u = x^{2}. This is a very simple example with s = 0, with solution u = x^{4}/12. So the original problem has a particular solution y = (1/12)x^{4}e^{−x}.