You are on page 1of 8

Math 201 Lecture 10: Variation of Parameters

Jan. 30, 2012

• Many examples here are taken from the textbook. The first number in () refers to the problem number
in the UA Custom edition, the second number in () refers to the problem number in the 8th edition.

0. Review
• The method of undetermined coefficients allow us to solve equations of the type
a y ′′ + b y ′ + c y = f (t) (1)
with f (t) of special forms:

f (t) = Pm(t) ert or f (t) = Pm(t) eαt cosβ t + Qn(t) eαt sinβ t or Sum of such terms (2)

• It should be emphasized again that the method only works when


1. The equation is constant-coefficient (a, b, c are constants)
2. f (t) is of special form.
• To procedure goes:
1. Solve the characteristic equation of the homogeneous equation, write down the list of roots.
Organize complex roots in conjugate pairs.
2. Guess yp according to:
◦ If f (t) = C Pm(t) ert, then
yp = ts (Am tm +
+ A1 t + A0) ert (3)
with s=the number of times r appears in the list of roots r1, r2.
◦ If f (t) = Pm(t) eαt cosβ t + Qn(t) eαt sinβ t, then

y p = ts(Ak tk +
+ A1 t + A0) eαt cosβ t + ts (Bk tk +
+ B0) eαt sinβ t. (4)

with s = the number of times the pair (α ± β i) appears in the list of roots r1, r2, and
k = max {m, n} that is the bigger number of m, n.
◦ If f (t) = f1 +
+ fk with each fi of one of the above form, then find y p i for each
a y ′′ + b y ′ + c y = fi(t) (5)
and set yp = y p1 +
+ yp k.
3. Substitute yp into the equation to find all the constants.
4. Write down the final answer.
• Quiz:
y ′′ − y ′ = cos t + 1. y(0) = y ′(0) = 0. (6)
Solution. First notice that f (t) = cos t + 1 is of the form f = f1 + f2 with
f1 = cos t, f2 = 1 (7)
1. Solve


y ′′ − y ′ = 0. (8)
Characteristic equation r 2 − r = 0 r1 = 0, r2 = 1. So y1 = 1, y2 = et.

1
2 Math 201 Lecture 10: Variation of Parameters

2. Find y p.
◦ yp1. y p1 is a particular solution to
y ′′ − y ′ = cos t. (9)
Writing
cos t = t0 e0t cos t (10)
we see that
y p1 = ts A cos t + ts B sin t. (11)
As α ± i β = 0 ± i = ±i does not appear in r1, r2, we have s = 0. So
y p1 = A cos t + B sin t. (12)
To get A, B, substitute the above into the equation:
′′ ′
cos t = y p1 − yp1 = −A cos t − B sin t + A sin t − B cos t = (A − B) sin t − (A + B) cos t (13)


So
1
A − B = 0, −(A + B) = 1 A=B =− . (14)
2
So
1
y p1 = − (sin t + cos t). (15)
2
◦ yp2. y p2 is a particular solution to
y ′′ − y ′ = 1. (16)
Writing
1 = t0 e0t (17)
we see that
y p2 = ts A. (18)
To determine s we check the number of times 0 appears in the list r1, r2: We get s = 1. So
yp2 = A t. (19)
Substituting this into the equation we get A = −1.
So
1
y p = − (sin t + cos t) − t. (20)
2
3. The general solution is
1
y = C1 + C2 et − (sin t + cos t) − t. (21)
2
4. To solve the initial value problem, we prepare
1
y ′ = C2 et − (cos t − sin t) − 1. (22)
2


So
1
y(0) = 0 C1 + C2 − =0 (23)
2

y ′(0) = 0 C2 −
3
2
= 0. (24)
So
3
C1 = −1, C2 = . (25)
2
5. Summarizing, we have the final answer:
3 t 1
y = −1 + e − (sin t + cos t) − t. (26)
2 2
Jan. 30, 2012 3

1. Basic Information
• The Equation:
Still
a y ′′ + b y ′ + c y = f (t) (27)
But with f (t) subject to no restriction.

Remark 1. We will see in the next lecture that the following method actually works for the more
general case
a(t) y ′′ + b(t) y ′ + c(t) y = f (t) (28)

