Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Is ln(N-K) equal to ln(1-N/K);different approach different result,why?

  1. Jul 14, 2013 #1
    Hi all,

    I am new to the forum :) and was hoping that you guys could help me out with the problem i am facing when solving the logistic population model: taking different steps during the integration process seems to produce different results. I am very sorry for the long post :(

    Here is the original DE model:
    N is population number (endogenous variable), r is the reproduction rate (constant), K is the carrying capacity (contant). The (1-[itex]\frac{N}{K}[/itex]) part ensures that the population growth reduces as the population number approaches the carrying capacity limit.
    To solve this DE, we integrate by separating the variables into:

    [itex]\int[/itex] [itex]\frac{dN}{N(1-N/K)}[/itex]= [itex]\int[/itex] r dt

    To solve the left side of the equation, we do a partial fraction technique which transforms the equation into:
    [itex]\int[/itex] [itex]\frac{dN}{N}[/itex] + [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex] = [itex]\int[/itex] r dt

    My problem is with the second integral equation [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex]. It seems that there are two ways to proceed with this equation.
    1. The first is to multiply the constant K to the variables within the parentheses: K(1-N/K) which produce (K-N). Thus, we have the following integration equation:
    [itex]\int[/itex] [itex]\frac{dN}{K-N}[/itex]
    To solve this we use substitution: let u=K-N, so du=-dN, hence dN=-du. Substituting this to the second integration equation produces the following equation:
    [itex]\int[/itex] [itex]\frac{-du}{u}[/itex] = - ln u = - ln (K-N)
    2. The second approach is to directly substitute u=1-N/K, du=-dN/K, dN=-K du. Substituting this produces:
    [itex]\int[/itex] [itex]\frac{-du}{u}[/itex] = - ln u = - ln (1-N/K)

    So, the first approach produces ln (K-N), while the second approach produces ln (1-N/K). Hm, I cant help to worry, that these two equation are not equal, are they?:confused:

    Further combining this with the rest of the equation further produce different solutions.
    1. With the first approach:
    [itex]\int[/itex] [itex]\frac{dN}{N}[/itex] + [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex] = [itex]\int[/itex] r dt
    ln N - ln (K-N) = rt + C
    ln [itex]\frac{N}{K-N}[/itex] = rt + C
    [itex]\frac{N}{K-N}[/itex] = e[itex]^{rt+C}[/itex]
    N(1+ e[itex]^{rt+C}[/itex])=Ke[itex]^{rt+C}[/itex]
    or, dividing by Ce[itex]^{rt}[/itex] some would also write that:

    2. With the second approach:
    [itex]\int[/itex] [itex]\frac{dN}{N}[/itex] + [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex] = [itex]\int[/itex] r dt
    ln N - ln (1-N/K) = rt + C
    ln ([itex]\frac{N}{1-N/K}[/itex]) = rt + C
    [itex]\frac{N}{1-N/K}[/itex] = e[itex]^{rt+C}[/itex]
    N = (1-N/K) e[itex]^{rt+C}[/itex]
    N(1+[itex]e^{rt+C}\frac{N}{K}[/itex])= e[itex]^{rt+C}[/itex]
    N=[itex]\frac{Ce^{rt}} {1+\frac{NCe^{rt}}{K}}[/itex]
    multiplying by Ke[itex]^{-rt}[/itex] produces
    N=[itex]\frac {KC} {Ke^{-rt}+C}[/itex]

    In conclusion, taking different approach when solving the initial integral equation [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex] produces different result, which lead to different final equation.
    Directly multiplying K into (1-N/K) produces -ln (K-N) as a result of its integration, thus lead to the final solution of: N=[itex]\frac{K}{1+Ce^{-rt}}[/itex].
    Directly substituting u=1-N/K, produces -ln (1-N/K) as a result of its integration, thus lead to the final solution of: N=[itex]\frac {KC} {Ke^{-rt}+C}[/itex].
    I have checked the literatures, and it seems that different papers use different approaches and lead to different results. The wikipedia article on logistic model for example uses the second equation as the solution of the model, while others uses the first equation (i.e.: http://www.math.northwestern.edu/~mlerma/courses/math214-2-03f/notes/c2-logist.pdf).

    I have checked the wolfram alpha math apps to integrate the [itex]\int[/itex] [itex]\frac{dN}{K(1-N/K)}[/itex]. It generates ln (K-N) as the solution, however also notes that this solution can also be written in the form of (1-N/K), as the two equation is equal in some restricted N and K. This confuses me even more. Does this mean that ln (K-N) equal ln (1-N/K)? The differential of both of them is offcourse equal, which is [itex]\frac{1}{K-N}[/itex]. But both equation produce different result, dont they?

    In sum, my question is:
    a. Why do different approaches of integration (directly multiplying vs directly substituting) produce different result? Is it normal that integration such simple equation produces different solution? How do we know which one is correct? ln(N-K) or ln(1-N/K)?
    b. Or, to put it in another way, could it be possible that ln(N-K) equals to ln (1-N/K)? If they are, then the puzzled can be solved, but i dont see how they can be equal. Or more generally, is it possible that N=[itex]\frac{K}{1+Ce^{-rt}}[/itex] equal to N=[itex]\frac {KC} {Ke^{-rt}+C}[/itex].

    Please help,,as i am starting to have nightmares and all sort,,haunted by this paradox :surprised
    Again, I am very sorry for the long post :(
  2. jcsd
  3. Jul 14, 2013 #2
    What forgot is that indefinite integration comes with an undetermined constant. You should not forget to write it. So in your first approach, you obtain

    [tex]\int \frac{1}{K(1 - N/K)} dN = -\textrm{ln}(K-N) + C_1[/tex]

    In your second approach, you get

    [tex]\int \frac{1}{K(1 - N/K)} dN = -\textrm{ln}(1 - N/K) + C_2[/tex]

    I write ##C_1## and ##C_2## because the constants don't need to equal. What the above means is that the primitive function you find is not unique, but only unique up to a constant. So if you find two primitives, then nobody says that they're equal. It's only claimed that they're equal up to a constant. Indeed:

    [tex]-\textrm{ln}(K- N) = -\textrm{ln}(K(1-N/K)) = -\textrm{ln}(K) - \textrm{ln}(1-K/N)[/tex]

    But ##-\textrm{ln}(K)## is a constant! So the two solutions are indeed equal up to a constant.

    The same thing happens when you use these solutions to solve the ODE. You get a solution depending on a constant. But the two constants aren't equal. So you shouldn't be using ##C## for both.
  4. Jul 14, 2013 #3
    Oh gosh, you have released me from this burden haunting me the whole day :& hahaha. I did note that adding ln(K) would solve the problem but fail to notice that ln(K) can be considered as a constant for the integration result. Thank you so much :D
  5. Jul 14, 2013 #4
    Also, if you look at things purely mathematically, then you should have an absolute value:

    [tex]\int \frac{1}{K-N}dN = - \textrm{ln}|K-N| + C[/tex]

    But I guess it doesn't matter here since ##K-N## is always positive?
  6. Jul 14, 2013 #5


    User Avatar
    Science Advisor

    The situation with the different "constants of integration" answer the question in your title:
    "Is ln(N-K) equal to ln(1-N/K)"
    No, it is not. But it is true the ln(N- K)= ln((-1/K)(1- N/K))= ln(-1/K)+ ln(1- N/K) so that ln(N-K) and ln(1- N/K) differ by the constant ln(-1/K).

    Of course, for ln(-1/K) to exist, we must have K< 0 which makes sense because that is the only way both N-K and 1- N/K will be positive.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook