Nonhomogeneous Equations: The Methods of Undetermined
Coefficients and Variation of Parameters
Recall that if we know a particular solution, 𝑦𝑝 , of a nonhomogeneous equation:
𝑎𝑛 𝑦 (𝑛) + 𝑎𝑛−1 𝑦 (𝑛−1) + ⋯ + 𝑎1 𝑦 ′ + 𝑎0 𝑦 = 𝑓(𝑥)
then the general solution has the form:
𝑦 = 𝑦𝑐 + 𝑦𝑝
where 𝑦𝑐 is the general solution of the associated homogeneous equation:
𝑎𝑛 𝑦 (𝑛) + ⋯ + 𝑎1 𝑦 ′ + 𝑎0 𝑦 = 0.
The method of undetermined coefficients is a way of guessing the form of a
particular solution, 𝑦𝑝 , based on what 𝑓(𝑥) is. If 𝑓(𝑥) is simple enough we
might be able to do that. For example, if 𝑓(𝑥) is a polynomial of degree 𝑚 then
we might guess that 𝑦𝑝 is also a polynomial of degree 𝑚:
𝑦𝑝 = 𝐴𝑚 𝑥 𝑚 + 𝐴𝑚−1 𝑥 𝑚−1 + ⋯ + 𝐴1 𝑥 + 𝐴0 .
We could plug 𝑦𝑝 into the nonhomogeneous equation and try to solve for the
coefficients 𝐴0 , … , 𝐴𝑚 . Similarly, if 𝑓 (𝑥 ) = 𝑎 cos 𝑘𝑥 + 𝑏 sin 𝑘𝑥 we might
guess that:
𝑦𝑝 (𝑥 ) = 𝐴 cos 𝑘𝑥 + 𝐵 sin 𝑘𝑥.
, 2
Ex. Solve 𝑦 ′′ − 5𝑦 ′ + 6𝑦 = 12𝑥 + 8.
Here 𝑓 (𝑥 ) = 12𝑥 + 8, let’s try
𝑦𝑝 = 𝐴𝑥 + 𝐵
𝑦′𝑝 = 𝐴
𝑦′′𝑝 = 0
𝑦 ′′ − 5𝑦 ′ + 6𝑦 = 12𝑥 + 8
0 − 5(𝐴) + 6(𝐴𝑥 + 𝐵) = 12𝑥 + 8
−5𝐴 + 6𝐴𝑥 + 6𝐵 = 12𝑥 + 8
6𝐴𝑥 + (6𝐵 − 5𝐴) = 12𝑥 + 8
6𝐴 = 12, 6𝐵 − 5𝐴 = 8
⟹ 𝐴 = 2, 𝐵 = 3.
𝑦𝑝 = 2𝑥 + 3.
General solution to 𝑦 ′′ − 5𝑦 ′ + 6𝑦 = 0 is:
𝑟 2 − 5𝑟 + 6 = 0
(𝑟 − 2)(𝑟 − 3) = 0
𝑟 = 2, 3
𝑦𝑐 = 𝑐1 𝑒 2𝑥 + 𝑐2 𝑒 3𝑥 .
General solution to 𝑦 ′′ − 5𝑦 ′ + 6𝑦 = 12𝑥 + 8 is:
𝑦 = 𝑦𝑐 + 𝑦𝑝 = 𝑐1 𝑒 2𝑥 + 𝑐2 𝑒 3𝑥 + 2𝑥 + 3.