The following content is provided under a Creative
Commons license.
Your support will help MIT OpenCourseWare
continue to offer high quality educational resources for free.
To make a donation or view additional materials
from hundreds of MIT courses, visit MIT OpenCourseWare
at ocw.mit.edu.
HERBERT GROSS: Hi.
Last time we were discussing how to find
the general solution of the homogeneous equation
with constant coefficients.
Our lesson today is going to be concerned
with finding a particular solution
of a linear differential equation
with constant coefficients.
But in which case, the right hand side of the equation
is not identically 0.
I should point out that there is a more general technique called
the method of variation of parameters
that we will talk about next time.
And that's the method which is done in the book.
You see that it talks about this problem in more detail.
But it does turn out that for many types of problems,
a very special case occurs, a case which is not mentioned
in our textbook and which I thought is important enough
that I'd like to present to you before we
get to the stickier approach.
At any rate, today's lesson is called
undetermined coefficients.
And it's a technique that's used for finding
a particular solution of the equation y
double prime plus 2ay prime plus b-y equals f of x.
In other words, constant coefficients.
But the right hand side is not necessarily 0.
In fact, if the right hand side were 0,
we'd be back to the lecture of last time.
But we're going to solve this in the very special cases
that f of x is either e to the m-x where m is a constant
or f of x is either sine m-x or cosine m-x where m is, again,
a constant.
Or finally, in the case where f of x is x to the n, where n
is a whole number.
And the reason that we focus our attention
on these three cases--
and we'll prove this in more detail
during the course of the unit but not in the lecture--
is that this is the only family, so to speak,
of functions whereby we can tell what
you have to differentiate in order
to get the given function.
For example, we know that to wind up with e to the m-x,
we essentially have to differentiate
a constant times e to the m-x.
To wind up with sine m-x or cosine m-x,
we have to start with nothing worse than sine m-x
or cosine m-x.
And similarly, to wind up with a power of x we have
to start with a power of x.
That's where these constant coefficients are so important.
You see, as long as the coefficients are constant that
means I can't have any functions of x beefing up anything
in my y, y prime, and y double prime.
Consequently if the coefficients are constant
and f of x is of one of these three forms,
I have a very easy way of looking
for trial solutions for a particular solution
of the equation.
Let me show you what that means in particular.
In case one, if f of x is e to the m-x,
a reasonable trial is y sub p.
The particular solution is A-e to the m-x.
And we then try to find what A is
by plugging this expression into the equation
and seeing what value of A balances the equation.
The reason I underlined reasonable
here is as we shall see later in the lecture,
there are some peculiarities which may exist.
But we're not going to worry about those just yet.
If f of x is sine m-x, then a reasonable trial solution
is A sine m-x plus B cosine m-x where A and B, again,
are undetermined coefficients.
They're constants.
And we're going to try to figure out
what they must be by feeding this trial
solution into the equation.
And I'll emphasize this more when we come to it
in the context of an example.
But notice that even though the right hand side
side is sine m-x, the trial solution is not just
A sine m-x, it's A sine m-x plus B cosine m-x.
Because remember in taking derivatives,
if I differentiate the cosine I can get the sine.
If I differentiate the sine twice I get back to the sine.
So I want both of these terms in here.
And the final case if f of x is x to the n,
a reasonable trial is y sub p equals some constant times x
to the n plus some constant times x to the n minus 1 plus,
et cetera, some constant A1 times x plus,
et cetera, some constant.
In other words, if the right hand side
is a simple power of x where the exponent is a whole number,
we simply try as a trial solution
the most general polynomial of that degree.
And I think the best way to show this now is by example.
We will teach by example.
And the rest of this lecture shall be devoted
to a sequence of such examples.
Example number one, y double prime minus 4y prime plus 3y
equals e to the 5x.
I look at this and I say, well, here I
have constant coefficients.
It appears that the only thing I can differentiate
that will give me an e to the 5x back
again is essentially some constant times e to the 5x.
So for my trial solution, I let y sub p be A-e the 5x.
Consequently y-p prime is 5 Ae to the 5x.
And y-p double prime is 25 A-e to the 5x.
If I now plug y-p double prime, y-p prime, and y-p
into the original equation, I see that each of the 5x
is a common factor.
And I'm left with what?
25A minus 4 times 5A.
In other words, minus 20 A plus 3A.
And what must that be?
That must be identically e to the x.
Let me write identically in here to emphasize the fact
that whatever value of A I pick here,
for this to be a solution the left-hand side of the equation
and the right hand side of the equation
must agree for every value of x.
In particular, I notice that this
says that 8A times e to the 5x must
be identical to e to the 5x.
Consequently, we've got an x equals 0.
This says that 8A is equal to 1.
Therefore, the only candidate for a solution
here is that A be 1/8.
And taking A to be 1/8, I find that my candidate for a trial
solution is 1/8 e to the 5x.
And a trivial check verifies that the only candidate
is indeed a solution.
In other words, a particular solution
of the equation y double prime minus 4y prime plus 3y equals
e to the 5x is y equals 1/8 e to the 5x.
By the way, lest we lose track of what the general theory is,
remember that to find the general solution
of the equation, all we need is a particular solution
plus the general solution of the reduced homogeneous equation.
Recall that with the right hand side here 0,
we already know that y double prime minus 4y prime plus
3y equals 0 has as its general solution,
y equals C1 e to the x plus C2 e to the 3x.
So in other words then, the general solution
of this equation is obtained merely
by tacking on the general solution
of the homogeneous equation to this one particular solution
that we've found here.
In other words, the general solution
of the equation given in this example
is y equals 1/8 e to the 5x plus C1 e to the x plus C2 e
to the 3x.
That takes care of our first illustration.
For our next illustration, we will keep the same linear part
of the equation.
We'll again take y double prime minus 4y prime plus 3y.
But now we'll let f of x be sine x.
In other words, we want to find a particular solution
of this particular differential equation.
And again, constant coefficients, the right hand
side is of the desired form.
I simply try for a solution in the form y sub p
is some constant times sine x, say A sine
x, plus a constant B times cosine x.
If I do this, notice that y-p prime is A cosine x minus B
sin x.
And y-p double prime is minus A sine x minus B cosine x.
By the way, just in pausing here for a moment,
notice that if I had tried for a trial solution
either in the form A sine x alone or B cosine x alone,
noticed that I would have got--
look what would have happened here.
I would have got sine x's and cosine x terms on both--
A would have been a coefficient of a sine x term
and a cosine x term.
That means that A would have had to have
been compared with two coefficients
on the right-hand side.
Namely the coefficient of sine x on the right hand is 1.
The cosine x is 0 because it doesn't appear.
And we could very easily have wound up with a contradiction.
We would have found out that there
was no value of A that could have satisfied
two things simultaneously.
But that will be emphasized more in the exercises.
For now, just take my word for it
that this is the trial that we make.
Now if we make this trial, if we now
replace y double prime by minus A sine x minus B
cosine x and y prime by A cosine x minus B sin x and y
by A sine x plus B cosine x, this equation then reads what?
Minus A sine x minus B cosine x plus plus--
you see, minus this term-- plus 4B sine x minus 4A
cosine x plus 3A sine x plus 3B cosine x.
And that must equal 1 sine x plus 0 cosine x.
You see, what I'm going to do is I'm
going to equate the coefficient of sine x on the left hand
side of the equation with the coefficient of sine
x on the right hand side of the equation.
I'm going to equate the coefficient of cosine x
on the left hand side of the equation
with the coefficient of cosine x on the right hand
side of the equation.
The fact that these coefficients are 1 and 0 is irrelevant.
The theory remains the same.
The reason that I can do this, if you want justification,
in other words how do I know I can compare like terms.
The answer is, well, for example, let x be 0.
You see if x is 0, all of the sine terms on both sides
of the equation drop out.
On the other hand, cosine 0 is 1.
So if I let x be 0, notice that the left hand
side says that minus B minus 4A plus 3B must be zero.
If I then assume, this being an identity,
that this must also be true when x is pi over 2,
if I let x be pi over 2 all the cosine terms drop out.
Because the cosine of pi over 2 is 0.
The sine of pi over 2 is 1.
So now the equation would read minus A plus 4B plus 3A sine x.
Well, sine x isn't in here because we let x be pi over 2.
So it'd be minus A plus for 4B plus 3A times 1.
This minus A plus 4B plus 3A has to equal 1.
In other words, 1 sine pi over 2.
In other words, regardless of how
you want to look at this thing, the important point
is is that looking at the left-hand side,
comparing it with the identity that must
equal on the right-hand side.
We see that what?
2a plus 4b, which is the coefficient
of sine x on the left-hand side of the equation,
must equal 1, which is the coefficient
of sine x on the right-hand side of the equation.
And similarly, minus 4a plus 2b, which
is the coefficient of cosine x on the left-hand side
of the equation, must equal 0, because that's
the coefficient of cosine x on the right-hand side
of the equation.
In other words, if there are values of a and b
that give us a solution, it must come
from this pair of simultaneous linear equations.
And the solution of this is simply a equals 1/10
and b equals 1/5.
And a trivial check shows, that if we
let a be 1/10 and b equal 1/5, that we
do get a particular solution to this differential equation.
In other words, a particular solution of this equation
is y sub p is 1/10 sine x plus 1/5 cosine x.
By the way, the equation that we're
dealing with has the same homogeneous equation,
namely, y double prime minus 4y prime plus 3y equals 0,
as we had in example one.
Consequently, the general solution now is what?
It's 1/10 sine x plus 1/5 cosine x plus c1e to the x plus c2e
to the 3x.
Finally, to get an example in which the right-hand side is
a polynomial and x, we take, again,
the same left-hand side as before--
y double prime minus 4y prime plus 3y equals x squared.
We try for our trial solution in the form ax
squared plus bx plus c.
See, you might ask over here, how
do you know that there aren't higher powers of x to bring in?
I mean, why shouldn't there have been an x cubed term in here?
Because when you differentiate, the x cubed term gets
knocked down.
Why couldn't it collect with terms over here?
Notice, that if we had an x cubed term,
that coefficient would have to be 0.
Because if you replaced y by x cubed,
the only place that an x cubed term
would appear on the left-hand side is in the 3y term.
You see, if y equals x cubed, y prime
has an x squared as the highest power, y double prime and x.
The only place that x cubed would appear is here.
And since it doesn't appear at all on the right-hand side,
its coefficient would have to be 0.
So the trick is what?
Don't worry about powers higher than this, in general.
In general, start with this and just work down.
A good rule of thumb is, when in doubt, put the extra terms in.
Because the worst that will happen
is that you will have done some work for nothing.
In other words, if I put in an undetermined coefficient
of a term which isn't supposed to be in there,
then that coefficient will turn out to be 0.
And that will tell me that that term isn't in there.
On the other hand, if I leave out
a term that should be in there, then I usually
wind up with a contradiction, as we
shall see later in our lesson.
But the idea is, we try for a solution in the form ax
squared plus bx plus c, in which case,
yp prime would be 2ax plus b.
yp double prime would simply be 2a.
And consequently, if we now replace y double prime by 2a,
y prime by 2ax plus b, and y by ax squared plus bx plus c
in this equation, we wind up with
the undetermined coefficients a, b, and c.
Having to satisfy the identity, 2a minus 4 times the quantity,
2ax plus b, plus 3 times the quantity,
ax squared plus bx plus c, has to be identically
equal to x squared, which means 1x squared plus 0x plus 0.
Now, the only way that two quadratics
can be identically equal is if they're equal coefficient
by coefficient.
Consequently, the coefficient of x
squared on the left-hand side of the equation has to be 1.
The coefficient of x on the left-hand side of the equation
has to be 0, because that term is missing
on the right-hand side, which is the same as saying
it's multiplied by 0.
And the constant term must also be 0.
And see why you had to tack in the lower-order terms here?
Because they do get multiplied and combined,
and we have to utilize these.
In other words, we do have a, b, and c appearing as coefficients
not just of an x squared term, but on the x term,
and the constant term.
But again, we'll do more of that in the exercises.
For the time being, simply observe
that the only term that involves the a x squared
on the left-hand side is 3a.
The terms involving an x have coefficients what?
3b minus 8a.
And the constant term seems to have
the form 2a minus 4b plus 3c.
Consequently, 3a must be 1.
3b minus 8a is 0.
2a minus 4b plus 3c is 0.
From this equation, we see immediately that a is 1/3.
Knowing that a is 1/3, we put that into the second equation.
Immediately, can solve for b, which turns out to be 8/9.
Knowing that a is 1/3 and b is 8/9,
we can now come into the third equation and solve for c,
and c turns out to be 26/27.
In other words, a particular solution
to our differential equation in example three
is 1/3x squared plus 8/9x plus 26/27.
So the general solution of that equation
is 1/3x squared plus 8/9x plus 26/27 plus c1e
to the x plus c2e to the 3x, because this is still
the general solution of the reduced equation.
See, same reduced equation, homogeneous equation,
in all three examples.
Another example, an example now that says,
what happens if the right-hand side isn't simply
a term of the form described in cases 1, 2, and 3, but rather,
is a combination of such terms?
Suppose, for example, that I want to solve the differential
equation, y double prime minus 4y prime plus 3y equals
e to the 5x plus sine x.
Maybe this looks familiar to you.
In other words, if I let l of y denote y double prime minus
4y prime plus 3y, notice that example number one was solving
l of y equals e to the 5x.
And example number two was solving l of y equals sine x.
In other words, we seem to have solved this problem
in the special case, where either one of these two terms,
but not the other, appeared.
And the interesting thing is, that once we
can solve these problems separately,
it turns out that the linearity of our differential equation
allows us to use something which is called the superposition
principle.
In other words, that it allows us to, in many cases,
solve more complicated right-hand sides
simply by reducing it to a sum of simpler right-hand sides.
In particular, what I'm saying in this particular case,
was that in example one we saw that l of y
equals z to the 5x had as a particular solution
1/8e to the 5x.
In example two, we saw that l of y
equals sine x had as a particular solution
sine x/10 plus cosine x/5.
Now, the point is, by equals added to equals,
this plus this is e to the 5x plus sine x.
But by linearity, l of 1/8e to the 5x plus l
of sine x/10 plus cosine x/5 is l
of 1/8e to the 5x plus sine x/10 plus cosine x/5.
In other words, l of u plus l of v by linearity
is l of u plus v.
In other words, then by linearity,
adding these two results yields this.
And that tells us that a particular solution
to our equation in example four is simply
y sub p is 1/8e to the 5x plus sine x/10 plus cosine x/5.
See?
More generally, if we want to solve a differential equation,
l of y equals f of x plus g of x, then by linearity
the solution y will simply be u plus v-- a particular solution
will be u plus v, where u is any particular solution
of the equation l of y equals f of x, and v
is any particular solution of the equation l
of y equals g of x.
In other words, notice here that from this we
see that l of u plus l of v is f of x plus g of x.
By linearity, l of u plus l of v is l of u plus v. Therefore,
l of u plus v is f of x plus g of x, which
is exactly what we mean by saying that this
is a solution of this equation.
That's why there's no loss of generality
if we elect to always think of the right-hand side
as having just one term.
Because if it's a sum of terms, we
can solve the problem separately,
one for each term on the right-hand side, and then
just add the answers up.
Now, let me come to an example that
illustrates just a little bit of a pitfall,
and I think that it's one that's worth falling into.
Let's now take the problem y double prime
minus 4y prime plus 3y equals e to the x.
That doesn't look appreciably different
than example number one.
Let's try the same kind of a solution.
In fact, it looks even easier than example one.
Because in an example one, the right-hand side
was e to the 5x.
This is just simply e to the x.
This one looks even easier to handle.
Namely, notice that since the derivative of e to the x
is still e to the x, that if we try for a solution in the form
y sub p equals a to the x, then yp prime and yp double prime
are also just ae to the x.
Therefore, let's replace y, y prime, and y double prime by ae
to the x.
We can then factor l and e to the x.
And what's left over here?
We have an a minus 4a plus 3a, and on the right-hand side,
e to the x.
Now, look at this bracketed expression--
a very nasty thing has just happened.
Notice that a minus 4a plus 3a, for any constant a--
in fact, for that matter, for any variable a, as long as a
stays the same in all three expressions--
the bracketed expression is identically 0.
And consequently, this says that our left-hand side must be 0,
our right-hand side must be identically e to the x.
This is impossible.
First of all, e to the x cannot be identically 0.
e to the x, in fact, is never equal to 0
for any real value of x.
And secondly, it appears that our undetermined coefficient,
a, has disappeared completely from the equation.
What went wrong here that didn't go wrong an example one?
You may have recalled when we first started today's lecture,
I said that if f of x was e to the mx,
a reasonable trial solution was y equals ae to the mx,
and emphasized that "reasonable" might not
be good enough in certain tough cases.
What happened here was the very interesting fact that e
to the x, in other words, the right-hand side
of this equation, happens to be a solution
to the homogeneous equation.
Remember, that when we took the equation, y double prime minus
4y prime plus 3y equals 0, we saw
that two particular solutions were e to the x,
see, e to the x, and e to the 3x.
Consequently, when we substituted in e to the x,
ae to the x on the left-hand side
here to see what was going to happen,
we should have known that that term was going to drop out.
Why?
Because l of e to the x is 0.
Consequently, by linearity, l of ae to the x is also 0.
What were we really doing when we replaced y sub p by ae
to the x?
We were computing l of ae to the x.
That's what we did in here when we computed this.
We were computing l of ae to the x.
And we should have known that that was going to be 0.
We must be very, very careful, in other words--
this is the key point--
when we're given y double prime plus 2ay prime plus by
is some function of x, where that function of x
is not identically 0, that when we look for the trial solution,
we must make sure that f of x is not
a particular solution of the homogeneous equation.
In other words, given this, the safest thing to do
is to first solve the homogeneous equation.
So you solve this one first.
Then proceed as usual if l of f of x is not 0.
In other words, if the right-hand side is not
a particular solution of the homogeneous equation,
proceed as usual.
That means the way we did in the examples one through four.
But if l of f of x is 0, certainly
replacing the trial solution as being some constant times
f of x, that's not going to give us anything.
They a will drop out there.
What we're saying is what?
Given whatever trial solution you would've
tried, if you didn't know that this was 0,
replace that by x times that trial solution.
And that, we'll explain in the course of the exercises.
But the mechanics are similar to what
happened in the lecture of last time
when we got a repeated root, when
we said that one of the roots was e to the rx
and the other one was xe to the rx.
In other words, quite mechanically,
whenever the right-hand side of the equation
satisfies the homogeneous equation,
replace the trial solution that you
would have used by the trial solution multiplied by x.
In regards to example five, where we first
ran into this mess right over here, what we're saying is,
if we had solved the homogeneous equation first,
we would have noticed right away that e
to the x was a solution of the reduced equation, in which case
we would not have tried ae to the x as a trial solution,
but rather axe to the x.
I leave the details out, because they're
very easy for you to verify.
We will have homework problems similar to this.
And if you wish, you can verify this for yourself now.
Otherwise, we'll do problems like this in the exercises.
But to actually check, that if you
try y sub p to be axe to the x, that we actually do
find a value for a here.
By the way, do not say, do I try axe
to the x plus something times e to the x itself,
because after all, I can wind up with an e to the x term
by starting with an e to the x term?
The answer is that as soon as you tack on a term,
like be to the x, that when you take l of that,
that whole term is going to drop out, because e to the x
was a solution of the homogeneous equation.
So this is the only term that you try in the solution.
Now, the last example--
and this is one that we will not solve now,
not because we don't have the time, but because we can't.
And the reason that we can't is simply this.
I asked you to find a particular solution of the equation, y
double prime plus y equals secant x.
Notice, the homogeneous equation, y double prime plus
y equals 0, is very easy for us to solve.
Namely, it's y equals c1 sine x plus c2 cosine x--
no trouble with the homogeneous case.
The problem is that the right-hand side here
is not of one of the three types that we talked about.
Try to find all the functions whose derivatives
can lead to secant x.
It's an impossible task.
There are infinitely many functions
that one can find combinations of whose derivative yields
secant x.
In other words, this particular method
that I did for you today, which is not in the text
but which I felt was important, needs
to have two things going for it.
One is that on the left-hand side of the linear equation,
there must be constant coefficients.
And the other is, even if the coefficients are constant,
the right-hand side must belong to one of the three families
e to the mx, cosine mx or sine mx, or x to the mth power.
Now, a more general method, which
is called the method of variation of parameters,
allows the left-hand side to have variable coefficients.
It allows the right-hand side to be an arbitrary function of x.
And the price that we pay for this nice general formula
is the fact that it's a messy thing,
both from a practical point of view to apply
and from a theoretical point of view to justify.
But that is what we'll be talking about next time.
And that will be the lecture that
corresponds to the material in the book, you see in the text.
And until next time, what we want to do
is just drill on undetermined coefficients
in the particular case where they happen to be applicable.
At any rate, then, until next time.
Goodbye.
Funding for the publication of this video
was provided by the Gabriella and Paul Rosenbaum Foundation.
Help OCW continue to provide free and open access to MIT
courses by making a donation at ocw.mit.edu/donate.