# Differential Equations and Linear Algebra, 2.6: Methods of Undetermined Coefficients

From the series: Differential Equations and Linear Algebra

*
Gilbert Strang, Massachusetts Institute of Technology (MIT)
*

With constant coefficients and special forcing terms (powers of *t*, cosines/sines, exponentials), a particular solution has this same form.

OK. So this is about the world's fastest way to solve differential equations. And you'll like that method. First we have to see what equations will we be able to solve. Well, linear, constant coefficients. I made all the coefficients 1, but no problem to change those to A, B, C. So the nice left-hand side.

And on the right-hand side, we also need something nice. We want a nice function. And I'll tell you which are the nice functions. So I can say right away that e to the exponentials are nice functions, of course. They're are always at the center of this course.

So for example, equal e to the st. That would be a nice function. OK. And the key is, we're looking for a particular solution, because we know how to find null solutions. We're looking for particular solution for this equation. One function, some function that solves this equation with right-hand side e to the st.

And the point is, we know what to look for. We just have some coefficient to find. And we'll find that by substituting in the equation. Now, do you remember what we look for when the right-hand side is e to the st? Then look for y equals some constant times e to the st, right?

When f of t-- maybe I'll put the equal sign down there. If f of t is e to the st, then I just look for a multiple of it. That's one coefficient to be determined by substitute this into the equation. Do you remember the results? So this is our best example.

When I put this in the equation, I'll get the derivative brings an s. Second derivative brings another s. So I get s squared and an s and a 1 times y e to the st is equal to e to the st. We've done that before. Here we see it as a case with undetermined coefficient y. But by plugging it in, I've discovered that y is 1 over that.

So that's a nice function then. e to the st is a nice function. What are the other nice functions? So now, let me move to the other board, next board, and ask, what other right-hand sides could we solve? So I'll keep this left-hand side equal to. So e to the st was 1.

What about t? What about t? A polynomial. Well, that only has one term. So what would be a particular solution to that equation? So I really have to say, what is the-- try y particular equals-- now, if I see a t there, then I'm going to look for a t in y. And I'll also look for a constant. So a plus bt would be the correct form to look for.

Let me just show you how that works. So this now has two undetermined coefficients. And we determine them by putting that into the equation and making it right. So try yp is a plus bt in this equation. OK, the second derivative of a plus bt is 0. The first derivative of that is b. So I get a b from that. And y itself is a plus bt. And that's supposed to give t.

You see, I plugged it in. I got to this equation. Now I can determine a and b by matching t. So then b has to be 1. We get b equal to 1. So the t equals t. But if b is 1, I need a to b minus 1 to cancel that. So a is minus 1. And my answer is minus 1 plus 1t. t minus 1.

And if I put that into the equation, it will be correct. So I have found a particular solution, and that's my goal, because I know how to find null solutions. And then together, that's the complete solution. So we've learned what to try with polynomials. With a power of t, we want to include that power and all lower powers, all the way down through the constants. OK.

With exponentials, we just have to include the exponential. What next? How about sine t or cosine t? Say sine t. So that case works. Now we want to try y double prime plus y prime plus y equals, say, sine t. OK. What form do we assume for that?

Well, I can tell you quickly. We assume a sine t in it. And we also need to assume a cosine t. The rule is that the things we try-- so I'll try y. y particular is what we're always finding. Some c1 cos t, and some c2 sine of t. That will do it.

In fact, if I plug that in, and I match the two sides, I determine c1 and c2, I'm golden. Let me just comment on that, rather than doing out every step. Again, the steps are just substitute that in and make the equation correct by choosing a good c1 and c2.

I just noticed that, you remember from Euler's great formula that the cosine is a combination of e to the it and e to the minus it. So in a way, we're really using the original example. We're using this example, e to the st, with two s's, e to the it, and e to the minus it. So we have two exponentials in a cosine. So I'm not surprised that there are two constants to find.

And now, finally, I have to say, is this the end of nice functions? So nice functions include exponentials, polynomials. These are really exponentials, complex exponentials. And no, there's one more possibility that we can deal with in this simple way.

