Second Order Linear Nonhomogeneous Differential Equations;
Method of Undetermined Coefficients
We will now turn our attention to nonhomogeneous second order linear
equations, equations with the standard form
y″ + p(t)y′ + q(t)y = g(t), g(t) ≠ 0. (*)
Each such nonhomogeneous equation has a corresponding homogeneous
y″ + p(t)y′ + q(t)y = 0. (**)
Note that the two equations have the same left▯hand side, (**) is just the
homogeneous version of (*), with g(t) = 0.
We will focus our attention to the simpler topic of nonhomogeneous second
order linear equations with constant coefficients:
ay″ + by′ + cy = g(t).
Where a, b, and c are constants, a ≠ 0; and g(t) ≠ 0. It has a corresponding
homogeneous equation ay″ + by′ + cy = 0.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 1 Solution of the nonhomogeneous linear equations
It can be verify easily that the difference y =1Y Y 2 of any two solutions of
the nonhomogeneous equation (*), is always a solution of its corresponding
homogeneous equation (**). Therefore, every solution of (*) can be
obtained from a single solution of (*), by adding to it all possible solutions
of its corresponding homogeneous equation (**). As a result:
Theroem: The general solution of the second order nonhomogeneous linear
y″ + p(t)y′ + q(t)y = g(t)
can be expressed in the form
y = y + Y
where Y is any specific function that satisfies the nonhomogeneous equation,
and y c C y1 1C y 2 2 is a general solution of the corresponding
y″ + p(t)y′ + q(t)y = 0 .
(That is, 1 and y2are a pair of fundamental solutions of the corresponding
homogeneous equation; C and C are arbitrary constants.)
The term yc= C y1 1C y 2 2 is called the complementary solution (or the
homogeneous solution) of the nonhomogeneous equation. The termY is
called the particular solution (or the nonhomogeneous solution) of the same
© 2008, 2012 Zachary S Tseng B▯2 ▯ 2 Comment: It should be noted that the “complementary solution” is never
actually a solution of the given nonhomogeneous equation! It is merely
taken from the corresponding homogeneous equation as a component that,
when coupled with a particular solution, gives us the general solution of a
nonhomogeneous linear equation. On the other hand,the particular solution
is necessarily always a solution of the said nonhomogeneous equation.
Indeed, in a slightly different context, it must be a “particular” solution of a
certain initial value problem that contains the given equation and whatever
initial conditions that would result in C 1= C 2 0.
In the case of nonhomgeneous equations with constant coefficients, the
complementary solution can be easily found from the roots of the
characteristic polynomial. They are always one of the three forms:
y cC e 1 +C e2
λ t λ t
y c C e 1os ▯t + C e sin ▯t2
y c C e 1 C te 2
Therefore, the only task remaining is to find the particular solution Y, which
is any one function that satisfies the given nonhomogeneous equation. That
might sound like an easy task. But it is quite nontrivial.
There are two general approaches to find Y: the Methods of Undetermined
Coefficients, and Variation of Parameters. We will only study the former in
© 2008, 2012 Zachary S Tseng B▯2 ▯ 3 Method of Undetermined Coefficients
The Method of Undetermined Coefficients (sometimes referred to as the
method of Judicious Guessing) is a systematic way (almost, but not quite,
like using “educated guesses”) to determine the general form/type of the
particular solution Y(t) based on the nonhomogeneous term g(t) in the given
equation. The basic idea is that many of the most familiar and commonly
encountered functions have derivatives that vary little (in the form/type of
function) from their parent functions: exponential, polynomials, sine and
cosine. (Contrast them against log functions, whose derivatives, while
simple and predictable, are rational functions; or tangent, whose higher
derivatives quickly become a messy combinations ofthe powers of secant
and tangent.) Consequently, when those functions appear in g(t), we can
predict the type of function that the solution Y would be. Write down the
(best guess) form of Y, leaving the coefficient(s) undetermined. Then
compute Y ′ and Y″, put them into the equation, and solve for the unknown
coefficient(s). We shall see how this idea is put into practice in the
following three simple examples.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 4 2t
Example: y″ − 2y′ − 3y = e
The corresponding homogeneous equation y″ − 2y′ − 3y = 0 has
characteristic equation r − 2r − 3 = (r + 1)(r − 3) = 0. So the
complementary solution is y = C e + C e 3t.
c 1 2
The nonhomogeneous equation has g(t) = e . It is an exponential
function, which does not change form after differentiation: an
exponential function’s derivative will remain an exponential function
with the same exponent (although its coefficient might change due to
the effect of the Chain Rule). Therefore, we can very reasonably
expect that Y(t) is in the form Ae for some unknown coefficient A.
Our job is to find this as yet undetermined coefficient.
Let Y = Ae 2t, thenY′ = 2Ae 2t, and Y″ = 4Ae 2. Substitute them
back into the original differential equation:
(4Ae ) − 2(2Ae ) − 3(Ae ) = e 2t 2t
−3Ae = et 2t
A = −1/3
Y(t) = −1 e 2t
Therefore, y = y +c = C e 1 −t +C e2− et 2t.
Thing to remember: When an exponential function appears in g(t), use an
exponential function of the same exponent for Y.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 5 2
Example: y″ − 2y′ − 3y = 3t + 4t − 5
The corresponding homogeneous equation is still y″ − 2y′ − 3y = 0.
Therefore, the complementary solution remains y = C e + C e 3t.
c 1 2
Now g(t) = 3t + 4t − 5. It is a degree 2 (i.e., quadratic) polynomial.
Since polynomials, like exponential functions, do not change form
after differentiation: the derivative of a polynomial is just another
polynomial of one degree less (until it eventuallyreaches zero). We
expect that Y(t) will, therefore, be a polynomial of the same degree as
that of g(t). (Why will their degrees be the same?)
So, we will let Y be a generic quadratic polynomial: Y = At + Bt +
C . It follows Y′ = 2At + B , and Y″ = 2A . Substitute them into the
(2A) − 2(2At + B) − 3(At + Bt + C) = 3t + 4t − 5
− 3At + (− 4A − 3B)t + (2A − 2B − 3C) = 3t + 4t − 5
The corresponding terms on both sides should have the same
coefficients, therefore, equating the coefficients of like terms.
t : 3 = − 3A A = −1
t : 4 = −4A − 3B → B = 0
1 : −5 = 2A − 2B − 3C C = 1
Therefore, Y = − t + 1 , and y = y c Y = C e +1C e − t 2 13t 2 .
Thing to remember: When a polynomial appears in g(t), use a generic
polynomial of the same degree for Y. That is Y = A t + An tn−1+ … + A t
n n−1 1
+ A 0. Note that if g(t) is a (nonzero) constant, it is considered a polynomial
of degree 0, and Y would therefore also be a generic polynomial of degree 0.
That is, Y is an arbitrary nonzero constant: Y = A .0Recall that the degree of
a polynomial is the highest power that appears. Therefore, the rule can be
stated a little differently to say that “look for the highest power of t in g(t),
then list it and all the lower powers (down to the constant term) in Y.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 6 Example: y″ − 2y′ − 3y = 5cos(2t)
Again, the same corresponding homogeneous equation as the previous
examples means that y c C 1 + C e 2s before.
The nonhomogeneous term is g(t) = 5cos(2t). Cosine and sine
functions do change form, slightly, when differentiated, but the
pattern is simple, predictable, and repetitive: their respective forms
just change to each other’s. Consequently, we should choose the form
Y = Acos(2t) + Bsin(2t) . (Why do we choose to employ both
cosine and sine?) Substitute Y, Y′ = −2Asin(2t) + 2Bcos(2t), and Y″ =
−4Acos(2t) − 4Bsin(2t) into the equation:
(−4Acos(2t) − 4Bsin(2t)) − 2(−2Asin(2t) + 2Bcos(2t)) − 3(Acos(2t) +
Bsin(2t)) = 5cos(2t)
(−4A − 4B − 3A)cos(2t) + (−4B + 4 A − 3B)sin(2t) = 5cos(2t)
(−7A − 4B)cos(2t) + (4 A − 7B)sin(2t) = 5cos(2t) + 0sin(2t)
Compare the coefficients:
cos(2t): 5 = −7A − 4B → A = −7/13
sin(2t): 0 = 4 A − 7B → B = −4/13
Therefore, Y = cos(2t)− sin(2 , and
−t 3t 7 4
y = C1e +C e 2 cos(2t)− sin(2t)
Thing to remember: When either cosine or sine appears in g(t), both cosine
and sine (of the same frequency) must appear in Y.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 7 When g(t) is a sum of several terms
When g(t) is a sum of several functions: g(t) = g 1(t) + g2(t) + … + g (tn, we
can break the equation into n parts and solve them separately. Given
y″ + p(t) y′ + q(t)y = g (t) + g (t) + … + g (t)
1 2 n
we change it into
y″ + p(t) y′ + q(t)y = g (t)
y″ + p(t) y′ + q(t)y = g 2t)
y″ + p(t)y′ + q(t)y = g (n).
Solve them individually to find respective particular solutions Y 1, Y 2, … , Y n.
Then add up them to get Y = Y + Y + … + Y .
1 2 n
Comment: The above is a consequence of the general version of the
Superposition Principle :
General Principle of Superposition: If y is a solution of the equation
y″ + p(t)y′ + q(t)y = g (t1,
and y 2s a solution of the equation
y″ + p(t)y′ + q(t)y = g (t2.
Then, for any pair of constants C and C1, the f2nction y = C y + C y is1a 1 2 2
solution of the equation
y″ + p(t)y′ + q(t)y = C g 1t)1+ C g (t2.2
*Note that when 1 (t)2= g (t) = 0, the above becomes the homogeneous linear equation version of the
Superposition Principle seen in an earlier section.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 8 2t 2
Example: y″ − 2y′ − 3y = e + 3t + 4t − 5 + 5cos(2t)
Solve each of the sub▯parts:
2t −1 2t
y″ − 2y′ − 3y = e → Y 1t) = e
y″ − 2y′ − 3y = 3t+ 4t − 5 → Y 2t) = − t + 1
y″ − 2y′ − 3y = 5cos(2t) → Y 3t) = cos(2t)− sin(2t)
Then add up the partial results:
−1 2t 2 7 4
Y(t) = 3 e −t +1− 13 cos(2t)−13 sin(2t).
The general solution is
−t 3t 1 2t 2 7 4
y(t) =C 1 +C e −2e −t +1− cos(2t)− sin(2t) .
3 13 13
© 2008, 2012 Zachary S Tseng B▯2 ▯ 9 If initial conditions are present, only apply the initial values after the general
solution is found to find the particular solution. While it might be tempting
to solve for the coefficients C an1 C as s2on as they appear (they would
appear with the complementary solution y , at the very beginning), we
nevertheless could not have found them without knowing Y. Since the initial
values consist of contribution from both parts y c and Y. Therefore, we must
wait until we have found the general solution in its entirety before applying
the initial values to find C 1and C .2
Example: y″ − 2y′ − 3y = 3t + 4t − 5, y(0) = 9, y′(0) = −4
First find the general solution: y = C e1+ C e − t2+ 1t 2 .
Then use the initial conditions to find that C = 7 1nd C = 1. 2
−t 3t 2
The particular solution is: y = 7e + e − t + 1 .
© 2008, 2012 Zachary S Tseng B▯2 ▯ 10 A (possible) glitch?
There is a complication that occurs under a certain circumstance…
Example: y″ − 2y′ − 3y = 5e
−t 3t 3t
The old news is that y = c e + 1 e . Sin2e g(t) = 5e , we should
be able to use the form Y = Ae , just like in the first example, right?
But if we substitute Y, Y ′ = 3Ae , and Y″ = 9Ae into the differential
equation and simplify, we would get the equation
0 = 5e .
That means there is no solution for A. Our method (that has worked
well thus far) seems to have failed. The same outcome (an inability to
find A) also happens when g(t) is a multiple of e . But, for any other
exponent our choice of the form for Y works. What i3tso spec−tl about
these two particular exponential functions, e and e , that causes our
method to misfire? (Hint: What is the complementary solution of the
The answer is that those two functions are exactlythe terms in y . Being a c
part of the complementary solution (the solution of the corresponding
homogeneous equation) means that any constant multiple of either functions
will ALWAYS results in zero on the right▯hand sideof the equation.
Therefore, it is impossible to match the given g(t).
The cure: The remedy is surprisingly simple: multiply our usual choice by
t. In the above example, we should instead use the form Y = Ate . 3t
In general, whenever your initial choice of the form of Y has any term in
common with the complementary solution, then you must alter it by
multiplying your initial choice of Y by t, as many times as necessary but no
more than necessary.
© 2008, 2012 Zachary S Tseng B▯2 ▯ 11 3t
Example: y″ − 6y′ + 9y = e
3t 3t 3t
The complementary solution is y = C c + C 1e . g(t)2= e ,
therefore, the initial choice would be Y = Ae . But wait, that is the
same as the first term of y c, so multiply Y by t to get Y = Ate .
However, the new Y is now in common with the second term of y . c
Multiply it by t again to get Y = A t e . That is the final, correct
choice of the general form of Y to use. (Exercise: Verify that neither
Y = Ae , nor Y = Ate would yield an answer to this problem.)
Once we have established that Y = At e 2 3t, then Y′ = 2Ate + 3t
2 3t 3t 3t 2 3t
3At e , and Y″ = 2Ae + 12Ate + 9At e . Substitute them
back into the original equation: