5.3. Solving Equations with a Nonhomogeneous Term That Involves Sines and Cosines

The third form g(x) can take on is a combination of sines and cosines. Take a look at this differential equation:

y″ + 3y′ + 2y = sin (x)

Of course, the general solution is the sum of the homogeneous solution and a particular solution:

y = yh + yp

Because g(x) = sin (x) in this case, you can make an educated guess that

yp = A sin (x) + B cos (x)

where A and B are undetermined coefficients. How do you find A and B? Simply plug yp into the differential equation and then solve to get your coefficients.

The following problems give you practice using the method of undetermined coefficients to solve for the general solution to the nonhomogeneous equation when g(x) includes sines and cosines.

NOTE

EXAMPLE

Q. Find the general solution to this differential equation:

y″ + 3y′ + 2y = 10 sin (x)

where

y(0) = −1

and

y″(0) = −2

A. y = e−x + e−2x + sin (x) − 3 cos (x)

  1. Start by getting the homogeneous version of the differential equation:

    y″ + 3y′ + 2y = 0

  2. Assume that the solution to the homogeneous differential equation is of the form y = erx. When you substitute that into the differential equation, you get the following as the characteristic equation:

    r2 + 3r + 2 = 0

  3. Factor the characteristic equation this way:

    (r + 1)(r + 2) = 0

  4. Determine that the roots, r1 and r2, of the characteristic equation are −1 and −2, giving you

    y1 = e−x and y2 = e−2x

  5. Therefore, the solution to the homogeneous differential equation is given ...

Get Differential Equations Workbook For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.