 So I hope everybody had a nice break, but I'm going to get you recovered by now. So I'm going to sort of pick up a little bit of that thought. So we were working on, well, so we had done separable differential equations. We're going to move on to another type of differential equations. This is not in the book, so there are some notes. On the second word, we've got some equations. I forgot the word complicated equations. So these are, there's a link to these on the schedule page. The type of differential equation is pretty straightforward to solve. It comes up a lot in various applications. I was talking to people in biomedical engineering the other day. They were very happy to do this in NAPLM 32. They said they would show it under the NAPLM 31. But the standard kind of physical system that corresponds to this differential equation, I already talked about it once, a little, is if you have, say, a weight, this is a weight on a spring, and you pull it down and you let it go, then it can do various things. But if you know a little bit of physics, the weight, the force corresponding to the weight, the force corresponding to the weight affects the acceleration, so that's the second derivative, and then the spring because of the plot is the first derivative. So we have something, these kinds of things. So I'm not really going to talk about the application very much, but a weight on a spring is sort of a standard model for the kind of behavior that you see or, sorry, if you want to model a weight on a spring, you can get these kinds of differential equations. The kinds of differential equations you look like, we're going to do our things like 3y double prime plus, I don't know, I'm just making up numbers, 2y prime minus 4y equals 0, something like that. I'm not going to do that one right away. So this is called a second order because of the weight, because the second derivative involved. The linear is because the linear homogeneous part, this is the homogeneous part, means that it equals 0. Constant coefficients means that these are numbers instead of functions of x. And linear means that the solutions add together. I'll talk about that a little more. So anyway, this is the kind of solution, this is the kind of differential equation we're going to talk about today or maybe Wednesday, depending on how far we get today. So rather than, so this can always be turned into, if we divide through by, like so in general form, this would look something like a y double prime plus b y prime plus cy equals 0 for constants a, b, and c. And we can easily turn this into something that looks like y double prime plus b y prime plus cy equals 0. This is a big C, just by dividing through by a. But I'm really only going to look at this. Okay, so suppose we, let me just try an example here. Let's say we have a fairly simple one, like, oops, that's the wrong one. So let's start with a fairly easy one, like the second derivative. So this is the same thing as the second derivative minus the function equals 0. So let's make it equals, the second derivative equals 0. Okay, so this is the same thing, just setting it all on one side. Now what would you think a solution would look like? Just a guess. e to some power, right? So if I guess e to the constant times x, then what is this telling me? So let's just see. So we just plug in. So if y is e to the x, y prime is k e to the kx. That's an x. And y double prime is k squared e to the kx. And so that would mean that we would have to have, I shouldn't use my board very well, oh well. So if this is true, then that would mean that we would have to have k squared e to the kx minus k e to the kx equals 0. So now we can factor the e to the, so we can factor the e to the k, actually factor this. So if I factor this, I get e to the kx times k times k minus 1 equals 0. So what is this telling me? The possible value is k. e to the kx is never 0. So what can k be? 0 and 1, that's it. So this means that my solutions then look like, so that would mean e to the 0x, and this would give me e to the 1x. So this is a constant. And of course, notice that I could put some constant in front of this, right? So the same thing, well, so these should both work. So e to the 0x is just 1, and e to the 1x is just e to the x. So these both just work, and we can check that. I mean if my y equals 1, then the derivative of y equals 1 is 0, and the second derivative is 0, and certainly 0 equals 0, so that's no problem. And here the same thing is true. If my function is e to the x, then the first derivative is e to the x, and the second derivative is e to the x, so this works too. And if I take any constant of this, if I multiply 1 by any constant, it still works. If I take a, a is some constant, then the derivative of a is 0, the second derivative of a is 0, so that still works. And if I take this and multiply it by b, then b times e to the x the derivative is b e to the x, and the second derivative is b e to the x, so that still works, yeah? I didn't, I just guessed it from the hell of it, and I checked. In fact, for these things, so this is just a guess. He told me the solution was e to the x, and he was right, yeah. So, okay, so let's check that. Multiplying by the solution, everything's good. So y equals a is good. y equals b e to the x still works. Just check it. Adding a constant, well, this is adding a constant. Okay, so what I want to do, instead of doing d plus c, yeah, so I'm going to do that, but I'm going to do it in a different way. So let's call this y1 and let's call this y2. So, if I add these two things together, will that work? Given that y1 solves, and given that y2 solves, shouldn't it be true that y1 plus y2? Does this solve? Well, it should, because if we look at this equation, if it's true for y1, then y1 double prime minus y2 double prime is, minus y1, ah, try that again. y double prime plus y1 is zero, and y2 double prime plus y2 is zero. Then if I add them together, then I'm really just adding zero plus zero. So it still works. So if I add, if I take any multiple of these things, or I add them together, I get another solution. That's what the linear, in the second order linear constant coefficient business means. The linear means if I take multiples, if I take multiples of solutions, or I add them together, I get another solution. Just for the hell of it. I'm trying to find all the solutions I can find with the equation on the board. Right, because this had a prime. So, so, so the equation had, everything was prime, and there was no non-prime term. What should what be negative? Here? Oh, okay. You're right. And this one's minus two. Those are minus two. That's a minus, that's a minus. All the pluses are minuses, except the ones that need to stay plus. So if I group these together, this is zero, and if I group these together, this is zero. Now, this seems like it, so that means that for sure I know this is a solution. Now, the one thing that I can't really prove, or even joke while I can sort of justify, is that there are no other solutions. So the reason we know this is a solution is in order to know that this is all of the solutions. You need a little linear algebra, or you need a little more differential equations theory. So, when you think about what we've been doing with the first order equations, we always get a single constant in our solution. Our solutions always look like A e to the 5 x, or some single constant of integration. Here, because it's second order, I will get two constants of integration. I have to integrate, and then integrate the integral. That means there will be two constants floating around. Here I have two constants. There's not room for more than two constants. I can't justify that other than to just say it's true. It's because these form a vector space, and it's a two-dimensional vector space, so this is enough to span. These are all words from linear algebra. In linear algebra, you develop the theory that there's only two. There's always two. That means that there's other solutions floating around. Here, when I take y2 equals B e to the x, I'm just choosing A equals 0. When I take y1 equals some constant of A, I'm just choosing B equals 0. There are two solutions that can add up and generate everything. This is a specific example, but in fact, this theory is completely general. Yeah? All of them? Here's all of them? Okay, so I'm leading into... I'm going to tell you how to find all of them always. But I haven't done that yet. Just like if I ask you to give... So the word for this is that this is the general, this is the completely general solution. There's nothing more general than this. So it's not general in the sense that you salute it, but general in the sense that it's... I don't know, general. That it's the one that applies to all. So if you have a question that says, find the general solution to this differential equation, it means you need to find both. You need to find two constants, and you just leave them as two constants that you're not saying what they are. This is a particular solution, whatever way. There, e to the x is one solution. Five e to the x is another solution. So if the question says, find any solution or find any solution, then you could just say, y equals zero, we're good. So you have to read the question carefully. You have to know what you're being asked. If I asked you, you know, to make me a cookie, that's different than if I asked you to make me a batch of cookies. You have to listen to the words. If somebody said, okay, bring me a batch of cookies and you bring them one, they'd be a little annoying because they expected to have like 24 or 30 cookies to give to people. But you bring them one cookie and you bring them up with a little bit. It's kind of annoying. So here, the words are, find the general solution to this differential equation. Let me do another specific example. So say I had something that looked like that. y double prime plus three y prime plus two y equals zero find the general solution. So I'm going to just make the same guess. I'm always going to make this guess, but now I'm going to make the following guess. And I'm going to guess, and here I'm going to switch to lambda instead of k, just because people tend to use lambda. So lambda is just a few further there. So I'm going to guess that the solution looks like y equals e to the lambda x. And if I find two different solutions with two different values of lambda, I claim I will have found them all. So what values of lambda will work? So if y equals e to the lambda x, then y prime is lambda e to the lambda x. And y double prime is lambda squared e to the lambda x. And so that means that this differential equation becomes lambda squared e to the lambda x plus, or not the differential equation, if this is the solution, then I will have this equation. Lambda squared e to the lambda x plus 3 lambda e to the lambda x plus 2 lambda plus 2 e to the lambda x equals zero. And as before, I can factor out the e to the lambda x. This is number zero. And I'm left with lambda squared plus 3 lambda plus 2. And that's supposed to equal zero. So if lambda squared plus 3 lambda plus 2 equals zero, then that's the same thing as saying lambda plus 1 times lambda plus 2 equals zero. Minus 1 for lambda lambda is lambda is minus 1 or lambda is 2. Minus 2. So that means that my solution, so let me just write it the long way and then I'll be matured. So y equals e to the minus x or y equals e to the minus 2x I guess it's not important and should both work. And in fact, just check they both work. And in fact, if I multiply by any constant this one will work. And if I multiply by a constant this one will work. And if I add it together, it will still work. y equals some constant e to the minus x plus some other constant e to the minus 2x. That's my general solution. Now, if I add a constant it's not going to work. I'm going to add c. If I have my constant y equals if my solution is y equals c I don't get a solution here because then that means that y prime is zero. y double prime is zero. And so that means I would have to have zero plus 3 times zero plus 2 times c equals zero. It tells me c is zero. So I can't add non-zero constant to my solutions. I don't get an additive constant of integration. In the same way that if you have an exponential solution you don't add a constant. You multiply by a constant. It only works very rarely if you have an additive constant. Yeah. Yeah, if there's no y-turn you can add a constant. So let me try and do this a little more generally. The example is over and over. In fact, it's a lot faster to do these things than it seems like from what I'm writing. So let's just do it once and for all. Or should I do one more example? Let me do one more. Actually, let me do one more example with numbers and then I will do it generally. So how about 1? y double prime plus y. So this was almost like the last one. I'm going to do this one very fast. I'm not writing anything down. Suppose I guess y equals e to the lambda e to the lambda x. What's going to happen? Well, just look at this. The e to the lambda x factors out and everywhere I have a y prime I get a lambda squared or something. Everywhere I have a y, I mean a y double prime I get a lambda squared, a y prime gives me a lambda So just for looking at this I get lambda squared plus lambda plus 2 equals 0. If I go through all these processes of making this guess and substitutions and so on like I did over there this is what's going to come out. This has a name. It's called And so all the process is everywhere I see a y double prime I write a lambda squared. Everywhere I write a y prime I write a lambda and everywhere I see a y I write a 1. That gives me a new equation. But this is an algebraic equation. I can solve this. This factors as lambda plus what did I do wrong here? Let's make this one a minus. I'm sorry. I'm not ready to do the other one yet. This factors as lambda No, what did I do wrong here? I want this to be a minus, right? Sorry. I'm having trouble with pluses and minuses. Actually try all the combinations one of them will work. There aren't so many. Did I factor this right? I think I factored this right this time. So I factor it. There it is. And now I'm done. A general solution. So this is true when lambda equals lambda or lambda equals plus 1. And so my general solution is just a constant times e to the 2 write a 2 plus another constant times e to the 1x. So I'm done. So that's very easy. These things are actually very easy. Of course we'll make them harder in a second. Too easy. You know. Question hard? Will I make the question harder? A couple more questions. We'll have a whole variety of these. This is the simplest case. So, okay. So when you have one of these guys you write down the characteristic polynomial. You factor it. And your solution is just the roots of the characteristic polynomial of giving the powers to go on the x. That's it. If we suppose before I move on a little bit suppose that I have initial conditions. So to make it a little harder but not really harder harder just more appropriate. So for example suppose that you have a specifics this would model this would solve some differential equation that looks like that. A specific weight. A specific spring. This would give me a specific behavior I want to model. That is suppose I know y of 0 is 0 and y prime of 0 is 1. So this would be some initial conditions. This will tell me the value of A and B. So I just use this is my solution to solve this problem. So I use this equation here. I know that y of x is A e to the minus 2x plus B e to the x. So y prime of x is minus 2a e to the minus 2x plus B e to the x. So y prime of 0 which I happen to know is 0 is 2a negative plus B. And y double prime of x is minus 2 times minus 2 is 4 is still B. So that means that y double prime of 0 is 4a plus B and this was 0 and this was 1. I have no idea why I did that. This is 1 and that's 0. Sorry. My initial condition for y of 0 is 0. Y prime of 0 is 1. So y of 0 is 0 that means A plus B is 0. Y prime of 0 is 1 means negative 2a plus B and I just got carried away here. OK. So now we can solve this. It's easy. Since A plus B is 0 that means A equals negative B. And so since A equals negative B negative 2a plus B is the same thing as, well, I can replace A with negative B but that's negative 2 because it's kind of negative B plus B which is the same as 3B is 1 so B is one-third. So that means that my solution with these initial conditions of course I didn't quite agree with you enough so I'll put it here in box is y of x is minus one-third E to the x plus one-third E to the x. OK. Now look at what this looks like. This is something that goes point. So the graph of this solution looks something like this. Which is what would happen if you have a very powerful strain and a weight and pull it down and you let it go. It's strong because the weight will come down and it will just gradually move back up. OK. So any questions on this? This method is really quite straightforward relatively easy. I didn't really justify why it works but it works because it works. There is a theory why it works but it's not for this class. Yeah. The position of the weight. So I pull it down and I let it go and then level off to some level. With the specific system and specific initial conditions that I gave you certainly see that if I have not quite a heavy weight you might see something that goes like that. So, yeah. OK. So let me just tell you almost well, we just try this again. Let's try it. OK. So here's a fact that I will not justify. I will just say for any second order linear differential equation homogeneous differential equation with constant coefficients which looks like y double prime plus by plus y prime plus cy equals zero. So one like that the general solution is always let me take out the word always. Well, it's always if you know what always means. y of x equals some constant e to the appropriate choice of lambda plus some other constant e to the other appropriate choice of lambda. So this can be proven but to prove this it's typically not in the differential equations class and it uses a little bit of linear algebra. So this is a theorem that you don't really I can't really justify without another year of calculus or so. I could do it faster than that but you take the rest as a method. OK. So this is just always true. Now there's a little bit of coupling on here so let's say almost always because there are a couple of caveats that I didn't write down. So let's look at the general case and notice that in fact we could if we want write down a formula but I don't recommend it if you want to write down a formula for lambda 1 and lambda 2. So let's just look at that y double prime plus b y prime plus c y and see what we get. So if I take y double prime plus some number of b that I'm not telling you by these constant plus c y and we do the same trick I'm going to look for a solution of the form y equals e to the lambda s So the characteristic polynomial is lambda squared plus b lambda plus c equals 0. That's my characteristic polynomial. So for what lambda is this 0? I don't tell you b and c what do we do? We use the quadratic formula. Right. So this is a quadratic and a equals 1 b equals c and the solution to this is b squared oops plus or minus the square root what did they do wrong? negative b sorry negative b plus or minus the square root of b squared minus 4 a is 1 c over 2 So there are the two lambdas that I get out of here So that's lambda 1 and lambda 2 we need it off from the quadratic formula and so now there's a couple of issues here I find why I say almost always but let's still go with the always the interpretation of always and then I probably won't get to the almost So what's the issue here? Yeah So if the discriminant is bigger than 0 how do you do this? You just did two examples you get to do 20 more examples on the homework well maybe not 20 but a couple more examples on the homework What if if b squared minus 4 c is less than 0 what happens to lambda? It becomes complex and lambda is 2 So what? If lambda 1 and lambda 2 are complex they are to cover what b to a complex number is So that's no problem So let's just look at one like that Suppose I have So let's do the easiest one with a complex number So suppose I have y double prime plus y is 0 So that is b is 0 but then 4 c is certainly negative So then my characteristic polynomial is lambda squared minus plus lambda is 0 which is the same thing as saying plus 1, thank you plus 1 equals 0 So lambda is lambda squared is negative 1 so lambda is plus or minus i So if my solution y equals e to the lambda x then just following this little recipe I get y of x equals a e to the ix plus b to the minus ix which looks a little crazy I started off with a differential equation where everything is a real number and somehow I wound up with stuff in terms of e to the ix and e to the minus ix But we talked about this before What can we do with this? I can write it using Euler's formula So I remember that e to the ix is cosine x plus i sin x Right? This is something that we covered a couple weeks ago Euler's formula And so then e to the minus ix is cosine negative x plus i sin negative x Sine is an odd function so I can hold the negative out and the cosine is even So this is the same This is the same as the cosine of x minus i sin So that means that I have the solution e to the minus ix on something which I can write as let me add it first So that means So what happens if I take e to the ix and I add it to the minus ix the sines cancel out minus i sin x plus So this is cosine x plus i sin x plus that's e to the ix cosine x minus i sin If I subtract that If I subtract these two things then the cosines are going to drop out and the sines are going to add together because I have a minus to minus So this is 2i sin x Well I don't like i so just for the heck of it I'm going to multiply everything by i which gives me minus 2 sin x So what does that mean So if you remember the general solution is any multiple of e to the lambda 1x and any multiple of e to the lambda 2x I can choose my multiple and add them together and I get another solution That means I can choose my multiples so that one answer is a cosine and the other answer is a sin So that means that if I want this general solution ae to the ix plus b e to the minus ix For appropriate choices of a and b this becomes let's call it little a little b let's see one little a cosine s and little b sin If I choose little a and little b appropriate complex numbers I can recover these solutions If I choose big a and big b appropriate complex numbers I can get these solutions So this is still true in this case it's just that the lambda has become complex and that means that if we want real solutions they're still there they're just hiding a little bit and this gives us a pair of real solutions and that actually describes the spring that does this kind of thing something that looks like a cosine plus a sin gives you an oscillation like this you can get into an oscillation like this by appropriate signs and closings I'm drawing and fading out so it gives me something like that which can describe the motion of the spring within the absence of friction if you want to throw on friction that's something we're not covering in this class let's call it that that would be the non-homogeneous case that's the dam's case so what have we just done we have one case left to deal with we dealt with this case we dealt with this case when b equals zero well when b equals zero this is wrong I'm sorry when b squared minus 4c is zero when I have to double root this doesn't quite work this is still true as long as lambda 1 and lambda 2 are distinct if lambda 1 equals lambda 2 I don't have enough here I'll do that next time because we're out of time maybe I should do another example of this maybe with some conditions let's start off with one with a complex solution