• No results found

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

Related documents