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