If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Logistic equations (Part 1)

Finding the general solution of the general logistic equation dN/dt=rN(1-N/K). The solution is kind of hairy, but it's worth bearing with us!

Want to join the conversation?

  • piceratops seedling style avatar for user Yossef
    Why did't Sal separate dN/dt as any other separable differential equation, would't that be easier ?
    (56 votes)
    Default Khan Academy avatar avatar for user
  • old spice man green style avatar for user Maciej Sosnowski
    I've simplified the fraction as Evan has done ((1/k)/(1-N/k) to 1/(k-N)) what gives me -ln(k-N). But ln(k-N) =/= ln(1-N/k) (is it ?). Could someone explain it ?
    (31 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Evan Moore
    Couldn't you simplify the fraction (1/k)/(1-N/k) to 1/(k-N)? Wouldn't that be simpler to integrate?
    (17 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam blue style avatar for user Tero Keinänen
      It's a matter of preference, but (1/k)/(1-N/k) is almost f'(N)/f(N), which is a commonly known integral (ln |f| + C). All you need to do is multiply by -1 and you can just use the f'/f integral directly. You can indeed just simplify to 1/(k-N), which produces the same result, but someone who integrates a lot probably remembers the f'/f integral by heart and spots it easily.
      (11 votes)
  • duskpin sapling style avatar for user aayushree1004
    Was it necessary to go through all the steps at (on the right side with all the "respect to N" and "respect to t" stuff)? Couldn't Sal have simply moved the dt to the right hand side of the equation in the very beginning to make it "1 / (N * (1 - N/K) ) dN = r dt"? I mean we still got to the same solution but maybe people could have understood it better?
    (19 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user edan.landow
    I don't understand why the dN/dt terms just disappear when you integrated.
    (9 votes)
    Default Khan Academy avatar avatar for user
    • ohnoes default style avatar for user Smith
      Sal first recognized that population is a function of t, so you could write it as N(t). Then he said that it wold appear that (1/N)*(dN/dt) comes from ln|N|. To check this, he used implicit differentiation and the chain rule. The derivative of the outside function (the natural log function) is one over its argument, so he go 1/N. Then he had to multiply this by the derivative of the inside function (which is N(t) ) with respect to time, which is dN/dt. Using the chain rule you get (d/dt) ln|N| = (1/N)*(dN/dt). Sal used similar logic to find what the second term came from. So Sal found two functions such that, when you took their derivatives with respect to t, you found the terms that were on the left side of the differential equation. Since the left side of the differential equation came from taking the derivative of these two functions with respect to time, by taking the anti-derivative (the inverse of the derivative) with respect to time, Sal worked back to the "original" two functions.
      (7 votes)
  • blobby green style avatar for user Golol
    why is dln(N)/dt equal to dln(N)/dN * dN/dt?
    when I enter it in wolframalpha i just get zero, what makes sense to me since the t^0 (that is basically next to the ln(N) turns into t^-1*0.
    EDIT: I see you just multiplied the left side with dN/dN and crossed the parts of the fraction
    another thing that i dont get is why at he replaces 1/N*dN/dt with ln(N) while on the right side it says 1/N*dN/dt ) = ln(N)* d/dt. how can the d/dt just be left out oO?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Tom Betka
    At about , what happened to the -1/K in the numerator of the second term inside of parenthesis? Shouldn't that have become a constant when he took the anti-derivative of N with respect to t?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user dq424
    Why do you need to bother integrating the left side of the equation with respect to d/dt (@around )? Doesn't the dt multiply and separate to the right side (with just r), and then r dt integrates to rt + C?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • purple pi purple style avatar for user Connor Mattes
    Why for the integral of (1/k)/(1-n/k) at about nine minutes do you not multiply k on the top and bottom to get 1/(k-n)? The derivative is -ln(k-n), which is different than the integral he found of -ln(1-k/n). Where am I making my mistake where my answer differs from his?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Gwunderi
      Not sure, and would like to know the answer too.
      The only I see: How do you come from "your" -ln(K-N) to -ln(1 - N/K) which is the same as -ln((K-N)/K))? By multiplying the whole(!) term by 1/K, which is the same as subtracting ln(K). Suspect that so we "gained" exactly this ln(K) by calculating your way? Which would be VERY tricky, as the two fractions - the "original" one and your 1/(K-N) - are really exactly the same, and it's pure chance that I didn't calculate your way.
      (As K is not any, but a given constant, I also think you can't "summarize" this ln(K) to C)?
      (2 votes)
  • blobby green style avatar for user edmundsj
    For those having trouble, I found it much easier to first simplify 1/k / (1-N/K) into -1 / (N - K) because then the logarithm integration becomes immediately apparent. But this seems to lead me to a different answer to the equation than Sal solved for.
    (4 votes)
    Default Khan Academy avatar avatar for user

Video transcript

-Let's now attempt to find a solution for the logistic differential equation. And we already found some constant solutions, we can think through that a little bit just as a little bit of review from the last few videos. So if this is the t-axis and this is the N-axis we already saw that if N of zero, if a time equals zero, or a population is zero, there is no one to reproduce and this differential equation is consistent with that, because if N is zero, this thing is going to be zero, and so our rate of change is going to be zero with respect to time, so our population just won't change. It'll just stay at zero. Which is nice because that's what would actually happen in a real population. That gives us the constant solution that N of t is equal to zero, that's one solution of this differential equation, not that interesting. A zero population will never grow or change. The other constant solution is what if our population started at the maximum of what the environment could sustain, and in that situation this term is going to be K over K, which is one. One minus one is zero, and so in there, the population would also not change. It would just stay at K, and so the rate of change would just stay at zero. So that's another constant solution, that we start at the maximum population and then this differential equation tells us a scenario that never changes. But we said, hey look, there could be something interesting that happens if our initial condition, which we called N sub-not, that's our N of zero. Time equals zero if we started someplace in between, maybe closer, much below our eventual ceiling I guess, because if we're a lot below our eventual ceiling this thing is going to be a small fraction, this thing is going to be close to one, and so the rate of change is going to be pretty close to being proportional to N. When we're thinking that, it might look something like that, as N increases, our rate of change increases, but then as N approaches K this thing is going to approach one, this thing is going to approach zero, and so it's going to overwhelm this and our rate of change is going to approach zero. So we can imagine a scenario where we asymptote towards K. Let's see if we can solve this to find this, this N of t to find the actual analytic expression for this N of t right over here. Because this is interesting, this is what could be used to model populations that would be more consistent with a Malthusian mindset. So let's see if we can do that. To do that we just have to realize this is a separable differential equation, and we're assuming is a function of d, we're going to solve for an N of t that satisfies this. So we just have to separate it from the explicit ts, but there are no explicit ts here, so it's quite easy to do. So what I'm going to do is I'm going to take this part right over here, and I'm going to divide both sides by that. I'm going to leave the r on the right hand side, it'll make things, I think, a little bit easier as we try to solve for N of t. So let me just do that. So this is going to be equal to one over N times one minus N over K. One minus N over K times dN dT, times dN dT is equal to r. Another way we could think about it, well actually, let me just continue to tackle it this way. So we get that, and now what I want to do is take the anti-derivative of both sides with respect to t. Well, this is pretty straightforward. That's just going to be rt times some constant, but what's this going to be? This is kind of this messy thing. And maybe if we could break this out, if we can expand this into two fractions, do a little bit of partial fraction expansion, maybe we can come up with an expression that's a little bit easier to find the anti-derivative of. I'm hoping that I can find an A and a B where A over N plus B over one minus N over K is equal to this business. Is equal to one over N times one minus N over k. Let's see if we can find an A and a B. This is just partial fraction expansion, if this looks unfamiliar to you I encourage you to review that part on Khan Academy. Do a search for partial fraction expansion on Khan Academy. So how do we do it? We'll just add these two right over here. If we take the sum, right over here, this is going to be A times this, which is A minus A over K N plus B times this, plus BN, over the product of these two. So it's just going to be N times one minus N over k. One way to think about it, I just multiplied the numerator and the denominator of this one by one minus N over k, so A times one minus N over k is that, and times one minus N over k is that, and I multiplied the numerator and the denominator of this both by N, BN and N times that, and then I added the two now that I had the same denominator. So that's just adding fractions with unlike denominators. It's going to be equal to this, one over N times one minus N over K. Now we can try to think about what is A and B going to be equal to? What can they be equal to? Well I have a constant term here. I don't have any N term here. I could say that maybe I have a zero times an N, and that actually helps things a little bit, because maybe we could say that this thing, that this plus this, which are the coefficients on N, are going to sum up to zero, and that this, which is rA, is going to be equal to one. That's pretty nice. So we can say that A is equal to one, A is equal to one, and that if A is equal to one we have negative one over K, negative one over K, plus B is equal to zero. Well what's B going to be? Well B would be equal to one over K. So we can re-write this as, we can re-write it as one over N plus one over K, plus one over K over, let me just do this, over one minus N over K, and then times dN dt, dn dt is equal to r. So I just did a little partial fraction expansion, and I like giving myself a little bit of real estate, let me clear this out. You can rewind the video and review that, if you find it necessary, so let's do that. So how does this help us? Well, hey, you probably might be recognizing the anti-derivative of one over N, and you might even see this. So let's just think through this a little bit. We know the anti-derivative of one over N is a natural log, just did a new color, is a natural log of the absolute value of N. We can see the derivative of that with respect to N is equal to one over N, and if we were to find the derivative of this with respect to t, derivative with respect to t of the natural log of the absolute value of N is equal to, that's going to be the derivative of this with respect to N times the derivative of N with respect to t, times dN dt. We could do the same thing over here. Notice, I have an expression. What would be the derivative of this expression right over here? It would be negative one over K, if I'm talking the derivative with respect to N, it would be negative one over K. I have a positive one over K here, and I could even make it negative. I can turn this, I can clear this out of the way, instead of having a positive there I could have, I guess I could say a double negative. So a double negative, I haven't changed the value of if, and notice, now this is the derivative of this, which makes it very nice for u-substitution, or you might be already used to doing this thing in your head, and so we know that the derivative with respect to N. Let me write this in a new color. We know that the derivative with respect to N of the natural log of one minus N over K, once again this comes straight out of the chain rule, it's going to be the derivative of this with respect to N, which is negative one over K times the derivative of this whole thing with respect to this thing, which is times one over one minus N over K, which is exactly what we have over here. But if I were to take the derivative of this with respect to t, so the derivative with respect to t of the natural log of one minus N over K, it's going to be the derivative of this with respect to N, which is that, which is what we just found. It's going to be this. So copy and paste. It's going to be that, it's going to be that. Times the derivative of N with respect to t, just straight out of the chain rule, dN dt. Well notice, we have a dN dt, we can multiply it times each of these things. Actually, why not, let's just do that just to make it clear, cause this really isn't so much differential equations, but sometimes some of the calculus that we learned not too long ago, and even frankly some of the algebra, it's nice to not skip steps. So if I distribute this, edit, paste. Woops, I wanted to copy and paste. So, copy and paste, so I have that, and then I have, I can copy and paste, so that I'm just distributing this business right over here. So I get that, now let me clean it up a little bit. So I have that right over here, and of course we have this being equal to r. If I take the anti-derivative of this with respect to t, well I'm just going to get this minus this right over that. So let's do that. Let's take the anti-derivative with respect to t, so the left hand side I'm going to get the natural log, the anti-derivative of that with respect to t is the natural log of the absolute value of N, and then minus the anti-derivative of this with respect to t is the natural log of the absolute value of one minus N over K is equal to, oh, and let's not forget we're going to have some constant here, I want to find a pretty general solution, let's call it C one, is equal to the anti-derivative of this with respect to t is r times t, maybe plus some other constant, plus some other constant, just like that. Now I'm going to assume that my N of t meets this assumption right over here. So I'm going to assume, assume N of t is going to be less than K and greater than zero. That means that this thing, this N is always going to be positive, and if N is always between zero and K, that means that this thing is always going to be positive. So that helps me clear things up a little bit. Actually let me do it in this color. That helps me get rid of that, helps me get rid of that. I can instead throw some parentheses here, and why don't I subtract the C one from both sides. That would get rid of it here, so edit, cut, and paste, so I have the C one there. I know I'm overwriting my own work, which is not making it look as clean as possible. I'm just trying to clean it up a little bit. I have an arbitrary constant that I haven't really solved for yet minus another constant. Let me just call this some other constant, let me just call it a general C. So let me just call this C, so clear, and I'm just going to call that C. I am just going to call that C. And I could even simplify this a little bit, but actually I just realized I'm thirteen minutes into this video, which is longer than I like to do. So let's continue this in the next video. I was getting excited because I'm so close. I'm so close to solving for an N of t that satisfies our logistic differential equation. Very, very exciting.