 So what we were doing was we were talking about second order, second order linear homogenous differential equations in constant coefficients, which is a lot of words to describe something like. So complicated. So a differential equation like that where B and C are constants, it could be an A in front of the y just divide through and you get one of those. And what we saw was that what you want to do to solve such a thing is that the solutions always look like, almost always look like sums of E to something. So we form the characteristic polynomial which we get by substitute y equals 2 to the lambda tm and see what values of lambda you get and you get lambda squared plus V lambda plus C equals zero. So I'm rather than going through all of that, I'll just remind you that this transformation is quite mechanical. The derivative tells you the power of lambda, coefficient tells you the coefficient. So since this is equal to zero derivative, that's a constant. And then we factor or if you can't factor, we just use the quadratic formula so that it's going to be negative V plus or minus V squared minus 4A to the power of C over 2. And so we have two choices of lambda and our solutions then look like, well, mostly, A, E to the, let's call this lambda 1, lambda 2. Lambda 1, am I using t-raps? A few times. Plus B, B to the lambda 2, s. Right? So everybody remembers this? Anybody confused about this? You need me to say more before I go on? Yes or no? Okay? So, but there's a couple of cases here. So, this is in the case where lambda 1, lambda 2 are different and they're both real. Right? There's really, if we think about this quadratic formula, there are three cases. There's the case where, and maybe I'm just writing in the three cases, let's call it three, three cases. There's one where b squared minus 4 ac is positive. So that means that lambda 1 is not equal to lambda 2 and they're both real. And in that case, the solution looks just like this. I did several examples of that last time. There's the case where b squared minus 4c is negative. So that means that lambda 1 and lambda 2 are complex. I don't know that notation. They're complex numbers. So they look like a plus or minus b, bad tricks. Is that what we used to be for something else? R plus or minus s I. And so this formula still works. But in most applications, it's not what we want to do because we start off with, I'll do an example in just a second, we start off with an equation with real numbers and we wind up with solutions that are complex. And last time I did a little manipulation. I could do it again if you're confused. But I did a little manipulation to see that you can turn the sum of exponentials with complex coefficient into a sum of sines and cosines with everything real. So that would mean that our solution looks like, so if it's r plus or minus s I, we get e to the r x times something times the cosine plus something else times the sine. So I'll do another example of this in just a second, well maybe a minute. And then there's the third case that I didn't do yet. Where the discriminant is zero and that means I have a double root. So let me do that case, I don't know. So should I go through one of each of these cases? Okay. Let me do it in the context of, well let me just tell you the answer here. So then I just have it in one place and then I will go through it. So if the thing is double, then when we try and use this formula, you get something like a e to the lambda x plus b e to the lambda x, a and b are arbitrary, so that's just the same as c e to the lambda x. So when we get one term, but we need two. So it turns out that if you, I'll check this in a minute, if we multiply it by x, it's still solved in this case. So this would mean that our solution is, and so I'll just tell you, I'll do it later, it looks like e to the constant times e to the lambda x plus another constant times x e to the lambda x. So we pick up this surprising factor of x. So we'll check that that works in a little bit and it only works in the case where the two roots are zero. I mean, are the same, where the discriminant is zero. So we have three cases. We have real and distinct solutions to the characteristic polynomial. We have complex conjugate solutions to the characteristic polynomial. And we have a double solution to the characteristic polynomial. Three different cases. So let me just do an example of each, I'll do sort of the same example in each of these three cases and let me do it in a physical situation. So if you have, I should have stopped the physicist when he was here, maybe the toys were still in there. Let me look. No, can't get in there, he got it. So, you know, physicists tend to have toys when they do physics. So if you have a spring with some weight on it, I mentioned this before that this is, and then I'm going to push it. And it's going to go bouncy, bouncy, bouncy, bouncy. That's all, have an oscillator. And in fact, maybe just for fun, I'm going to put this spring in some liquid so that this liquid could be something very viscous or something, you know, something that alters a lot of the resistance. It could be like honey or it could be like alcohol. And in some cases, that would make it like honey. The spring would move very slowly when I pull it down. And in cases when it's some fluid like alcohol, it'll move a lot, okay? Or the fluid could be air, it doesn't matter. So if I have a spring like this, then you might remember that so the force, the acceleration due to gravity, force equals mass times acceleration, let's set up a coordinate system here. So all I'm going to care about is the height here. And this is x equals zero, and this is just when it's just hanging here. And so this is x bigger than zero and x less than zero. So x, oh, let's call it y, let's call it y, since it's vertical. So y is the position, the deviation of the center of the weight from where it is if it's just hanging there. And so if force equals mass times acceleration, well acceleration is the second derivative of y with some constants. So let's just put some constants here, right? There's a second derivative here floating around. But we also know earlier from Hooke's law that the stretching as in the spring is proportional to how much you stretch it. So this tells me that the force here is some other constant prime, why is it a y and not a y prime? Why is it a y and not a y prime? I don't know. Anyway, the force here is proportional to the amount of stretchiness, and then we also have a y prime because we're going to get the thing moving. So if you put these things together, I'm not going to put them together because it's glass. But if we put these things together, we wind up with an equation that looks like it involves second derivatives, y's and y primes. And we wind up with something that looks exactly like y prime. Well, let me just start with one, one easy one. Y prime, no, that one's not the one I want. Let's start with the easy one. Y double prime plus 6y plus 5y, something like this. Maybe, I mean, the 6 and the 5, I chose just to make sure that the numbers come out right. So if you mess with this kind of situation, you'll arrive at an equation like this. Everyone, believe me, I mean, I didn't go through all the derivations, which we can't commit in five minutes, but it's reasonable that this would describe it. Yes, no, maybe, okay. And then we would have some initial conditions like, well, let's say I just picked the thing up and I slammed it down. So that would be something like saying, when I start looking, I picked it up one unit, I'm going to lift it up a little bit and I'm going to throw it downward. So throwing it downward would tell me when I start, the derivative, the speed of the thing would say minus 10, right? So I'm going to have this weight on the spring. I'm going to lift it up and I'm going to slam it down. And I want to know what does it do? So we can solve this. This one's easy to solve. If we write the characteristic polynomial for this, we get lambda squared plus 6 lambda plus 5 equals 0. And that factors very nicely into lambda plus 1, lambda plus 5 equals 0. And so that means that my solution looks like y equals some constant that I haven't figured out yet, e to the 1x, oops, sorry, negative. So this means that lambda is minus 1 or lambda is minus 5. So a e to the minus x plus some other constant e to the minus 5x. So that gives me my y as a function. So that describes what this looks like. And then I gave some initial conditions here. So let me go through finding what the equation is with those initial conditions. So is everybody okay with this? This is what I did last time. Any questions? So here we know that y of 0 is 1. So that tells me that when I put in 0 for x, I get a times 1 plus b times 1. So a plus b is 1. And also the derivative of this, which I'll just write here, y prime, if I take the derivative of this, I get a minus a e to the minus x. Minus 5b e to the minus 5x. And so taking y prime, which for my initial conditions is minus 10, I have minus a minus 5b equals minus 10. Let me write it over here. If I add these together, when I add these together, the a's cancel out, the b's give me a minus 4b equal to minus 9. And so b is minus 9 over 4. Since a plus b is 1, yeah, that's what I said, b is minus minus 9 over 4, I just studied. b is 9 fourths, since a plus b is 1, 9 fourths is, well, so I subtract 1 from this to get negative 5 fourths. Is that what I got before? It is, okay. And so that tells me that my solution for any time is given by minus 5 fourths, e to the minus x plus 9 fourths e to the minus 5 fourths. And if you draw a graph of this, well, it's starting at height 1 and then I slam it down. And what happens, in this case, it's in, say, honey. So it goes down and then it comes slowly back up. So the spring, in this case, because this fluid is very viscous relative to the loads of weight. Anyway, the fluid is very floppy. So when I slam it down, it comes back up very slowly, right? So this is the position. So it overshoots and then it slowly recovers and then it ends back towards the original position. Yes. Why was Hooke's Law? Okay. So I just gave you, you didn't need to do any physics. You didn't need to derive any equations. I just tried to justify that this might be a reasonable equation to use because there's a second derivative coming from gravity and there's a first, there's Hooke's Law giving me a force relative, right? Giving me the force on the spring. And so this is the kind of thing you're going to do. Certainly, if you were taking differential equations class, I'd give you an entire class showing you exactly where all the constants come from and all that stuff. But that's not. If you want, you could probably find it on Khan Academy or U2 or something, okay? So this is one version. Now let's use the same situation but I'm going to tweak the equation a little bit. So suppose I have exactly the same setup but I use a slightly different spring and a slightly different resistance due to whatever. I take the water away from the honey or whatever it is. And so you can certainly imagine that if I change the situation a little bit, I'll change this equation. Other than everything else will be the same. So let's change this equation so that that 6 becomes a 2. So same situation, again, I'm going to lift it up one unit and I'm going to slam it down to the force of minus 10. And so here, when I try and factor this, it doesn't factor so well. Because, I mean it does factor if I want to factor it over the complexes but, did I do this right? Yeah. So let's look at the quadratic formula. So I have negative 2 plus or minus square root of 4 minus 4ac of the 2, this is my value of lambda. So that is negative 1 plus or minus square root of negative 16 so that's 4i over 2. So here I have complex values of lambda. Which means that, well it is true that y does equal some constant e to the negative 1 plus 2i x plus b e to the negative 1 minus 2i x. This is true for appropriate choices of A and B. But the A's and B's that we want will also be complex and the solutions that they want, what we want certainly would not be complex numbers because they describe the position of an object, they have to be real. So we go through the manipulation that I went through last time. We don't use this form, we use this form and so that means that our solution is, let me, these are different numbers. Are we okay? So the solution that I get here is A, well, is e to the minus x which comes from this minus 1 times some constant times the cosine of 2x plus another constant times the sine. So there's two constants which give me a cosine and a sine. Is this okay or should I go through why this is? We're okay with this? So the minus 1 comes from the real part and the 2 comes from the imaginary part, okay? So this is the solution we get and now using the same setup we can solve for, we can solve for what? So since we know that y of 0 is 1 and y prime of 0 is minus 10, well I guess I have to write down what y prime is, huh? So I guess I'd better figure out what y prime is. So y prime is, it's a product, so any product rule would be e to the minus x, the derivative e to the minus x such as minus e to the minus x, A cosine 2x plus B sine 2x plus, I need to use the product rule, e to the minus x, derivative of cosine is minus sine and I get a 2 from the chain rule and the derivative of the sine is the cosine, so I get that. So now I'm going to solve y of 0 is 1 so when I plug in 0 over there, so y of x, when I plug in 0 this becomes a 1, this becomes a 1, this becomes a 0, so that means A is 1. Let me just emphasize it, it's 1 times A times 1 plus B times 0 equals A, so A is 1 and y prime of 0 is, so this becomes a minus 1, I already know A is 1 so I don't need to worry about that yet. A, oh A is 1, duh, 1 plus, well the sine is 0 is 0 so that's 1 plus 1 times minus 2 times 0 so that's gone 2 times B, that equals minus 10. So that means 2B is 9 minus 9, 2B is 9, oh yeah, that's what I got before, so B is 9 times 9, so that means that the solution looks like y of x is, where am I? Y of x is A to the minus x times the cosine of 2x minus 9 halves to sine, now if we draw the graph of this function it starts out here at height 1, we slam it down on the very steep derivative, it goes down, it comes back up, it goes down and up, looks like that, so it goes boingy, boingy, boingy, boingy, and the E to the minus x kills off this, the oscillations are done by about 10, but they're not really done, they're just too small to see, so this thing always oscillates that the oscillations become too small to measure, okay? So then, so we have these two different situations from very similar but slightly different situations and then we have the third case which I didn't do yet, everyone okay with this? Am I going too slow? Am I going too fast? I could also like this. Okay, so we have this last case here where if the root is a double root, so that would be something like y double prime plus 2y prime plus y equals 0, so in this case, we get lambda squared plus 2 lambda plus 1 is 0, so lambda plus 1 squared is 0, did I factor right? So that means lambda is minus 1, but twice and so if you don't think very hard, you would think that the solution just looks like y equals some constant e to the minus x, but that doesn't give you everything. We have to add on another constant x e to the minus x. Now, let's just check that this works rather than, so I'm just going to claim it looks like that, let's just check that this works. Actually, I'm just going to check that x e to the minus x is the solution, because we already know if we have one solution and we add it to another one in all of these equations, we justify that the solutions add together. So let's just check that x e to the minus x works, so if y equals x e to the x minus x, then y prime is e to the minus x minus x e to the minus x and y double prime is minus e to the minus x minus e to the minus x plus x e to the minus x, did I do that right? The derivative of this is minus e to the minus x. The derivative of this is minus e to the minus x plus x, yes, that's right. So this is minus 2, okay, so let's check if that solves this equation. So if I take y double prime minus 2 e to the minus x plus x e to the minus x, that's y double prime, and I add on twice y prime e to the minus x minus x e to the minus x, and then I add on one more x e to the minus x, I should get zero. So this one cancels that one, two times this cancels one of those and one of those, so this would be equal to zero, so it works. So in this case, in the case where you have a double root, multiplying by x will always cancel out. You could check that in general, but let's do it just for this example. So the solution looks like this. I guess I'll come back here. So we have these initial conditions, so we go through solving, I don't know, do you want me to go through solving for the initial conditions so everybody feels they can do it? Does anybody want me to do it? Okay, I didn't hear any positive, I heard it again, I don't know whether that was just the null place. Okay, so if you do that with these initial conditions, you get e to the minus x minus 9 e to the minus x. So in this case, this solution also looks something like this, it's a little fatter and goes a little further down. So if you go through with these initial conditions, the solution you get is this one. So you can check that for yourselves. Again, it works exactly the same, you just do the same. Okay, so are we tired of these now? Good, so let's move on. So we'll come back to these a little bit at the end of the class, not the end of this class, but the end of the course. But before that, we're going to turn to a different type of differential equation, so one that we talked about already, which, so we talked about sort of at the start of the differential equation section and then also just before Thanksgiving, something like population growth, a differential equation like this, which gives us, this is separable, we can separate, and this gives us that p of now let's switch to t instead of x for some reason, p of t equals a e to the k t. So these are these exponential growth type models, and this says that the population just grows exponentially, just continues growing without them. But in a lot of cases, this is not a realistic model. This is true for small values of the population relative to something or other, but often what you see is that the population grows graphically when it's small, but then it tends to limit on something because the population runs out of space, or runs out of food, or runs out of some kind of resource. So we have instead of this, let's run it again, instead of this unbounded growth, so this is, what happens is it grows rapidly, but then it has to limit on something. So this is a different method. Well often we want to put some limits to the growth. We want to say, well, it can't grow beyond this amount because if it grows beyond this amount, stuff will start to die off. So we put in a factor, so this is often called the carrying in capacity, and let's just call it m for maximum. So if the population gets above m, then the growth rate will be negative. So I think I've seen estimates that the carrying capacity for humans is estimated to be on the earth something around 13 billion. We're at about 7, so we're at about 7 billion now. So we're sort of somewhere here, if this is a valid model. But things would be very unpleasant if we had 13 billion people. But, you know, you can also imagine if we don't think about people, we think about bacteria. You put bacteria in a dish, they multiply, multiply pretty soon. The dish is just full of bacteria, so they start dying off. So the modification here that we would put to this is we would say, okay, for small values, I can forget about the FT. Well, let's see here, for small values it grows exponentially. But then for big values, we want it to die off. So if p is close to m, then this will slow the growth. Right? If we just look at this function, this function is positive with the derivative of k near p equals 0 and limits towards 0 and p tends towards m. So if we look at, okay, so this is called a logistic model I have no idea why the word logistic is here, but this is what it's called. And so that gives us a limit and this is sort of the most common but by no means the only model for population growth that looks something like that. So we talked about this a little bit. Let's analyze before we try and solve. So if you're bored, you can just not listen to me and you can solve this. I'll do it later. Maybe I'll do it. Should I solve it first or should I talk about how to do this? It takes about 15 minutes to write the equation. Well, let's do this. You want to do that. You want a formula. You don't want to know how it behaves. You just want a formula. Okay, let's vote. So how many people want me to derive the formula that is the solution and the other choice is for me to talk about how the solution can't even all derive the formula on Friday, but how many people want me to derive a formula now? How many, she really wants it. How many people want me to talk about how the solutions look? I'll do that first thing on Friday. So on Friday I will derive it. If you don't want to listen to me talk about how the solutions look, you can do it. So let me tell you how you solve this. You separate variables and you get Dp over P times 1 minus P over M. M is a constant, K is a constant, equals K. You separate variables. To do that integral, it's partial fractions. So you do a partial fraction, so you get the integral and then you solve it. So have fun. Okay, so let's think about how this behaves. I talked about this a little before. So here is the P axis, here is the T axis and notice that if P equals 0, P prime is always 0. So that means that somebody stole my colored chalk that I brought here. Hold on. That this is the solution. So we have an equilibrium solution which makes sense from a model. If there are no, what are we modeling? This is modeling the growth rate of narwhals. So if there are no narwhals, we don't get any. Narwhals, these are these fish with the big horn. They're whales with the big horn, yes. Okay, they're not fish. Okay, so we're modeling the growth rate of narwhals. So maybe it should not be P, it should be N. N for the number of narwhals. Okay, so if we have no narwhals, they won't spontaneously appear. So having none, we always have none. But if there's a couple around and hopefully they're both male and female or they're very special, then what will happen, what we expect is that well, the population will grow somehow. So let's check that this model agrees with that. So for N small, N prime is some constant which is bigger than zero and one minus, and so, and let's think M is big. M is, I don't know, a million. There's another zero. So for N small, this is pretty close to one. And this is a small number, but it's multiplied by a positive constant. So this is bigger than zero. So for N small, the derivative is bigger than zero. If we were to make a direction field for this, for small numbers of narwhals, we get a small but positive growth rate. So if you have two narwhals and you wait a while, then at least then you have three or four narwhals. And then you wait some more and then you have eight and then you have more and more. So as N grows, as N increases, the derivative increases and so we get more. So the direction field will look something like that. But if the number of narwhals is too big, it's close to a million, well, let's just notice, if we have exactly one million narwhals, this is zero, which means that when we have exactly one million narwhals, we always have exactly one million narwhals. So the number that died is exactly equal to the number that I wore. And for N a little less than, I'm going to just write 10 to 6, so for N big but less than a million, notice that N prime is positive but not very big. Because this number is very small, this number is big but they cancel out and then we have a constant here. So again, we have this kind of behavior and in between it grows and then it falls off. So solutions will look like this. And if N is bigger than a million, then this term is negative. So if we have more than the carrying capacity, the growth rate will be negative, which means we will get fewer. So that means here, solutions will decrease because N prime is zero. So we can notice that this differential equation doesn't involve any x's or t's, they're all hiding. Differential equation is stated purely in terms of the function. There's no dependence on time. If we have a million narwhals now or a million narwhals a hundred years ago, whoops, wrong way, behavior is the same. It only depends on how many narwhals there are, not how many years you wait. This is called an autonomous differential equation because there's no dependence directly on the independent variable for time. So autonomous means no independent of time. We think of our dependent, our variable t as being time, this is autonomous. That means that when we shift the solutions to the right, not that we get the same shape of graph, right? So this shape looks the same if I just move over here to a later time. So that means if we look at an autonomous differential equation, all we really have to think about is the vertical line. The line N, we could put everything on this line. We have an equilibrium point here at N equals zero. Just think about what happens so we're going to make a movie here, but I'm going to make the movie on the line. This is the population. Time goes, we start with no narwhals, we wait a hundred years, there's still no narwhals. We wait a million years, there's still no narwhals. We wait a billion years, oh, it's evolution, now there's some narwhals. Okay, so we have that and we have another one at N equals N to the 6th. This one is repelling in the sense that if you start here, you move up. This is saying that N prime is bigger than zero. If I start above this, I move down. And if I start below this, if I have a negative population, I take it away. So I can describe everything just in terms of this picture. If I start with a small amount, I get more, more, more, more, more, and limit on this. So this is a general thing for these autonomous equations. For example, if I had another term in here, I could look and see when in that one's zero, two, and I would get three places where it stops. And it would move from one to the other and the other to one. So this is, so you can, this picture is the same as this graph. This graph is involved in T. This graph, you have a movie. You just go up. Is the relationship between these two relatively clear? So this is T. Here, I've suppressed the T. The reason that I'm doing this is because probably on Monday, maybe on Friday, we'll do this with the two variables. And there's not enough room on the board to put the T in there. Okay? So here, these are two different ways of looking at the same thing. So maybe this is a good time to stop. So on Friday, I will separate these variables. And if you have, we're easier on Friday, right? Okay, good. So then I'll do the separation of variables. And so of course, you can do that yourself.