 The girl who wanted me so badly to solve the logistic equation there, unless that's her over the hat. No, that's not her. Well, I guess we can't have class then. Okay. So, too bad. I lied. Thank you for watching. Okay. We're talking about logistic equations, which is a model of population growth. It's not really just population growth, just like the second order linear differential equations are not just models of weight on springs, but the most sort of natural interpretation in the one of which it was derived was for population growth, but a lot of other things as well. So we have exponential growth for small values of the population, and then we have a limit here. So this piece tells us if p is small, we have exponential growth, and then here we have a limit. So if p becomes m, then the differential equation stops growing, and it shrinks for p larger than m. So last time we saw, just by thinking about it, that here at p equals zero, and here at p equals m, we have equilibrium solutions. We're going to have some changes. And for small values, it grows, but then limits on m. So the solutions with something like this, or for values above m, be 10 towards m, and 8 values are down. So we can figure this out just by analyzing the differential equation. One thing I want to emphasize, because it will be more relevant later, is we can actually encapsulate all of this information in a one-dimensional picture, which says that we have nothing happening. So you think of this as a movie, these dots move. Well, this dot doesn't move because as time goes on, you just sit there. If you start between zero and m, the population increases towards m, so it starts here, and it moves up and then it's on that. Something above m would move down, and something down there would go like that. So this is a one-dimensional version of this picture. So as I move along this curve, my population does that. Okay? So the first thing that I owe you is to actually solve this equation, which you should be able to do anyway. But I will do it for you. Okay, so we can write it. So the logistic equation is a separable equation because I can get all the p's on one side and then have an integral that I can do. So I can write a formula for p. Let's use t as the variable rather than x. So I have dp dt. Is some constant that I don't know? Or maybe I do. It doesn't matter. It's some constant. p times 1 minus p over m. So here, m and m. Oh, I forgot to say. m is called tearing capacity. And so now we separate this. So we're bringing these guys over here. Put the dt over there. So we get 1 over p, 1 minus p over m. 1 over p is k. And then integrate both sides. So I'll do this one and you can do this one. This thing's there. So this tells us this is kt plus some constant. And here, well, to do this integral, it's not obvious it's looking at it. So what do we do to do this integral? Use partial fractions, right? So we can't just look at it and see, oh, it's obviously this. We have to use partial fractions to split up the integral to see what it looks like. So we use partial fractions. I'm really using a lot of rules here. So I have 1 over p times p minus p over m. And I want to split that up as a over 1 minus p over m. So that means that... So I'm going to use partial fractions here just to remind everybody that. But OK. So I want to split that up. So that means that when I cross multiply all the stuff, this means 1 is a times 1 minus p over m. So how do I find the constant? Do you remember how to do partial fractions? You could either put the terms together and then equate coefficients. So we have one person in the room that remembers this. This does not go well for what will happen on the final. So we want to find a... So how many of you don't remember how to do this? How many of you do remember how to do this too early for you to respond? OK. So I'm going to do it instead of multiplying out and equating coefficients, which is the same thing. I'm going to say if p is 0, then I have 1 equals a times 1 plus 0. So a is 1. And if p is m, p is 1 over m. Some term. Is that right? Yes. I know. So if p is m, then b is... I guess I ran out of momentum. So if p is m, then I have 1 equals b times m. So that means b is 1 over m. It doesn't seem right. Because I'm supposed to get it negative. Did I make a mistake? Let's see what happens. So b is 1 over m. So that means... So my integral over p times 1 minus p over m becomes then 1 1 over m 1 minus p over m. Oh, I see. That's where it comes from. OK. So this is... So this gives me... And then this integral... Well, let me clean it up a little bit. Let's multiply through by m. This is the same thing. So here I make the substitution u equals m minus p. So du is minus dp. So this becomes negative the log of m minus p. I said... Yeah. Oh, this is the log. Thank you. I'm letting that here. Yeah. That's an important thing. So I get minus log of m minus p. So this is log p minus log... These are absolute values. m minus p. Right? I hope so. And so now I need to solve for that equals this. The log... Well, actually, let's put these together. So this equals... Right? Since it's the log... A difference of logs. This is the log of the ratio ln p over m minus p. So that means that I have since from over there this integral, which is the log of m minus p equals kt plus c. So that's what I want to solve now. The log of p over m minus p is a constant times t plus c. So now I want to solve this for p. I'll exponentiate both sides and that tells me that p over m minus p is e to the kt plus a constant which I can just put inside. Everybody okay with this so far? Now I want to solve this for p. So I suppose I could cross-multiply and gather terms and... But it's actually easier just to swap sides. So here, if this is true, maybe I shouldn't call this a. Let me leave the c up here just for now. So if this is true, then it's also true that if I divide through by this and divide through by this or take the inverse of both sides I get e to the minus kt minus c is m minus p. And the reason I did that is because this becomes a one when I split it apart. It makes it a whole lot easier to solve for p. So now I can add one to both sides and then I'm going to cross-multiply again. I guess I can do that again. So that means that the solution to the logistic equation here... I might as well just put it here and then I know what it is. The solution to this, you see this is sort of like some little funny term here to mess it up, the one plus. Because I have a negative e on the bottom and so one over that is exponential for small values of t for small values of m and for large values of m. Not small values of m. Small values of the population and so on. Okay? So this is the formula that we have for that. We should do a problem or two using it. So the method that you do in all of these properties is sort of the same. So let's... So suppose now the population of rabbits on some island has grass and there's nothing there but rabbits. So rabbits are perfectly happy to eat grass. There's nothing but rabbits in grass. And so... And suppose that the island, should we make it smaller? Sorry. Can support a million rabbits. That's a lot of rabbits. Let's make it. So it can still a lot of rabbits. It's, you know... But that means that like there's no grass and they all start dying and they bite each other and all of that's a fact. They're like the rabbits in money. Okay. So it can support a million rabbits. It can carry capacity. And of course of the year well let's see rabbits have typically something like litter, is it litter? Rabbits have litter? I don't know. There's something like six babies at a shot and they do this like four times a year. So the birth rate so for each rabbit well let's see we have a 100. So in the first year there's around two rabbits were born let's say let's just say 100 well let's make this number nicer so let's say 50 died 2050 rabbits were born and 50 rabbits died. Well it has to happen something. Rather it may be 5 you can make it be 5 none of them will die they live forever? Okay. You want them to never die? This would be really bad for them. Okay let's say because it gets really cold there in the winter. Okay so now let's figure out the calculation. So this is a fairly straightforward problem can everyone do this? Is there anyone here who cannot do this? If there's no one here who cannot do this okay there's at least three people who say they can't do this. What's wrong with you? Have you been going to class? So how do we do this? Well first we have to figure out what these cons can solve. I seem to be missing something. Okay I guess I need one other piece of information here which I forgot which I need to know still no I have everything okay. So we can use we can estimate k from this because over the course of a year we get 2,000 rabbits. So that tells us I still think I need one more thing. Yeah I still need one more piece of information. Well let's see what we see. So we know that p of zero is 100. So we have I mean you can write down the differential equation but there it is. The differential equation is so if we just say what is the differential equation? Well the differential equation here is p prime of t equals well k we can read off from this k seems to be 2,000 we can check that but it's 2,000 one minus p over was it 10,000? Oh 2,000 over 100 sorry. Right because the growth rate we went from 100 rabbits to 2,000 rabbits. So the growth rate so here we can assume that the growth rate is approximately equal to k I'm seeing a lot of black faces is that just because it's morning? Do you understand where this came from? Do you understand this number came from or you just nodded? You don't understand. So put that there for a minute. Do you understand where this number came from? So this is the growth carrying capacity and we need to figure out what the k is. Well we have this information here that in the first year notice that 100 is very small relative to 10,000 fairly small it's 100 and so it's going to be kind of like exponential growth at this point and so here the net change is plus 2,000 right because uh no screwed up didn't I? I had 150 guy 50 that was well it's 2,000 can I just change this number? plus 50 it's 2,100 uh no it's plus 2,000 sorry so here in the course of the first year the rate was plus 2,000 rabbits for every 100 so that means that the rate of change was a factor of 20 one rabbit became 20 rabbits they're magical and they just turned into little rabbits they're even worse than worms that way uh so that would mean that this k would be about 20 now we can do this another way yeah we're in the kb21 because um 2,000 are born but then you still have 100 well so let's just do it another way so growth rate here is a factor of 20 right 2100 is how many you have total but the growth rate is a factor of 20 I'm estimating the derivative of the function here when p is small so the derivative is I went from 100 I grew by a factor of 20 but we can do it another way okay so let's do it the other way so here there's our derivative there's our function and this is you don't have to solve it again because we already know rate is some constant we don't now we know a couple of things we know that oh and we already know alright it's 10,000 so our initial population p of 0 tells us that 10,000 over 1 plus a let's just 1 plus a is 100 when we first started looking there were 100 routes and so this tells us the value of a so 100 and 1 plus a is 10,000 and so why can't I subtract 100 from 10,000 I don't know 100 plus 100 a equals 10,000 I don't want to divide yet first I want to subtract and then I want to divide so I subtract here and this gives me 9 9 0 0 is 100 a so now I divide and a is 9 9 yeah that's the same what it just was dividing something else so a is still 99 no matter how you do it yeah that was stupid okay anyway a is 99 so we have a and then we also have the population in the first year 2,000 rabbits 2050 rabbits we had 100 205 more and we lost it so this is 2100 and that equals over 1 plus 99 e to the minus kt t is 1 and so again we do the same solving stuff and maybe I'll provide a little more intelligently this kind of a note so 10 100 over 21 is 1 plus 99 e to the minus k uh so yeah k is positive that's good so so now I want to subtract 1 from both sides so uh subtract 1 from both sides so I get uh why can't I do this subtraction 8 is 79 right if I subtract 1 from this I get no so minus 21 yeah 79 over 21 times 99 is e to the minus k and so k is the log 21 times 99 I thought well so somewhere I may I may have right did I do that correctly well ok so negative k is the log of 79 over 21 times 99 is the same so so that's our k so now we have everything and so that means p of 5 and this is really all just algebra is whatever the heck it is 10,000 1 plus 99 minus log whatever this normal number is and we plug it in 5 which I don't know what this number is because when I did this in my office I had different numbers uh so this is a stupid question now because the numbers don't work out nice but they are what they are do I make a mistake I probably did well I didn't flip it because she complained about the negative oh so this is a plus yeah that looks better because that's a negative number so that will shrink so the whole thing will go that's better yeah oh I don't care because I did it with plus here and I did it with minus here but a is some constant so if you want to add it fine if you want to subtract it fine it's just an ounce of it so you have to solve for it but you just have to be consistent I started with it being plus so I solved for it being plus and it was 99 had I done it negative over here then it would be negative 99 okay so I mean this is one kind of question you can ask another kind of question you can ask or I can ask that you can be asked is how long will it take the rabbit population to double how long will it take the rabbit population to be 800 800 how long will that sort of thing so if I ask the question how long will it take the rabbit population to be 8000 then we can solve for t such that t of t equals 8000 right so then that's the inverse problem all of these kinds of things are fair game you have several of these sorts of things on the whole one thing that you need to do with these kinds of problems is read the words and understand what you are being told and what is being asked for sometimes these situations are set up where you're not told an exact population like this but you're told a ratio percentage the percentage of this is that means that the carrying capacity is 1 or 100 if it's percentage so if it's a fraction then the carrying capacity is 1 because that's the whole thing if it's a percentage the carrying capacity is 100 because the biggest of percentage can be 100 and so on so you need to read the problem pay attention to the words this is where most of the people in this class get burnt they don't read the words and they just go oh too many words my hand hurts you know how to read I hope alright so let's rather than doing another logistic problem let me move on to another so are we okay with this these are really in some sense quite easy notice that once you have this formula calculus is now gone right this happens all the time the difficulty with these problems is not the calculus the difficulty is the stuff you should have learned in ANK the algebra the translation from words to symbols but okay so I mean we solved it once we don't need to solve it again we know the solution I am not necessarily recommending you memorize this formula because we could tweak this problem so let me point out that the goal here is not for you to know logistic equations the goal here is for you to see the relationship between differential equations separable techniques and objects that are being modeled such as population so for example on the homework there are other ones where instead of having say something like this there is a constant here or maybe there is another factor here another factor here and so on and you can solve all of these by exactly the same technique right it is a separable equation write down the equation and you solve it out comes the answer move away from I will leave that so in this situation let's instead let's push away let's take the same issue with the rabbits for now I am not going to model them as logistic equations let's just assume that the island has suddenly become a continent so there is no limit to the grass but there is holes now okay so first they were happy little rabbits and they said look our little island is now Australia we have lots of grass but then they discovered that there is dinkos that will come and eat them so this is bad so let's think about this situation so we have our rabbits who now have unlimited grass supply so their growth is exponential that means that something like Ae to kt and now we also have some wool let's use wools we want dinkos but then we have 2d let's call dinkos like W because it looks sort of in Australia so it's like an M and they are mean guys but we draw them upside down so we will use W because this is an upside down MM for me is there an E in dinkos no so this is this is the growth rate so this is there is nothing to eat there they grow exponentially lots of grass they are happy 20 babies a year just crazy times but then suddenly the wools show up now in the absence of rabbits nothing for them to eat except possibly each other but this means that they die exponentially so in the absence of rabbits there is felt absence wrong and the absence of rabbits they just die off because there is nothing for them to eat except possibly each other so if they don't eat anything they starve and as they eat each other the numbers go down so in either case they die off and the second one that I drew before I'm going to suppress time and I'm going to put the dinkos here and this is population zero and what will happen here is if I give any population of dinkos I'm going to put rabbits this way if I give dinkos any population but there are no rabbits what happens start here with a population of 1,000 and then a lot of them die and you only have 200 and then 100 and they just die off rabbits on the other hand if there are no dinkos around well what happens if you get a few rabbits then a lot of rabbits then it goes crazy what I want to figure out is what happens when there are wolves so I want to adjust these equations so we have rabbit-dinko interactions so what will happen we have r prime equals oops what am I doing I'm sorry this was r of t that's what you were asking okay which is the same as saying d r, d t is some constant r okay d w, d t is some constant though sorry so the rabbit growth rate is some constant times how many rabbits there are around this constant here is negative and the dinko growth rate is some negative constant times the number of dinkos around but now if there are rabbits for the dinkos to eat then that's good for them so this is sort of if a rabbit eats a wolf a rabbit eats a dinko there's some probability that the dinko will eat the rabbit and there's some probability it will get away this ratio this is the benefit to the rabbit population of being eaten and this is the benefit to the wolf population of eating a rabbit of being a population hard for me to say of being a dinko so we have equations like this where k, c, a and b are all positive now I'm not going to write down formula for what happens but we can think about what will happen so is it clear that this describes something not unreasonable people understand where these equations come from so this is the growth rate when there's no things eating the rabbits and the death rate when there's nothing for the dinkos to eat and then this is the advantage or disadvantage of an interaction so what does this mean we can interpret that there will be some stable population because we can write this we can factor the r out and w prime we can factor the w out should I do this with actual numbers instead of letters or are we okay with letters letters are good okay so you can see that if r and w are both zero you get an equilibrium point where there's nothing no population changes because the r e t is zero and w e t is zero nothing changes but if w is k over a then also there is no change in the rabbit population so if the number of wolves here is k over a this means and also if the number of rabbits is c over b there's no change in the dinko population right here there's another place mainly at rabbits equals c over b dinkos equals k over a where there's another solution the population does not change so we found another equilibrium solution just by solving both of these equals zero now how can we figure out what else will happen does anyone have a clue what I'm talking about you have a clue well if we make them both really big we have to think about what will happen if we make them both really small it's pretty obvious what will happen so certainly for small groups of rabbits we can think about what will happen here so say there's a lot of dinkos and a couple of rabbits well the dinkos will still continue to die off eventually they will die off until there's hardly anything and a lot of rabbits so if we have hardly any rabbits and a lot of dinkos so what is this graph of this graph is telling me this graph is telling me telling me something about the populations but without time I have to put little arrows to remember what's happening over the time how can I so that was just so we can sort of figure out that this will happen what will happen over here well let's think about how we can make this a little more like something we know we can make a direction field what will happen what will be the slopes to the various solutions what is the ratio of the change in R to the change in W we can compare what the change in the rates are by looking at this this tells me dR dt this tells me dW dt so if I look at the ratio this tells me dR dW by the chain rule it's telling me so if W I can is that apparent or not I've seen a lot of morning eyes and I don't know whether it's just because class is over and you want me to shut up or you really want to call me so let me just say it and then I'll do it on Monday what we can do is we can calculate and look like that by looking at the ratio of the derivatives the ratio of the derivatives by the chain rule is the slope of what's going on here so I can draw little arrows here that look like that and see that for something near this it will tend to spiral around so we get the time component explicitly but we can look at the ratio of the two and get something that will tell us how the population will change so I'll do this on Monday but here the population will change in an oscillatory manner