[Notes on Diffy Qs home] [PDF version] [Buy paperback on Amazon]

[next] [prev] [prev-tail] [tail] [up]

Note: 2 lectures, §3.5 in [EP], §3.5 and §3.6 in [BD]

We have solved linear constant coeﬃcient homogeneous equations. What about nonhomogeneous linear ODEs? For example, the equations for forced mechanical vibrations. That is, suppose we have an equation such as

(2.6) |

We will write when the exact form of the operator is not important. We solve (2.6) in the following manner. First, we ﬁnd the general solution to the associated homogeneous equation

(2.7) |

We call the complementary solution. Next, we ﬁnd a single particular solution to (2.6) in some way. Then

is the general solution to (2.6). We have and . As is a linear operator we verify that is a solution, . Let us see why we obtain the general solution.

Let and be two diﬀerent particular solutions to (2.6). Write the diﬀerence as . Then plug into the left hand side of the equation to get

Using the operator notation the calculation becomes simpler. As is a linear operator we write

So is a solution to (2.7), that is . Any two solutions of (2.6) diﬀer by a solution to the homogeneous equation (2.7). The solution includes all solutions to (2.6), since is the general solution to the associated homogeneous equation.

Theorem 2.5.1. Let be a linear ODE (not necessarily constant coeﬃcient). Let be the complementary solution (the general solution to the associated homogeneous equation ) and let be any particular solution to . Then the general solution to is

The moral of the story is that we can ﬁnd the particular solution in any old way. If we ﬁnd a diﬀerent particular solution (by a diﬀerent method, or simply by guessing), then we still get the same general solution. The formula may look diﬀerent, and the constants we will have to choose to satisfy the initial conditions may be diﬀerent, but it is the same solution.

The trick is to somehow, in a smart way, guess one particular solution to (2.6). Note that is a polynomial, and the left hand side of the equation will be a polynomial if we let be a polynomial of the same degree. Let us try

We plug in to obtain

So . Therefore, and . That means . Solving the complementary problem (exercise!) we get

Hence the general solution to (2.6) is

Now suppose we are further given some initial conditions. For example, and . First ﬁnd . Then

We solve to get and . The particular solution we want is

Exercise 2.5.1: Check that really solves the equation (2.6) and the given initial conditions.

Note: A common mistake is to solve for constants using the initial conditions with and only add the particular solution after that. That will not work. You need to ﬁrst compute and only then solve for the constants using the initial conditions.

A right hand side consisting of exponentials, sines, and cosines can be handled similarly. For example,

Let us ﬁnd some . We start by guessing the solution includes some multiple of . We may have to also add a multiple of to our guess since derivatives of cosine are sines. We try

We plug into the equation and we get

The left hand side must equal to right hand side. We group terms and we get that and . So and and hence and . So

Similarly, if the right hand side contains exponentials we try exponentials. For example, for

we will try 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 diﬀerentiation 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,

For this equation, we will guess

We will 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

We would love to guess , but if we plug this into the left hand side of the equation we get

There is no way we can choose to make the left hand side be . The trick in this case is to multiply our guess by to get rid of duplication with the complementary solution. That is ﬁrst we compute (solution to )

and we note that the term is a duplicate with our desired guess. We modify our guess to and notice there is no duplication anymore. Let us try. Note that and . So

Thus is supposed to equal . Hence, and so . We can now write the general solution as

It is possible that multiplying by does not get rid of all duplication. For example,

The complementary solution is . Guessing would not get us anywhere. In this case we want to guess . 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

In this case we ﬁnd that solves and that solves (that is, do each term separately). Then note that if , then . This is because is linear; we have .

The method of undetermined coeﬃcients will work 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 only ﬁnitely many linearly independent derivatives, so that we can write a guess that consists of them all. Some equations are a bit tougher. Consider

Note that each new derivative of looks completely diﬀerent and cannot be written as a linear combination of the previous derivatives. We get , , etc….

This equation calls for a diﬀerent method. We present the method of variation of parameters, which will handle any equation of the form , provided we can solve certain integrals. For simplicity, we restrict ourselves to second order constant coeﬃcient 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 coeﬃcients, 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

First we ﬁnd the complementary solution (solution to ). We get , where and . To ﬁnd a particular solution to the nonhomogeneous equation we try

where and are functions and not constants. We are trying to satisfy . That gives us one condition on the functions and . Compute (note the product rule!)

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 . This makes computing the second derivative easier.

Since and are solutions to , we know that and . (Note: If the equation was instead we would have .) SoWe have and so

and hence

For to satisfy we must have .

So what we need to solve are the two equations (conditions) we imposed on and

We can now solve for and in terms of , and . We will always get these formulas for any , where . There is a general formula for the solution we can just plug into, but it is better to just repeat what we do below. In our case the two equations become

Hence And thus Now we need to integrate and to get and . So our particular solution isExercise 2.5.7: a) Using variation of parameters ﬁnd a particular solution of . b) Find a particular solution using undetermined coeﬃcients. c) Are the two solutions you found the same? What is going on?