 Hello, and welcome to the screencast about solving a logistic differential equation. Okay, so in the last video where we set up this logistic equation, we ended up with a value of k equals 0.1 and an n of 20. So that leads us then to the differential equation dp dt equals 0.1p times 20 minus p. Okay, so first thing we want to do then is basically it's kind of like a separable equation except it's going to be a lot uglier unfortunately. So I'm going to leave my constant on this side and I'm going to go ahead and move my p times 20 minus p over to the other side. So that means I'm going to divide it. So 1 over p times 20 minus p dp dt is going to equal 0.1. And just as we've done before, so solving this differential equation means that we're going to want p as a function of t. Okay, so I'm going to go ahead and integrate both sides then with respect to t. Stick that guy in there and that guy in there. So these are going to wipe each other out. So I'm going to end up with the integral of 1 over p times 20 minus p dp is going to equal the integral of 0.1 dt. All right, now my integral on the right, that's pretty nice, right? It's a constant. My integral on the left though is going to make up for it. So this brings us back to the integration technique of partial fractions. Okay, so over here on the side, I'm going to do a little bit of work. So I'm going to rewrite this as a over p plus b over 20 minus p. And that's going to equal 1 over p times 20 minus p. Okay, the one good news is this denominator is already factored. Okay, so at least we didn't have to do that part. So now we got to go ahead and find a common denominator. So that's going to end up giving us a times 20 minus p plus bp is going to equal 1. Okay, so now if we let p equal, well, let's see. You want to wipe out the a first or the b first doesn't really matter. We'll just go with the a. So if we were to let p be 20, this first piece is going to wipe out. So that's going to give us b times 20 equals 1. So that means b equals 1 over 20. Okay, do the same thing here. So now I want to wipe out my b. So that means my p is going to be 0. So that's going to give me a times 20 equals 1. So my a is also going to be 1 over 20. Okay, which is going to make it nice for doing some factoring later. Okay, so let's go back to our integral then. So that means my integral on my left hand side is now going to be, so if you guys don't mind. So remember, we're rewriting this product as a sum. Okay, and you notice we had 1 over 20 in both of them. So I'm just going to go ahead and factor that outside my integral, just to make things a little bit nicer for myself. And that's going to end up being 1 over p and then plus 1 over 20 minus p. And all of that we're integrating with respect to p. And then still on my right hand side, I have the integral of 0.1 dt. Okay, so what that allowed us to do then was we now can do these integrals, right? 1 over p, that integrates with the natural log. And this one again is another natural log. If you want to do a u sub on this one, maybe because you don't see that negative, you can. But hopefully you've done enough practice with these now that this stuff is becoming more and more familiar to you. Okay, so I've got my 1 over 20, that's going to be out here. Now, the integral of 1 over p, as I already said, is the natural log of the absolute value of p. And then that's going to be minus because of this negative here in front. And again, a u sub idea. We're going to have the natural log of 20 minus p, and that's an absolute value there, sorry. Okay, and then that's going to equal 0.1 t and of course plus c. Okay, now if we were given an initial condition, now might be a good time to find it, later might be a good time to find it. These are all going to be really ugly just for the record. Okay, but we don't have an initial condition with this problem, so we're just going to keep on rolling. Okay, so now comes some fun algebra. So hopefully you guys remember some properties of logs here because I'm going to start throwing some of those at you. So we've got 1 over 20, okay, that's still factored out. Now, when we subtract two logs, if we want to smash those together, that means we're going to divide their insides. So that's going to become the natural log of p over 20 minus p equals 0.1 t plus c. Okay, so I'm trying to solve for p here, so well, let's go ahead and multiply both sides by 20. Get rid of that, I guess I could have done that earlier, but whatever, it's fine. So we multiply 20 by 0.1 and I'm going to get a 2t. Now remember c, that can just absorb it, so we'll just keep calling it c. If you really want to call this one c1 we can, it doesn't really matter, but then this constant's going to be, it's still a constant, but it's going to be a different constant. Okay, so now we need to undo our natural log function, so that's going to be with our e. So we're going to have the absolute value of p over 20 minus p is going to equal e to the 2t plus c. Okay, which again we can use properties of exponents and break this guy up. So we've got 2t, e to the 2t times e to the c, but e to the c is yet another constant, so I guess we can call this one back here c2, so then we'll call this one c, again, whatever, they're just constants. And because this is a constant, again, we can now ditch those absolute values because we know that's also going to absorb the plus or minus if we needed to. Okay, so then we've got p times 20 minus p equals c, e to the 2t. All right, finally getting somewhere, or are we? So remember we're solving for p, oh man, I see a p in the numerator and the denominator. Okay, so let's go ahead and multiply both sides by this denominator. I'm going to weasel over here, if I start to run out of room here. So we end up with p equals 20 minus p times c, e to the 2t. Okay, well I got the p by itself, but oh no I didn't because I got a p in here too. Okay, so let's go ahead and distribute that c, e to the 2t through, so distribute that out. So I'm going to end up with p equals 20c, which I guess is just yet another c, e to the 2t minus pc, e to the 2t. Okay, lovely. I'm solving for p, so I better go ahead and swing this piece over and get all the p's on one side. So p plus pc, e to the 2t is going to equal 20ce to the 2t. I'm just going to leave it like that. But now here I can factor out my p, I'm getting closer. So I end up with 1 plus ce to the 2t once I factor that out, 20ce to the 2t. Okay, so then now I can divide both sides by what's left here. So p is going to equal 20ce to the 2t all over 1 plus ce to the 2t. So that is going to be my solution to this logistic differential equation. Now there are many ways that you can simplify this, like if you wanted to divide numerator and denominator maybe for some reason by ce to the 2t. I mean there's lots of algebra you can do with this, but for now this is plenty good enough. Alright, thank you for watching.