And that possibility is a product of-- so now I'll show you what to do if it was t times sine t. Suppose we have the right-hand side, the f of t, the forcing term, is t times sine t. What is the form to assume? That's really all you have to know is what form to assume? OK.

Now, that t-- so we have here a product, a polynomial times a sine or cosine or exponential. I could have done t e to the st there. But what do I have to do when the t shows up there? Then I have to try something more with that t in there. So now I have a product of polynomial times sine, cosine, or exponential.

So what I try is at plus-- or rather, a plus bt. I try a product. Times cos t and c plus dt times sine t. That's about as bad a case as we're going to see. But it's still quite pleasant. So what do I see there?

Because of the t here, I needed to assume polynomials up to that same degree 1. So a plus bt. Had to do that, just the way I did up there when there was a t. But now it multiplies sine t. So I have to allow sine t and also cosine t.

The pattern is, really, we've sort of completed the list of nice functions. Exponentials, polynomials, and polynomial times exponential. That's really what a nice function is. A polynomial times an exponential. Or we could have a sum of those guys. We could have two or three polynomial times exponential, like there and another one. And that's still a nice function.

And what's the real key to nice functions? The key point is, why is this such a good bunch of functions? Because, if I take its derivative, I get a function of the same form. If I take the derivative of that right-hand side, and I use the product rule, you see I'll get this times the derivative of that. So I'll have something looking with a sine in there. And I get this times the derivative of that, which is just a b.

So again, it fits the same form, polynomial times cosine, polynomial times sine. So here I have a case where I have actually four coefficients. But they'll all fall out when you plug that into the equation. You just match terms and your golden. So it really is a straightforward method. Straightforward.

So the key about nice functions is-- and they're nice for Laplace transforms, they're nice at every step. But it's the same good functions that we keep discovering as our best examples. The key about nice functions is that the-- that's a form of a nice function because its derivative has the same form. The derivative of that function fits that pattern again. And then the second derivative fits. All the derivatives fit. So when we put them in the equation, everything fits.

And always in the last minute of a lecture, there's a special case. There's a special case. And let's remember what that is. So special case when we have to change the form. And why would we have to do that?

Let me do y double prime minus y, say, is e to the t. What is special about that? What's special is that this right-hand side, this f function, solves this equation. If I try e to the t, it will fail. Try y equals some Y e to the t. Do you see how that's going to fail?

If I put that into the equation, the second derivative will cancel the y and I'll have 0 on the left side. Failure, because that's the case called resonance. This is a case of resonance, when the form of the right-hand side is a null solution at the same time. It can't be a particular solution. It won't work because it's also a null solution.

And do you remember how to escape resonance? How to deal with resonance? What happens with resonance? The solution is a little more complicated, but it fits everything here. We have to assume to allow a t. We have to allow a t.

So instead of this multiple, the and in this thing, we have to allow-- so I'm going to assume-- I have to have-- I need a t in there. Oh, no. Actually, I don't. I just need a t. That would do it.

When there's resonance, take the form you would normally assume and multiply by that extra factor t. Then, when I substitute that into the differential equation, I'll find Y's quite safely. I'll find Y entirely safely. So I do that. So that's the resonant case, the sort of special situation when e to the t solved this.

So we need something new. And the way we get the right new thing is to have a t in there. So when I plug that in, I take the second derivative of that, subtract off that itself, match e to the t. And that will tell me the number Y.

Perhaps it's 1/2 or 1. I won't do it. Maybe I'll leave that as an exercise. Put that into the equation and determine the number capital Y. OK. Let me pull it together. So we have certain nice functions, which we're going to see again, because they're nice. Every method works well for these functions.

And these functions are exponentials, polynomials, or polynomials times exponentials. And within exponentials, I include sine and cosine. And for those functions, we know the form. We plug it into the equation. We make it match. We choose these undetermined coefficients. We determine them so that they solve the equation. And then we've got a particular solution.

So this is the best equations to solve to find particular solutions. Just by knowing the right form and finding the constants, it did come out of the particular equation. OK. All good, thanks.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

### Asia Pacific

- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)