(Yes this is the general 2nd order linear equation).

• How to get general solution


1. Solve the homogeneous equation, get y1, y2.
2. Calculate a particular solution using the following formula:
y p = v1 y1 + v2 y2 (29)
with Z Z
−f (t) y2(t) f (t) y1(t)
v1 = , v2 = (30)
a [y1 y2′ − y1′ y2] a [y1 y2′ − y1′ y2]

See “Notes and Comments” for derivation of these two formulas.

Remark 2. Note that y1 y2′ − y1′ y2 is the Wronskian of the two solutions y1, y2:
 
y1 y2
W [y1, y2](t) = det = y1 y2′ − y1′ y2. (31)
y1′ y2′

Further note that y1 y2′ − y1′ y2 is guarantee to be nonzero due to the following result:


If y1, y2 are solution to the same 2nd order homogeneous linear equation, then

y1, y2 linearly independent W [y1, y2]  0. (32)

3. Write down the final answer


y = C1 y1 + C2 y2 + y p = C1 y1 + C2 y2 + v1 y1 + v2 y2. (33)
4. Simplify.1
◦ Example: Solve
2 et
y ′′ − 2 y ′ + y = . (34)
t
Solution. First we notice that the right hand side makes it impossible to apply undetermined
coefficients.
Now we apply variation of parameters.


1. Solve the homogeneous equation
y ′′ − 2 y ′ + y = 0 y1 = et , y2 = t et. (35)
2. Calculate:
a [y1 y2′ − y1′ y2] = 1 [et (et + t et) − et t et] = e2t. (36)

1. It may happen that v1, v2 contain some constants, say v1 = 6 t + 5. Then the 5 y1 can be combined into the C1 y1 term.
4 Math 201 Lecture 10: Variation of Parameters

2 et
As f (t) = t
we have
Z
−f (t) y2(t)
v1 =
a [y1 y2′ − y1′ y2]
−(2 et/t) t et
Z Z
= = −2 = −2 t. (37)
e2t
Z
f (t) y1(t)
v2 = ′ ′
a [y 1 y2 − y1 y2 ]
t t
Z Z
(2 e /t) e 2
= = = 2 ln |t|. (38)
e2t t
3. The general solution is then
y = C1 y1 + C2 y2 + y p = C1 y1 + C2 y2 + v1 y1 + v2 y2 = C1 et + C2 t et − 2 t et +
2 ln |t| t et. (39)

4. Simplify:
y = C1 et + C2 t et − 2 t et + 2 ln |t| t et
= C1 et + (C2 − 2) t et + 2 ln |t| t et. (40)
As C2 stands for an arbitrary constant, so does C2 − 2. So we can write the general
solution as
y = C1 et + C2 t et + 2 ln |t| t et. (41)

• How to solve initial value problem (IVP)


◦ Nothing new.
◦ Example: Solve
2 et
y ′′ − 2 y ′ + y = , y(1) = 0, y ′(1) = 1. (42)
t
Solution. As usual, an initial value problem is solved by first getting the general solution,
then apply the initial conditions. The general solution is already obtained as
y = C1 et + C2 t et + 2 ln |t| t et. (43)
To apply the initial conditions, we prepare
y ′ = C1 et + C2 et + C2 t et + 2 et + 2 ln |t| et + 2 ln |t| t et. (44)


Now the initial conditions lead to


y(1) = 0 C1 e + C2 e = 0. (45)
y ′(1) = 0 C1 + 2 C2 + 2 = 1. (46)
Solving this we obtain
C1 = 1, C2 = −1. (47)
So the answer is
y = et − t et + 2 ln |t| t et. (48)
• How to check solutions
◦ Nothing new: Substitute y = C1 et + C2 t et + 2 ln |t| t et into the equation.

2. Things to be Careful/Tricky Issues


See “Common Mistakes” for examples.
• Fail to be consistent in which is y1 and which is y2.
Jan. 30, 2012 5

• Forget to simplify.

