Higher order linear ODEs
Exercise 2.5.1 Check that
Note: A common mistake is to solve for constants using the initial conditions with π¦π
and only add the particular solutionπ¦π after that. That willnotwork. You need to first
compute π¦= π¦π +π¦π andonly thensolve for the constants using the initial conditions.
A right-hand side consisting of exponentials, sines, and cosines can be handled similarly. For example,
π¦00+
2π¦0+2π¦ =cos(2π₯).
Let us find someπ¦π. We start by guessing the solution includes some multiple of cos(2π₯).
We may have to also add a multiple of sin(2π₯)to our guess since derivatives of cosine are sines. We try
We plugπ¦πinto the equation and we get β4π΄cos(2π₯) β4π΅sin(2π₯) | {z } π¦00 π +2 β2π΄sin(2π₯) +2π΅cos(2π₯) | {z } π¦0 π +2 π΄cos(2π₯) +2π΅sin(2π₯) | {z } π¦π =cos(2π₯), or
(β4π΄+4π΅+2π΄)cos(2π₯) + (β4π΅β4π΄+2π΅)sin(2π₯)=cos(2π₯).
The left-hand side must equal to right-hand side. Namely, β4π΄ +4π΅ + 2π΄ = 1 and β4π΅β4π΄+2π΅ =0. Soβ2π΄+4π΅=1 and 2π΄+π΅ =0 and henceπ΄=β1/10andπ΅=1/5. So
π¦π =π΄cos(2π₯) +π΅sin(2π₯)= βcos(2π₯) +2 sin(2π₯)
10 .
Similarly, if the right-hand side contains exponentials we try exponentials. If πΏπ¦ = π3π₯,
we try π¦ =π΄π3π₯ as our guess and try to solve forπ΄.
When the right-hand side is a multiple of sines, cosines, exponentials, and polynomials, we can use the product rule for differentiation to come up with a guess. We need to guess a form for π¦π such thatπΏπ¦π is of the same form, and has all the terms needed to for the
right-hand side. For example,
πΏπ¦ =(1+3π₯2)πβπ₯cos(ππ₯). For this equation, we guess
π¦π =(π΄+π΅π₯+πΆπ₯2)πβπ₯cos(ππ₯) + (π·+πΈπ₯+πΉπ₯2)πβπ₯sin(ππ₯).
We plug in and then hopefully get equations that we can solve forπ΄, π΅,πΆ,π·,πΈ, andπΉ. As you can see this can make for a very long and tedious calculation very quickly. Cβest la vie! There is one hiccup in all this. It could be that our guess actually solves the associated homogeneous equation. That is, suppose we have
π¦00β
9π¦= π3π₯.
We would love to guessπ¦ =π΄π3π₯, but if we plug this into the left-hand side of the equation we get
π¦00β
9π¦ =9π΄π3π₯β9π΄π3π₯ =0β π3π₯.
There is no way we can chooseπ΄to make the left-hand side beπ3π₯. The trick in this case is to multiply our guess byπ₯to get rid of duplication with the complementary solution. That is first we compute π¦π (solution toπΏπ¦ =0)
π¦π =πΆ1πβ3π₯+πΆ 2π3π₯,
and we note that theπ3π₯term is a duplicate with our desired guess. We modify our guess toπ¦ =π΄π₯π3π₯ so that there is no duplication anymore. Let us try: π¦0= π΄π3π₯+3π΄π₯π3π₯and π¦00
=6π΄π3π₯+9π΄π₯π3π₯, so
π¦00β
9π¦ =6π΄π3π₯+9π΄π₯π3π₯β9π΄π₯π3π₯ =6π΄π3π₯.
Thus 6π΄π3π₯ is supposed to equalπ3π₯. Hence, 6π΄=1 and soπ΄=1/6. We can now write the general solution as
π¦ = π¦π+π¦π =πΆ1πβ3π₯+πΆ2π3π₯+ 1 6π₯π
3π₯.
It is possible that multiplying byπ₯does not get rid of all duplication. For example, π¦00β
6π¦0+9π¦ =π3π₯.
The complementary solution isπ¦π = πΆ1π3π₯+πΆ2π₯π3π₯. Guessing π¦= π΄π₯π3π₯would not get us anywhere. In this case we want to guess π¦π = π΄π₯2π3π₯. Basically, we want to multiply our guess byπ₯until all duplication is gone. But no more! Multiplying too many times will not work.
Finally, what if the right-hand side has several terms, such as πΏπ¦ =π2π₯+cosπ₯.
In this case we findπ’ that solvesπΏπ’ = π2π₯ andπ£ that solves πΏπ£ = cosπ₯ (that is, do each
term separately). Then note that if π¦ = π’+π£, thenπΏπ¦ = π2π₯+cosπ₯. This is because πΏis linear; we haveπΏπ¦ =πΏ(π’+π£)=πΏπ’+πΏπ£ =π2π₯+cosπ₯.
2.5.3
Variation of parameters
The method of undetermined coefficients works for many basic problems that crop up. But it does not work all the time. It only works when the right-hand side of the equation πΏπ¦ = π(π₯)has finitely many linearly independent derivatives, so that we can write a guess
that consists of them all. Some equations are a bit tougher. Consider π¦00+π¦
=tanπ₯.
Each new derivative of tanπ₯looks completely different and cannot be written as a linear combination of the previous derivatives. If we start differentiating tanπ₯, we get:
sec2π₯, 2 sec2π₯ tanπ₯, 4 sec2π₯ tan2π₯+2 sec4π₯,
8 sec2π₯ tan3π₯+16 sec4π₯ tanπ₯, 16 sec2π₯ tan4π₯+88 sec4π₯tan2π₯+16 sec6π₯, . . .
This equation calls for a different method. We present the method of variation of parameters, which handles any equation of the form πΏπ¦ = π(π₯), provided we can solve certain integrals. For simplicity, we restrict ourselves to second order constant coefficient
equations, but the method works for higher order equations just as well (the computations become more tedious). The method also works for equations with nonconstant coefficients, provided we can solve the associated homogeneous equation.
Perhaps it is best to explain this method by example. Let us try to solve the equation πΏπ¦ =π¦00+π¦ =tanπ₯.
First we find the complementary solution (solution toπΏπ¦π =0). We getπ¦π =πΆ1π¦1+πΆ2π¦2, where π¦1 = cosπ₯ and π¦2 = sinπ₯. To find a particular solution to the nonhomogeneous
equation we try
π¦π = π¦ =π’1π¦1+π’2π¦2,
whereπ’1and π’2arefunctionsand not constants. We are trying to satisfyπΏπ¦ =tanπ₯. That
gives us one condition on the functionsπ’1and π’2. Compute (note the product rule!)
π¦0 =(π’01π¦1+π’0 2π¦2) + (π’1π¦ 0 1+π’2π¦ 0 2).
We can still impose one more condition at our discretion to simplify computations (we have two unknown functions, so we should be allowed two conditions). We require that
(π’0
1π¦1+π’ 0
2π¦2)=0. This makes computing the second derivative easier.
π¦0 =π’1π¦10 +π’2π¦0 2, π¦00 =(π’10π¦01+π’0 2π¦ 0 2) + (π’1π¦ 00 1 +π’2π¦ 00 2).
Sinceπ¦1andπ¦2are solutions toπ¦00+π¦ =0, we findπ¦001 =βπ¦1andπ¦002 =βπ¦2. (If the equation
was a more general π¦00+π(π₯)π¦0+π(π₯)π¦ =0, we would haveπ¦00π =βπ(π₯)π¦0πβπ(π₯)π¦π.) So
π¦00 =(π’01π¦01+π’0 2π¦ 0 2) β (π’1π¦1+π’2π¦2). We have(π’1π¦1+π’2π¦2)= π¦and so π¦00 =(π’10π¦01+π’0 2π¦ 0 2) βπ¦, and hence π¦00+π¦ = πΏπ¦ =π’01π¦01+π’0 2π¦ 0 2.
For π¦to satisfyπΏπ¦ = π(π₯)we must have π(π₯)=π’10π¦10 +π’0
2π¦ 0 2.
What we need to solve are the two equations (conditions) we imposed onπ’1andπ’2:
π’0 1π¦1+π’ 0 2π¦2=0, π’0 1π¦ 0 1+π’ 0 2π¦ 0 2= π(π₯).
We solve forπ’01andπ’20 in terms of π(π₯),π¦1andπ¦2. We always get these formulas for any
πΏπ¦ = π(π₯), whereπΏπ¦ = π¦00+π(π₯)π¦0+π(π₯)π¦
could just plug into, but instead of memorizing that, it is better, and easier, to just repeat what we do below. In our case the two equations are
π’0