F08W07 PDF
F08W07 PDF
1. Non-Homogeneous Equations
2. The Method of Undetermined Coefficients
3. The Method of Variation of Parameters
1 Non-Homogeneous Equations
Consider the following non-homogeneous, second order linear differential equation:
In other words, the difference between any two solutions to a non-homogeneous equa-
tion is a solution to the homogeneous equation.
This gives us a useful approach to solving non-homogeneous equations:
1. Solve the corresponding homogeneous equation. This solution is sometimes
referred to as the complementary solution, and denoted yc .
2. Find (any) particular solution to the non-homogeneous equation. We will denote
this particular solution yp (t).
1
Then any solution to the non-homogeneous equation is of the form
Example:
Find the general solution to
y ′′ − 2y ′ − 3y = e2t ,
2. Duplicated Solutions
Example:
Let us attempt to solve y ′′ + 3y ′ + 2y = 5e2t . We first note that the homogeneous
equation
y ′′ + 3y ′ + 2y = 0
has characteristic equation r 2 + 3r + 2 = 0, which has roots r = −2 and r = −1, so
the complementary solution is
2
Now we attempt to guess a particular solution to the non-homogeneous equation.
Since the exponential function does not change much under differentiation, we will
guess a solution of the form
yp (t) = Ae2t
where A is our undetermined coefficient.
Now yp′ (t) = 2Ae2t and yp′′(t) = 4Ae2t , so when we plug yp into the non-homogeneous
equation, we get
This equation will be true if we have (4A + 6A + 2A) = 12A = 5, so A = 5/12. Thus,
5 2t
we have found a particular solution yp (t) = 12 e , so the general solution is
5 2t
y(t) = yc (t) + yp (t) = c1 e−t + c2 e−2t + e .
12
The method of undetermined coefficients will only work with a small selection of
non-homogeneous terms. If we have
then we can use the method in the following cases, if we choose the given form for
yp (t):
If g(t) is Try yp (t) =
3
if our g(t) is quadratic, we will have three constants to solve for, and if g(t) is cubic,
there will be four.
Example:
Solve 3y ′′ + y ′ − 2y = 2 cos(t). The complementary solution is
2t
yc (t) = c1 e 3 + c2 e−t .
Our particular solution should be yp (t) = A cos(t) + B sin(t), so yp′ (t) = −A sin(t) +
B cos(t) and yp′′(t) = −A cos(t) − B sin(t).
Plugging these in to the equation gives us
Thus we must have −5A + B = 2 and −5B − A = 0. Solving the second for A gives
A = −5B. Plugging back into −5A + B = 2 reveals that 26B = 2, or B = 1/13.
Then we have A = −5B = −5/13, so we have found a specific solution
−5 1
yp (t) = cos(t) + sin(t)
13 13
and the general solution is
2t −5 1
y(t) = yc (t) + yp (t) = c1 e 3 + c2 e−t + cos(t) + sin(t).
13 13
4
If g(t) is Use yp (t) =
(cn tn + cn−1 tn−1 + · · · + c0 )ekt (An tn + An−1 tn−1 + · · · + A0 )ekt
(a polynomial times an exponential func- (another polynomial times an exponential
tion) function)
c sin(bt)eat or c cos(bt)eat eat (A cos(bt) + B sin(bt))
(sines or cosines times exponential func- (a product of an exponential function times
tions) a linear combination of sine and cosine)
(cn tn + cn−1 tn−1 + · · · + c0 ) sin(bt) or (An tn + An−1 tn−1 + · · · + A0 ) cos(bt) +
(cn tn + cn−1 tn−1 + · · · + c0 ) cos(bt) (Bn tn + Bn−1 tn−1 + · · · + B0 ) sin(bt)
(a polynomial times sine or cosine) (a polynomial times sine and another times
cosine)
n n−1 at
(cn t + cn−1 t + · · · + c0 )e sin(bt) or (An tn + An−1 tn−1 + · · · + A0 )eat cos(bt) +
(cn tn + cn−1 tn−1 + · · · + c0 )eat cos(bt) (Bn tn + Bn−1 tn−1 + · · · + B0 )eat sin(bt)
(All three together–whoopee!) (what you would expect)
(See 3.8 on p. 163 of the text for a complete summary of which terms to use. Also
note that again, there will be a special case if part of your complementary solution
shows up in your proposed yp .)
Example:
If the non-homogeneous term is g(t) = t3 e−5t , we should try for a particular solution
of the form
yp (t) = (At3 + Bt2 + Ct + D)e−5t .
What if we have a sum of non-homogeneous terms of the types already mentioned?
So assume g(t) = g1 (t) + g2 (t). Then if yp1 is a solution to y ′′ + py ′ + qy = g1 and yp2
is a solution to y ′′ + py ′ + qy = g2 , it is clear that
(yp1 + yp2 )′′ + p(t)(yp1 + yp2)′ + q(t)(yp1 + yp2 ) = g1 (t) + g2 (t) = g(t).
So we can either solve each problem separately, or we can string a sequence of forms
for yp (t) together into one long solution and attempt to solve for all the constants at
once.
Example:
If the non-homogeneous term is g(t) = te2t cos(3t) + et sin(2t), then our particular
solution is of the form
yp (t) = (At + B)e2t cos(3t) + (Ct + D)e2t sin(3t) + Eet sin(2t) + F et cos(2t).
Alternatively, we could first find out what constants A, B, C, and D would make
yp1 (t) = (At + B)e2t cos(3t) + (Ct + D)e2t sin(3t)
a solution to our differential equation, then solve for E and F separately to make
yp2(t) = Eet sin(2t) + F et cos(2t)
5
a solution. Then our specific solution would be yp (t) = yp1(t) + yp2 (t).
Example:
4 Duplicated Solutions
The method of undetermined coefficients will fail to give us a solution if our proposed
particular solution contains elements of the complementary solution.
Example:
We will attempt to solve y ′′ + 3y ′ + 2y = 5e−2t using undetermined coefficients. Note
that the complementary solution is c1 e−t + c2 e−2t .
Our proposed non-homogeneous solution is of the form yp (t) = Ae−2t , but this will
fail, as it contains a homogeneous solution:
6
Setting this equal to 5e−2t , we finally get A = −5, and we have the specific solution
yp (t) = −5te−2t
Example:
Solve y ′′ + 4y ′ = t2 + te−4t .
First solve the homogeneous equation: y ′′ + 4y ′ = 0 gives us characteristic equation
r 2 + 4r = 0, so r = 0 or r = −4. Thus the complementary solution is
yc (t) = c1 + c2 e−4t .
We can look at each term of the non-homogeneous term separately. For the term
g1 (t) = t2 , we get a specific solution of the form yp1 (t) = A2 t2 + A1 t + A0 . Does this
duplicate our complementary solution?
Yes! It duplicates the constant term. So we adjust our first guess to
12A2 = 1
8A1 + 6A2 = 0
4A0 + 2A1 = 0
7
and plugging this into y ′′ + 4y ′ = te−4t gives us
1. Cramer’s Rule
2. Variation of Parameters
6 Cramer’s Rule
We start with a brief review of Cramer’s rule, which tells us how to solve a system
in terms of matrices. Cramer’s rule will be helpful in remembering how to carry out
variation of parameters.
In order to solve the system
ax + by = m
cx + dy = n
In other words, to solve for x, we take the coefficient matrix and replace the x column
with the result (the right hand side of the equations.) Then we take the determinant
and divide by the determinant of the coefficient matrix.
8
To solve for y, we do the same thing, except we replace the y column with the result
column.
Example:
Solve
2x + 3y = 7
4x − 8y = 3
Here we have
7 3
3 −8 −56 − 9 65
x= = =
2 3
−16 − 12 28
4 −8
and
2 7
4 3 6 − 28 22 11
y = = = =
2 3
−28 28 14
4 −8
7 Variation of Parameters
Suppose we have found a set of fundamental solutions y1 and y2 for the homogeneous
equation
y ′′ + p(t)y ′ + q(t)y = 0,
so that the solutions look like y(t) = c1 y1 (t) + c2 y2 (t). How can we find a solution to
the non-homogeneous equation
9
We no longer have a solution to the homogeneous equation, but we may be able to
find functions u1 and u2 for which this y will be a solution to the non-homogeneous
equation.
We calculate y ′ (t), and begin to run into trouble:
y ′ (t) = u1 (t)y1′ (t) + u′1 (t)y1 (t) + u′2 (t)y2 (t) + u2 (t)y2′ (t)
This is a mess and the second derivative will be much worse. Let us introduce the
following additional condition on u′1 and u′2 :
u′1 (t)y1 (t) + u′2 (t)y2 (t) = 0 (1)
We emphasize the following: We have chosen to add the above condition because it
simplifies the equation. It is not added because of any feature of the original equation.
Now we continue:
y ′(t) = u1 (t)y1′ (t) + u2 (t)y2′ (t)
y ′′(t) = u′1 (t)y1′ (t) + u1 (t)y1′′ (t) + u′2 (t)y2′ (t) + u2 (t)y2′′(t)
Plugging these into the non-homogeneous equation yields the following:
y ′′ + p(t)y ′ + q(t)y =
[u′1 (t)y1′ (t) + u1 (t)y1′′ (t) + u′2 (t)y2′ (t) + u2 (t)y2′′ (t)] +
p(t) [u1(t)y1′ (t) + u2 (t)y2′ (t)] +
q(t) [u1 (t)y1 (t) + u2 (t)y2 (t)]
If we collect like terms on u1 and u2 , we get the following:
y ′′ + p(t)y ′ + q(t)y =
u1 (t) [y1′′(t) + p(t)y1′ (t) + q(t)y1 (t)] +
u2 (t) [y2′′(t) + p(t)y2′ (t) + q(t)y2 (t)] +
u′1 (t)y1′ (t) + u′2 (t)y2′ (t)
But since y1 and y2 are solutions to the homogeneous equation, the coefficients on u1
and u2 are zero, and in fact we have that if y(t) = u1 (t)y1 (t) + u2 (t)y2 (t), then
y ′′ + p(t)y ′ + q(t)y = u′1 (t)y1′ (t) + u′2 (t)y2′ (t).
Thus we must have
u′1 (t)y1′ (t) + u′2 (t)y2′ (t) = g(t) (2)
Now equation (??) and equation (??) above form a set of two equations in the two
unknowns u′1 (t) and u′2 (t), which we can then attempt to solve. Cramer’s rule says
that the system
u′1 (t)y1 (t) + u′2 (t)y2 (t) = 0
u′1 (t)y1′ (t) + u′2 (t)y2′ (t) = g(t)
10
can be solved for u′1 and u′2 as follows:
0 y2 (t)
g(t) y2′ (t) −y2 (t)g(t)
u′1 (t) = =
y (t)
1 y2 (t) W (y1 , y2 )
y1 (t) y2′ (t)
′
and
y (t) 0
1
y (t) g(t)
′
y1 (t)g(t)
1
u′2 (t) = =
y (t)
1 y2 (t) W (y1 , y2 )
y1 (t) y2′ (t)
′
This is ok, because the Wronskian is non-zero. (Why? Because y2 and y2 are a
fundamental set of solutions.)
So we finally have a specific solution, after performing some integrations:
y2 (t)g(t) y1 (t)g(t)
Z Z
Y (t) = −y1 (t) dt + y2 (t) dt.
W (y1, y2 ) W (y1, y2 )
y ′′ − 3y ′ + 2y = 0
yc (t) = c1 et + c2 e2t
11
and
1 1
u′1 y1′ + u′2 y2′ = or u′1 et + u′2 2e2t =
1+e −t 1 + e−t
Thus, solving for u′1 and u′2 using Cramer’s rule, we get
0 e2t
e 2t
1 − 1+e
2e2t e−t
1+e
−t
u′1 =
−t
t
= =−
e e2t
(e3t ) 1 + e−t
et 2e2t
and
et 0
1
et
!
et e−2t
1+e−t
u′2 = = e−3t
=
et e 2t
1 + e−t 1 + e−t
et 2e2t
So now we integrate:
−e−t u = 1 + e−t
Z
u1 (t) = dt, so we let
1 + e−t du = −e−t dt
which gives us
1
Z
u1 (t) =du = ln(1 + e−t ) + C1
u
Now note: We do not need the C1 ! When we take u1 (t)y1 (t), we will get a Cy1 (t)
term, which is a homogeneous solution, and thus will give zero when we plug this into
the differential equation.
Therefore, we take u1 (t) = ln(1 + e−t ).
Similarly,
Z
e−2t u = e−t
u2 (t) = dt, so we so set
1 + e−t du = −e−t dt
Here we get
e−t (−e−t dt) u
Z Z
u2 (t) = − =− du
1 + e−t 1+u
We can reduce this by division to
u 1
Z Z
− du = − 1− du = −u + ln |1 + u| + C = −e−t + ln(1 + e−t ) + C2
1+u 1+u
We discard the constant C2 for the same reason we discarded the C1 , and we get
12
So the general solution must be
h i
y(t) = yc (t) + Y (t) = c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t ) − e−t e2t
Notice by the way that if we had chosen to leave constants C1 and C2 after integrating
u′1 and u′2 , we would in fact have the general solution when we computed
We could also simplify our answer algebraically to be much shorter, since several
terms will cancel or can be grouped together:
h i
y(t) = c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t ) − e−t e2t
= c1 et + c2 e2t + ln(1 + e−t )et + ln(1 + e−t )e2t − et
h i h i
= c1 + ln(1 + e−t ) et + c2 + ln(1 + e−t ) e2t
u′1 y1′ + u′2 y2′ = sec(t) tan(t) or − u′1 sin(t) + u′2 cos(t) = sec(t) tan(t).
u′1 (t) =
and
u′2 (t) =
So we get
u1 (t) =
13
and
u2 (t) =
Y (t) =
y(t) =
14