3. More Examples
• Example: (4.6 1; 4.6 2) Find the general solution to the differential equation
y ′′ + 4 y = tan 2 t. (49)
Solution. We need to do two things: finding general solution to the homogeneous equation, and
finding one particular solution to the nonhomogeneous equation.

 
◦ General solution to the homogeneous problem. The auxiliary equation is
r2 + 4 = 0 r1 = 2 i, r2 = −2 i z1 = e2it = cos2 t + i sin2 t, z2 = cos 2 t − i sin 2 t. (50)
Thus the general solution to the homogeneous equation is given by
C1 cos 2 t + C2 sin 2 t. (51)

◦ Particular solution to the nonhomogeneous problem. As the right hand side is tan 2 t, it is
not possible to use the method of undetermined coefficients. We use variation of parameters
instead. We have
sin 2 t
y1 = cos 2 t, y2 = sin 2 t, f (t) = tan 2 t = , a = 1. (52)
cos 2 t
We compute
y1 y2′ − y1′ y2 = 2. (53)
Thus the equations for v1, v2 are
sin22 t
Z Z Z Z
−f (t) y2(t) 1 f (t) y1(t) 1
v1 = ′ ′ = − , v2 = ′ ′ = sin 2 t. (54)
a [y1 y2 − y1 y2] 2 cos 2 t a [y1 y2 − y1 y2] 2
Integrating, we have
sin22 t
Z
1
v1(t) = − dt
2 cos 2 t
1 − cos22 t
Z
1
= − dt
2Z cos 2 t Z
1 1 1
= − dt + cos 2 t dt. (55)
2 cos 2 t 2
We evaluate Z
1 1
cos 2 t dt = sin 2 t. (56)
2 4
Z Z
1 1 1 cos 2 t
− dt = − dt
2 cos 2 t 2 Z cos22 t
1 d sin 2 t
= −
4  1 − sin2 2 t 
Z Z
1 dsin 2 t d sin 2 t
= − +
8 1 − sin 2 t 1 + sin 2 t
1
= − [ln |1 + sin 2 t| − ln |1 − sin 2 t|]. (57)
8
Thus
sin22 t
Z
1 1
v1(t) = dt = − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] + sin 2 t. (58)
cos 2 t 8 4
On the other hand, Z
1 1
v2(t) = sin 2 t dt = − cos 2 t. (59)
2 4
6 Math 201 Lecture 10: Variation of Parameters

Putting things together, we have


yp(t) = v1 y1 + v2 y2
 
1 1
= − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] + sin 2 t cos 2 t
8 4
1
− cos 2 t sin 2 t
4
1
= − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t. (60)
8
Summarizing, we have
1
y = C1 cos 2 t + C2 sin 2 t − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t. (61)
8
• Usually, when the method of “undetermined coefficients” applies, it will yield the answer faster than
variation of parameters. So sometimes it is a good idea to combine the two methods (Thanks to
linearity!).

Example 3. Solve
y ′′ + 4 y = tan 2 t + e3t (62)
Solution.

 
First solve the homogeneous equation:
y ′′ + 4 y = 0 r1,2 = ±2 i C1 cos 2 t + C2 sin 2 t. (63)
To find y p we notice that tan 2 t is the “bad term” while e3t − 1 fits the framework of undetermined
coefficients. So we break things up:
y p = y p1 + y p2 (64)
with
′′
y p1 + 4 y p1 = tan 2 t (65)
′′
yp2 + 4 y p2 = e3t (66)

◦ Get y p1: We have already done that in the last example:


1
yp1 = − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t. (67)
8
◦ Get y p2: We have
y p2 = ts A e3t. (68)
To determine s check how many times 3 appears in the roots list ±2 i: zero. So s = 0 and
yp2 = A e3t. Substituting into the equation gives

9 A e3t + 4 A e3t = e3t  A=


