The Method of Undetermined Coefficients
Given an nth-order linear differential equation
dn y dn−1 y dy
b0 (x) n
+ b 1 (x) n−1
+ · · · + bn−1 (x) + bn (x)y = R(x)
dx dx dx
From the previous lecture it is found out that the general solution of a non-homogeneous
equation is
y = yc + yp
where yc is the complementary function corresponding to the solution of the homogeneous
equation
dn y dn−1 y dy
b0 (x) n + b1 (x) n−1 + · · · + bn−1 (x) + bn (x)y = 0
dx dx dx
and yp is the particular solution that takes on the form of R(x).
The table shown, shows the forms of the particular solution for the different forms of
R(x).
R(x) Assumed Solution
ceax xs · Aeax
Pn (x) = A0 x + A1 xn−1 + · · · + An−1 x + An
n s n
x (B0 x + B1 x n−1
+ · · · + Bn−1 x + Bn )
Pn (x)eax s n
x (B0 x + B1 x n−1
+ · · · + Bn−1 x + Bn ) eax
sin bx,
cos bx A cos bx + B sin bx
sin bx
eax eax (A cos bx + B sin bx)
cos
bx
sin bx
Pn (x)eax xs eax (A0 xn + A1 xn−1 + · · · + An−1 x + Bn ) cos bx
cos bx
+ (B0 xn + B1 xn−1 + · · · + Bn−1 x + Bn ) sin bx
where: s is the smallest non-negative integer that will make yp (x) not of the same form as
the corresponding homogeneous equation.
NOTE : This method is applicable only if R(x) is of the form similar to the solutions
of a constant coefficient homogeneous linear differential equation.
Example 1.
Solve the equation
(D − 4)y = 5 (1)
Solution:
The auxiliary equation is
m−4=0
and its roots is m = 4.
yc = c1 e4x
yp = A
then direct substitution of yp to (1) yields
(D − 4)yp = 5
Dyp − 4yp = 5
Since yp = A, then
Dyp − 4yp = 5
DA − 4A = 5
5
Solving the equation we have A = − Therefore
4
5
yp = −
4
Hence the general solution of (1) is given by,
5
y = c1 e4x −
4
Example 2.
Solve the equation
D2 + D y = sin x
(1)
Solution:
The auxiliary equation is
m2 + m = 0
m(m + 1) = 0
and its roots are m = 0, −1. Therefore we may write
yc = c1 + c2 e−x
yp = A sin x + B cos x
Using (1) where y = yp
D2 yp + Dyp = sin x (2)
Since
yp = A sin x + B cos x
Dyp = A cos x − B sin x
D2 yp = −A sin x − B cos x
then direct substitution of yp to (2) yields
−A sin x − B cos x + A cos x − B sin x = sin x
(−A + B) cos x + (−A − B) sin x = sin x
1 1
Using equating coefficients we have A = − and B = − .Therefore
2 2
1 1
yp = sin x + cos x
2 2
Hence the general solution of (1) is given by,
1 1
y = c1 + c2 e−x + sin x + cos x
2 2
Example 3.
Solve the equation
(D2 − 4D + 4)y = ex (1)
Solution:
The auxiliary equation is
m2 − 4m + 4 = 0
(m − 2)2 = 0
and its roots are m = 2, 2.
yc = c1 e2x + c2 xe2x
yp = Aex
Using (1) where y = yp
D2 yp − 4Dyp + 4yp = ex (2)
Since
yp = Aex
Dyp = Aex
D2 yp = Aex
then direct substitution of yp to (2) yields
Aex − 4Aex + 4 = ex
Solving the equation we have A = 1. Therefore
yp = ex
Hence the general solution of (1) is given by,
y = c1 e2x + c2 xe2x + ex
Example 4.
Solve the equation
(D2 − 3D + 2)y = 2x2 + 1 (1)
Solution:
The auxiliary equation is
m2 − 3m + 2 = 0
(m − 2)(m − 1) = 0
and its roots are m = 1, 2.
yc = c1 ex + c2 e2x
yp = A + Bx + Cx2
Using (1) where y = yp
D2 yp − 3Dyp + 2yp = 2x2 + 1 (2)
Since
yp = A + Bx + Cx2
Dyp = B + 2Cx
D2 yp = 2C
then direct substitution of yp to (2) yields
2C − 3(B + 2Cx) + 2(A + Bx + Cx2 ) = 2x+ 1
Solving the equation we have A = 4, B = 3, C = 1. Therefore
yp = 4 + 3x + x2
Hence the general solution of (1) is given by,
y = c1 ex + c2 e2x + x2 + 3x + 4
Example 5.
Solve the equation
(D2 + 3D + 2)y = 2 sin 3x (1)
Solution:
The auxiliary equation is
m2 + 3m + 2 = 0
(m + 2)(m + 1) = 0
and its roots are m = −2, −1.
yc = c1 e−2x + c2 e−x
yp = A sin 3x + B cos 3x
Using (1) where y = yp
D2 yp + 3Dyp + 2yp = 2 sin 3x (2)
Since
yp = A sin 3x + B cos 3x
Dyp = 3A cos 3x − 3B sin 3x
D2 yp = −9A sin 3x − 9B cos 3x
then direct substitution of yp to (2) yields
−9A sin 3x − 9B cos 3x + 3(3A cos 3x − 3B sin 3x) + 2(A sin 3x + B cos 3x) = 2 sin 3x
(−7A − 9B) sin 3x + (9A − 7B) cos 3x = 2 sin 3x
7 9
Using equating coefficients we have A = − and B = − . Therefore
65 65
7 9
yp = − sin 3x − cos 3x
65 65
Hence the general solution of (1) is given by,
7 9
y = c1 e−2x + c2 e−x − sin 3x − cos 3x
65 65
Example 6.
Solve the equation
(D2 − 3D + 2)y = 2x3 − 9x2 + 6x (1)
Solution:
The auxiliary equation is
m2 − 3m + 2 = 0
(m − 2)(m − 1) = 0
and its roots are m = 1, 2.
yc = c1 ex + c2 e2x
yp = A + Bx + Cx2 + Ex3
Using (1) where y = yp
D2 yp − 3Dyp + 2yp = 2x3 − 9x2 + 6x (2)
Since
yp = A + Bx + Cx2 + Ex3
Dyp = B + 2Cx + 3Ex2
D2 yp = 2C + 6Ex
then direct substitution of yp to (2) yields
2C + 6Ex − 3(B + 2Cx + 3Ex2 ) + 2(A + Bx + Cx2 + Ex3 ) = 2x3 − 9x2 + 6x
Solving the equation we have A = 0, B = 0, C = 0, E = 1. Therefore
y p = x3
Hence the general solution of (1) is given by,
y = c1 ex + c2 e2x + x3
Example 7.
Solve the equation
(D2 + 4)y = 5ex − 4x (1)
Solution:
The auxiliary equation is
m2 + 4 = 0
and its roots are m = ±j2.
yc = c1 cos 2x + c2 sin 2x
yp = A + Bx + Cex
Using (1) where y = yp
D2 yp − 3Dyp + 2yp = 5ex − 4x (2)
Since
yp = A + Bx + Cex
Dyp = B + Cex
D2 yp = Cex
then direct substitution of yp to (2) yields
Cex + 4(A + Bx + Cex ) = 5ex − 4x
Solving the equation we have A = 0, B = −1, C = 1. Therefore
yp = −x + ex
Hence the general solution of (1) is given by,
y = c1 cos 2x + c2 sin 2x − x + ex
Example 8.
Solve the equation
(D2 + 4)y = 5ex − 4x2 (1)
Solution:
The auxiliary equation is
m2 + 4 = 0
and its roots are m = ±j2.
yc = c1 cos 2x + c2 sin 2x
yp = A + Bx + Cx2 + Eex
Using (1) where y = yp
D2 yp − 3Dyp + 2yp = 5ex − 4x2 (2)
Since
yp = A + Bx + Cx2 + Eex
Dyp = B + 2Cx + Eex
D2 yp = 2C + Eex
then direct substitution of yp to (2) yields
2C + Dex 4(A + Bx + Cx2 + Dex ) = 5ex − 4x2
1
Solving the equation we have A = , B = 0, C = −1, E = 1 Therefore
2
1
yp = − x2 + e x
2
Hence the general solution of (1) is given by,
1
y = c1 cos 2x + c2 sin 2x + − x2 + e x
2
Example 9.
Solve the equation
(D2 − 9)y = 4e2x (1)
Solution:
The auxiliary equation is
m2 − 9 = 0
(m − 3)(m + 3) = 0
and its roots are m = −3, 3.
yc = c1 e−3x + c2 e3x
yp = Ae2x
Using (1) where y = yp
(D2 − 9)yp = 4e2x (2)
Since
yp = Ae3x
Dyp = 2Ae2x
D2 yp = 4Ae2x
then direct substitution of yp to (2) yields
4Ae2x − 9Ae3x = 4e2x
4
Solving the equation we have A = − Therefore
5
4
yp = − e2x
5
Hence the general solution of (1) is given by,
4
y = c1 e−3x + c2 e3x − e2x
5
Example 10.
Solve the equation
y 00 − 3y 0 − 4y = 6ex (1)
Solution:
Rewrite (1) as
(D2 − 3D − 4)y = 6ex (2)
The auxiliary equation is
m2 − 3m − 4 = 0
(m − 4)(m + 1) = 0
and its roots are m = −1, 4.
yc = c1 e−x + c2 xe4x
yp = Aex
Using (2) where y = yp
(D2 − 3D − 4)yp = 6ex (3)
Since
yp = Aex
Dyp = Aex
D2 yp = Aex
then direct substitution of yp to (3) yields
Aex − 3Aex − 4Aex = 6ex
Solving the equation we have A = −1. Therefore
yp = −ex
Hence the general solution of (1) is given by,
y = c1 e−x + c2 xe4x − ex