 She's having a hard time with it too. Lecture 32, we are going to start non-homogeneous equations today. So we're in 7.8 of the supplement. It's not like we can completely forget all the homogeneous stuff that we just battled through in 7.7 because those solutions to the homogeneous equation are part of the answer to the solution to the non-homogeneous equation. So it's got two parts, two pieces. It's got a homogeneous part, which is kind of the way we've been doing thus far in this supplement, as well as what's called a particular solution. So the key difference you're going to see is that we don't have zero on the right side of the equation. We'll have something else. It is a select subset for this course. Now, when you take differential equations, that will probably open up significantly. But we're going to look at exponential functions on the right side of the equation, polynomial functions, and not even all trig, but sines and cosines and trig. So we'll have a select subset on the right side. Before we leave this, we will revisit this. We came up with this yesterday. And there's one more thing I wanted to do with it at this point. And then we'll revisit it. We really want to graph sine plus cosine. So what I did is I graphed in green. I graphed the sine. And in red, graphed the cosine. And then we added them up graphically. We added the y values at each individual x value. So we added 0 and 1 and got 1. We added the square root of 2 to the, excuse me, square root of 2 over 2 to itself. And we got this value. So we added them up. The reason is to get a look at this function, it is an oscillatory function, just like a sine or cosine would be. In fact, let's do this before we leave it. We could come up with an equation for this in terms of sine or cosine. Let's, in this case, use the sine. What would the amplitude of this new function be? What is, here's its amplitude in a sense that it oscillates that far above its axis and that far below its axis. What are those distances? Square root of 2. So the amplitude is going to be the square root of 2. And let's just, we could call it a sine or a cosine and just adjust it. But it's a little easier to adjust it if we call it a sine from this picture. Whatever is the period of either one of these, or in fact, both of these, is also going to be the period of the function when we add them together. So we don't need any special coefficient in front of x because we add x here and x here. So we're going to have x down here. So it says the period is still 2 pi. Can you see what kind of phase shift this one would undergo? If we brought this back here, pi over 4 to the left. So how do we accomplish a shift of pi over 4 to the left? Plus pi over 4. So there's the equation in terms of a single trig function, in terms of a sine or a cosine, in this case a sine, that is exactly the same as sine plus cosine. This will be called a phase amplitude form and we'll revisit that later in this material. But I didn't want to leave that example without getting that sine plus cosine in terms of a single sine or cosine function. So that's not really 7.8, but it's something that will come across different points in time in this section, in this supplement. All right, 7.8, non-homogeneous linear equations. So we're going to have these things on the left side that look very familiar to what we've had to this point. We're going to have some y double primes, some y primes, and some y's with the possibility of different coefficients. And then we're going to have something now non-zero on the right side, so it's non-homogeneous. So there's the main culprit for why it is non-homogeneous. We'll have in this course, since this is a brief survey of second order differential equations, we're going to have a limited set that we're going to look at that will appear on the right side. We're going to have polynomials and possibly some products of these things, too. Polynomials, sine and or cosine. So it's not even all trig, just sines and cosines, and exponential functions, e to the negative x, e to the 4x, e to the 2x, some type of exponentials. The method that we will spend our time with in this section is called the method of undetermined coefficients. That comes first. In 7.8, there is a second method, the method of variation of parameters, which we will not do. So just the first of the two methods in this section. And it's sufficient to do any of the problems that we're going to need to handle from this particular subset. So how do we go about this? This kind of summarizes it, and then we'll look at some examples. As it is a battle, the homogeneous part will not be a battle, I hope, because we've done that. We've reviewed that. We'll go back to that. But here are the things from 7.8 that are the highlights, and then we'll go back and look at how this plays out in an example. So there's the kind of thing we're going to encounter. The general solution of the non-homogeneous differential equation can be written as. So here's what our solution is going to look like. This is our final solution. It's going to have two parts to it. I tried to change that to an h, y sub h. That's going to be our homogeneous part. So if the print is small, there's y sub h. So we'll get the characteristic equation. We'll find the solutions. Then we'll go to the homogeneous part. That will be part of the solution. And then we'll also generate this new part called the particular solution, y sub p. It's the solution that's actually going to generate the stuff that appears on the right side. This might be an unfair question, but hopefully it's not. What will the homogeneous solution generate on the right side? When we put it in for y and y prime and y double prime, what happens to everything on the left side? So what does it generate on the right side? No? Why is it called the homogeneous solution? Because it generates 0. So this doesn't generate anything on the right side. So if we have something other than 0, we're going to have to come up with something in addition to the homogeneous solution, because all it generates is 0. So the particular solution is going to generate the stuff that actually appears on the right side. But that's why the homogeneous solution is part of the answer. It just doesn't generate anything. Then the particular part is the stuff that actually generates this g of x that's on the right side. Y sub p is a particular solution of equation 1. And y sub c, we've called it y sub h. The homogeneous solution is the general solution of the complementary equation. We didn't call it that. We called it the characteristic equation. Or the auxiliary equation. It's got lots of names. All right, so what are we going to deal with in this course as a subset of these things that appear on the right side, these g of x things? c sub n, I think in your book it says c sub 1, x sub n. But the c's can be different. So let's call that c sub n, x to the n, and so on. c1, x to the 1, and down to c0. Well, that would be a polynomial. So notice the vagueness of this solution. First, try y sub p. Well, that kind of gets you a little insight into the fact that it may not work all the time. And we're going to have to adjust it from time to time. But that's a good start, is to try something that, to generate c sub n, it may not be the same number in the particular solution. So they call it a sub n. But to generate some x sub n's, we better start with some x sub n's. To generate some x's, we better have some x's. To generate a constant, we better have a constant. But it may not be the same constant that appears in the g of x here on the right side. So we possibly will have a polynomial there. Here's our exponentials. We're going to have so many e to the kx's. How do you generate e to the kx's? You better start with e to the kx's. We may not start with the same amount we're going to finish with, because we've got to do some stuff with them on the left side. But we probably will be smart to start with some e to the kx's if that's what we want to generate. This gets a little bizarre, but I think you'll see in our first example today that if you want to generate cosines, you could actually have cosines and or signs. Where's that come from? How could you generate cosines by starting with cosines and signs? What are we going to do with the stuff we start with? So here's our y sub p. What do we do with our particular solution? We take its second derivative and plug it in there. We take its first derivative and plug it in there. We take the original function and plug it in there. When you take first and second derivatives of cosines and signs, what do you get? Cosines and signs. Cosines and signs, right? So we're kind of trapped in that cosine and sign area. Is it possible that you could have some cosines and signs, and the signs would all knock each other out and you'd be left only with cosines? It's possible? Is it possible you could start with cosines and signs and you plug in here, second, first, original function, and you could be left with just signs? That's possible? Or is it possible you could start with cosines and signs, plug them into the left side, and you'll be left with cosines and signs? That's also possible. So anytime you see a sign or a cosine or a sine plus a cosine, this is the type of particular solution that you use. So we allow for both, even though only one might appear. And there's always a disclaimer. So here's the disclaimer. Modification, put a big star by that. All this is different places in the supplement. But here's a key thing to remember as far as modification. If any term of the particular solution, so we're trying to generate this list, our particular solution, is a solution of the, we called it, characteristic equation. Multiply the particular solution by x, or by x squared, or by x cubed, or by x to the fourth, as many times as we need to multiply by x until it no longer is a solution of the characteristic equation. If it's a solution of the characteristic equation, what will it generate on the right side? It'll generate zero. So we don't want that. We want to keep kind of upgrading it or changing it or modifying it till it generates something other than zero. So that doesn't happen that often, but enough that we need to pay attention to how we modify our solution if, in fact, it's part of the complementary equation, or characteristic equation. All right. Let's see if we can get an example of several things today, see how they go. These are a battle, and you have to kind of make sure your derivatives and second derivatives are correct, and you plug them in correctly, and you multiply them by the proper coefficients, and you group together like terms. There's lots of potential places for error, so have to be careful. A little more so than just the homogeneous equation. Here's a good one to start with. So you can see that it's non-homogeneous. We've got e to the 3x on the right side, and it's a pretty good first example because we've got 1 e to the 3x on the right side. So we'll do the solution in two parts because the final solution is the particular solution plus the homogeneous solution. So we'll do the homogeneous solution first. Treat this as if it were a homogeneous equation. So we're really going to do that. Because is it 0 present on the right side of the equation? It's there. It's just got something added to it. Isn't there a 0 here? e to the 3x plus 0. There's a 0 there. So this deserves to be part of the solution. So what would y look like if we wanted everything on the left side to kind of drop each other out and we'd be left with nothing? Well, we go to the characteristic equation, which is 4 and 2, I think is correct. Plus 4 minus 2. Does that work for the middle term? So one of the r values is negative 4. The other r value is 2. We have two distinct real roots. What is the homogeneous solution? What's y sub h? Does that look right? So we've got three cases, right? This was our so-called first case. We shortcutted a lot of things. We went directly to the characteristic equation. And then once we got the two distinct real roots, we went right away to the nature of the homogeneous solution. So if I were to check this, the problem's already long enough, so we're not going to take the time to check it at this point in time. But if we were to plug in this thing for y, take its first derivative and plug it in up here, and take its second derivative and plug it in up here, what would happen with all this massive stuff on the left side? It would all drop out. You'd lose all the e to the negative 4x terms. You'd lose all the e to the 2x terms. Everything would drop out. You'd get 0. So that takes care of this part of the right side of the equation. Now we actually want to generate the non-zero part. So we want to generate some e to the 3x's. This, by the way, will be part of the solution. It's this part. So here's the so-called new part for today. We want a particular solution. What would you have to start with if you plugged into an equation the original starting quantity plus its derivative plus its second derivative, and you want to generate some e to the 3x's, what would you have to start with? Some e to the 3x's. Aren't they their own first derivative in a sense and also their own second derivative? When you take the derivative of e to the 3x's, you get e to the 3x's. And when you take the second derivative of e to the 3x's, you get more e to the 3x's. We don't know how many to start with. We know eventually we want to generate 1 e to the 3x. That's how many e to the 3x's are on the right side. So we start with some arbitrary amount. Let's say a of them, and I overlook something. I went a little too quickly to this part of the solution. I guess now is a good enough time. What was the modification? When would we need to modify that question that I just asked you about if we want to generate e to the 3x's, what do we start with? We start with e to the 3x's unless what? It's part of the solution. Unless it's part of the homogeneous solution. Are e to the 3x's do I have any here or do I have any here? No, we're OK. We've got e to the negative 4x's. And e to the 2x's, we want to generate some e to the 3x's. That's a different animal from the 2 that we have thus far. So we're OK. This is probably going to work. To see what a is going to need to be, we're going to have to plug everything into the left side, see what a needs to be in order for us to generate 1 e to the 3x on the right side. So if we're going to try this as our particular solution, what is the first derivative of the particular solution? Good. And we also need to know the second derivative, 9a. So do you see that we've got some e to the 3x's going? That's the only way we're going to be able to generate some e to the 3x's is to start with e to the 3x's. All right, so let's plug these things into the left side of the equation. The second derivative of the particular solution plus 2 times, according to this, the first derivative minus 8 of the original y things. So now we're actually going to equate left side and right side. So we've got e to the 3x's. How many do we have on the left side? We've got 9a plus 6a minus 8a. 7a. So on the left side, we have 7a e to the 3x's. On the right side, we have 1 e to the 3x. So what's the equation that results? 7a better equal 1, right? If that's the case, we better have the same amount left side as we do right side. It's an equation. So if 7a is 1, then a is 1 7. How many of you were thinking that we needed to start with 1 7th e to the 3x in order to generate? No, you weren't. No one was thinking that. I wasn't thinking that. There's no way to know that. You just start with an undetermined amount of them and then you see how many you need. We have 7a on the left side. We have 1 on the right side. Well, a better equal 1 7. So our particular solution, it was a e to the 3x. We now know what a is. So there's our particular solution. Right above it is the homogeneous solution. So now we go to our final solution, which is their sum. So y or y of x is kind of up to you. I'm going to write the homogeneous solution first. There's the homogeneous solution. And we'll add in the particular solution, which is that. So there's the solution to our second order linear non-homogeneous differential equation. If we were to plug all this in, it would generate 0. On the right side, if we were to plug this in, in fact, we just did that. That's kind of how we arrived at the 1 7th. If we were to plug that in, its second derivative in the left side, this would generate 1 e to the 3x. And that's generating everything we need to generate on the right side of the non-homogeneous equation. Any question about any part of that? Anything that we did right there that needs some clarification? That was not bad. Told you we'd start with a pretty tame one. This is going to look equally tame, but it will not be. So it looks like the same kind of deal, except that instead of 1 e to the 3x, we have 4 e to the 3x. Can you see why this is going to be worse? Anybody? OK. The characteristic equation is going to have a double root. And in fact, e to the 3x is going to be one of the terms of the homogeneous solution. Then we have to jump down to the bottom of the page and do that little modification of our answer for the particular part. All right, homogeneous part. So we're going to treat this as if it were homogeneous. Tell me what to write down next. It's our characteristic equation. Factors of 9 that will get us negative 6 in the middle. OK, same. So here's our other type. So now we've encountered two of the three types that we have as far as the homogeneous solution. So r1 and r2 are the same, so we have a double root. So the solution, the homogeneous part, what's it look like? e to the 3x plus c2x e to the 3x. That all right? Done with the homogeneous part. Unfortunately, that's not going to generate anything on the right side. That's going to generate 0. So now we've got to worry about generating 4 e to the 3x. So how do I generate? This is going to be wrong, by the way. Go ahead and preface the fact that what I'm going to write down next is wrong. How do I generate some e to the 3x's? Well, I'm going to start with some e to the 3x's. That's what we did on the last problem, and it worked fine. Not going to work fine on this problem. What's the problem? What's the difference between c1 e to the 3x and a e to the 3x? There isn't any difference. They're the same kind of animal. If we put them in, we're going to get 0. So that's not going to work. What are we supposed to do according to that modification? Again, we don't know how many to start with, but we are kind of told or asked to multiply by x if that's not going to work. What about a x e to the 3x? We've got some of those in the homogeneous solution as well, so that's not going to work. Do we have any of those in the homogeneous solution? Don't have any of those. Now, that's not guaranteed that it's going to work, by the way, but we know for a fact that the first two didn't have any chance of working. What would be our next step now that we've decided that we have at least a potential candidate here for the particular solution? Take first derivative. Ooh, that's bad. Well, it's OK to have some of your terms drop out, but what we don't want to happen is all of them to drop out. So I don't know that that's going to be the case, but you're probably looking ahead saying that some of them are going to drop out, which will be the case. Or is that the same as like a C2, and your second derivative is just going to have the constant? Yeah, that's what I was saying, because it's just going to. Well, now wait a minute. We've got a product rule here. So it's going to get considerably right. We're going to have some keepers. We're going to also generate some terms that we're going to lose along the way. So we've got a product rule. There's the first term of the product. There's the second. So the first times derivative of second plus the second times derivative of first. That look right? There's derivative of second. Second times derivative of first. 3a x squared e to the 3x plus 2a x e to the 3x. What's next? Second derivative. So the derivative of this. We could put those together and factor out an e to the 3x. Let's just, I don't know. Do you want to do that first? Factor out an e to the 3x in these two. Because we've got a product rule here and another product rule here that might, doesn't matter that much. Let's just take the derivative. There's our first product. First times derivative of second plus second times derivative of first, which would be what? Now we move on to the second one. There's the first term of the product. There's the second term of the product. First times derivative of second plus second times derivative of first. What's derivative of the first? 2a. OK. Every term has an e to the 3x. Is that correct? Let's factor that out. And we have a 9a x squared. Do we have any more x squared terms? So we have a 9x squared. We may want to undo that factoring out of the a, but it's OK right now to do that. 6ax and 6ax, is that correct? Added together this term and this term, 12ax. We factored out the a. 12x and then what? 2a factored out the a and the e to the 3x, so just 2. All right, so I told you these would get kind of complicated. We still don't have the particular solution. In fact, we don't know that this is going to work yet. So we need to take the second derivative, the first derivative, and the original particular solution for y, plug them into the original equation, do what it says to do on the left side, and then see if we can generate 4 e to the 3x. All right, so we need y double prime. I'm going to put the a back in there. Why would I want to put the a back in here? Well, there's a chance that other terms are going to have a in them as well, but don't we really care about how many e to the 3x there are? So we're equating the coefficients of e to the 3x on the left side with e to the 3x on the right side. So we kind of want them to have a's in them. So y double prime, e to the 3x. So there's y double prime. We have minus 6 y prime. So y prime, let's go back up here. If we factor out e to the 3x, what do we get? And the rest of this is plus 9y. So we go back to our original particular solution, a x squared, and we've got an e to the 3x right here. Now when we do all that, when we put our particular solution in, excuse me, put the second derivative of the particular solution in, minus 6 of the first derivative of the particular solution, plus 9 times the particular solution, we should generate what? 4 e to the 3x. Can we on the left side factor out e to the 3x out of every term? Is that correct? So if we do that, and let's try to group together like terms, let's look at all the a x squared terms. We've got nine of them here. We've got what? You've got minus 18 of them here, a x squared, and what? 9a of them over here. Is that right? So did we lose the a x squared? That's a bad sign. That's a real bad sign. But let's keep going. How about the x terms? We've got 12a x minus 12a x. Is that it? Another bad sign. And then what else? We've got 2a minus 12a. Oh, that's got an x. So is that the only one? That may actually be salvation for this problem. In fact, it's kind of what we wanted to happen. We don't want any x squared e to the 3x's, do we? We don't have any of those on the right side. We don't want any x e to the 3x's. We don't have any of those either. So we kind of wanted them to drop out. Although it's kind of, if they all drop out, then that solution didn't work at all. So we lose the a x squared e to the 3x terms. We lose the a x e to the 3x terms. Now our left side is really what? What's left on the left side? e to the 3x times what? 2a? That was our only non-x, non-x squared term. All that stuff. Right, but we just took them in groups. And we looked at the ones that had x squared in them. We had 9a minus 18a plus 9a. So they all dropped out. But what about like this minus 6e to the 3x? We distributed that 6, didn't we? Did we distribute the minus 6 to this guy and get minus 18 here? I think we took care of the minus 6. And the minus 6 times the 2a here gave us what? Minus 12a right there? So we took care of the 6. And if the e to the 3x is bothering you, we factored that out all the way out in front of everything. So we took e to the 3x completely out to the left because it was here and here. And I left it out, but I put it back in there. So that. So I think we accounted for everything. So I think this is the only thing that's left on the left side. And on the right side, we've got 4e to the 3x. Let me take an aside here. If we ended up with everything on the left side canceling out, which we were well on our way to that happening, what would we have to do? What if we lost everything on the left side? Do it all over with x to the third. Right. We'd have to go back to the particular solution. We started with a e to the 3x. Then we went to ax e to the 3x. Both of those were scratched. Then we said, OK. What about ax squared e to the 3x? It has a chance. But if everything dropped out, we would have had to go back to the drawing board and make a new particular solution. So you kind of continue to modify or upgrade till we get what we want on the left side. Yes. What happened with that mean year? I'm a genius. The solution was wrong? No. That's really a great question. It just means that because of the nature of what you were doing on the left side, how many second derivatives you had, how many first derivatives, and how many of the original functions, what we thought would be a good solution that was safe. In fact, it was also not good. But it doesn't necessarily mean that it's part of the homogeneous solution that we generated. Technically, it is part of the homogeneous solution, but not the one that we generated. Yes. Is it OK to do overkill and just go to, like, X cubed first, just to make sure where you get it wrong? Even as ugly as that battle was, and by the way, that was a moderate battle for some of these problems, I don't think it's wise to continue to upgrade. I think it's wise to start with the one that you think is safe, because most of the time it is. And on a rare occasion, you're going to find out that it is not good. You're going to have to opt to the next solution. So what's next? 2A has got to be 4. So A is 2. We do get a solution. So let's go all the way back to our particular solution. We called it what? AX squared E to the 3X. We now know that A is 2. So it is 2X squared E to the 3X. So our final solution is the homogeneous solution. Let's go all the way back to that. C1 E to the 3X plus C2X E to the 3X. And then we'll add in our particular solution. That's probably a middle of the road kind of problem. Questions about any part of that? All right, let's start the next one. We've got five minutes. I know we're not going to finish it, but let's get a good start. And that way we will have seen an exponential, actually two different kinds of exponentials, one where we had to modify the solution. And then this one we'll get a look at one that has trig and not just any trig, but sine or cosine on the right side. Now, if the left side looks familiar, we have actually done this problem as an example problem. So this category of stuff on the right side will be a sine of something, X2X5X, or a cosine of something, or a sine plus a cosine. In any of those three categories, we would always start with the same type of particular solution. Characteristic equation, not going to factor. Quadratic formula, negative B plus or minus B squared, minus 4 times a times c, all over twice a. 100 minus 164 would be negative 64. Square root of negative 64. Heat i, thank you. 5 plus or minus 4i. So alpha is 5, beta is 4. So what is our homogeneous solution? That's the third case. So we will have reviewed the three cases as far as the homogeneous solution is concerned. By the way, we're actually doing this. Probably should write that down. That's what we're solving in part one of this problem. What is it? Mercy one, cosine 4X plus C2. OK, that's old stuff. Let's at least set this up, and then we'll pick it up from this point tomorrow. Particular solution. Well, we want to generate some sine of x's. Could we start with sine of x's with the original y thing, the first derivative of y, and the second derivative of y, and hope to generate some sine of x's? We're also going to generate what? Some cosines with that, because the first derivative of sines are cosines. Then the second derivatives of sines are back to sines. Does that work? So if we're going to generate some cosines, we need a way to get rid of the cosines as well. So let's start with some sine of x's. By the way, are there any sine of x's in any part of the homogeneous solution? We have some cosine of 4x's, right? And some sine of 4x's, but we don't have any sine of x's. Here's the kind of odd thing, is if we're going to generate sines, in this case sine of x, not only do we want to start with some sine of x's, we also want to start with some cosine of x's. And you'll see what happens when we throw the original y things in with the first derivatives along with the second derivatives. You'll see the interaction of sines and cosines. And it does become believable that we could just end up with sines, if that were the case. This would be a good place to stop, plus we're out of time. Another good reason to stop. See you tomorrow.