1
13
. (69)
So
1 3t
y p2 = e . (70)
13
Summarizing, we have
1 1 3t
yp = − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t + e (71)
8 13
and the general solution is then
1 1 3t
y = C1 cos 2 t + C2 sin 2 t − [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t + e . (72)
8 13
To check solution,
◦ Check that cos 2 t, sin 2 t indeed solves the homogeneous equation y ′′ + 4 y = 0;
Jan. 30, 2012 7

1 1
◦ Check that − 8 [ln |1 + sin 2 t| − ln |1 − sin 2 t|] cos 2 t + 13 e3t solves the original equation.

4. Notes and Comments


• Deriving the formulas
Z Z
−f (t) y2(t) f (t) y1(t)
v1 = , v2 = (73)
a [y1 y2′ − y1′ y2] a [y1 y2′ − y1′ y2]
Start from
y p(t) = v1(t) y1(t) + v2(t) y2(t). (74)
Substituting this into the nonhomogeneous equation, we obtain
f (t) = a y ′′ + b y ′ + c y
′′ ′
= a [v1 y1 + v2 y2] + b [v1 y1 + v2 y2] + c [v1 y1 + v2 y2]
= a [v1′′ y1 + 2 v1′ y1′ + v1 y1′′ + v2′′ y2 + 2 v2′ y2′ + v2 y2′′]
+b [v1′ y1 + v1 y1′ + v2′ y2 + v2 y2′ ] + c [v1 y1 + v2 y2]
= v1 [a y1′′ + b y1′ + c y1] + v2 [a y2′′ + b y2′ + c y2]
+a [v1′′ y1 + 2 v1′ y1′ + v2′′ y2 + 2 v2′ y2′ ] + b [v1′ y1 + v2′ y2]
= a [v1′′ y1 + 2 v1′ y1′ + v2′′ y2 + 2 v2′ y2′ ] + b [v1′ y1 + v2′ y2]. (75)
Thus as long as we can find v1, v2 such that
a [v1′′ y1 + 2 v1′ y1′ + v2′′ y2 + 2 v2′ y2′ ] + b [v1′ y1 + v2′ y2] = f (t), (76)
we are done.
This equation is quite complicated. We need to simplify it. Note that we have two unknowns v1,
v2 and just one equation, it is likely that we can require v1, v2 to satisfy another equation without
losing existence of solutions.
One good choice is requiring
v1′ y1 + v2′ y2 = 0. (77)
Note that this not only makes the term containing b vanish, but also greatly simplify the first term
through

0 = (v1′ y1 + v2′ y2) = v1′′ y1 + v1′ y1′ + v2′′ y2 + v2′ y2′ . (78)
Thus our equations for v1, v2 are
a [v1′ y1′ + v2′ y2′ ] = f (t) (79)
v1′ y1 + v2′ y2 = 0. (80)
Rewrite this system to
y1′ v1′ + y2′ v2′ = f (t)/a (81)
y1 v1′ + y2 v2′ = 0. (82)
This system admits a unique solution when y1, y2 are linearly independent.2 The solution is given by
−f (t) y2(t) f (t) y1(t)
v1′ = , v2′ = . (87)
a [y1 y2′ − y1′ y2] a [y1 y2′ − y1′ y2]

2. Recall from linear algebra that the system

ax+by = e (83)
cx+dy = f (84)

has a unique solution for all e, f if and only if


 
= a d − b c  0.
a b
det (85)
c d
8 Math 201 Lecture 10: Variation of Parameters

Then v1, v2 can be obtained from integrating the above.


• Comparison of the two methods:

Undetermined Coefficients Variation of Parameters


Applicable to Some f All f
Need to solve a y ′′ + b y ′ + c y = 0? Almost Yes
Complexity of calculation Low High
Extension to variable coefficient equations? No Yes
Table 1. Solving a y ′′ + b y ′ + c y = f (t), UC vs. VP.

• For equations with constant coefficients, we will introduce a third method, the method of Laplace
transform, which is in some sense in between the current two methods: Simpler calculation than
variation of parameters, but more complicated than undetermined coefficients, etc.
• Although variation of parameters can be extended to variable coefficient equations, in practice it is
rarely used for the following reasons:
◦ There is no good method getting formulas for solutions y1, y2 of the homogeneous equation
a(t) y ′′ + b(t) y ′ + c(t) y = 0. Such formulas may not even exist;
◦ The “series” method (Chapter 8) can get y1, y2 in the form of infinite sums. But they are hard
to use in variation of parameters. Furthermore the same “series” method can get y p directly
without much more difficulty than getting y1, y2 anyway.

When this is the case, the unique solution is given by Cramer’s rule
   
e b a e
det f d
det c f
x=  , y=  . (86)
a b a b
det c d
det c d

You might also like