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

1. Jul 14, 2013

### EvanOktavianus

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 :(

BACKGROUND
Here is the original DE model:
$\frac{dN}{dt}$=rN(1-$\frac{N}{K}$).
N is population number (endogenous variable), r is the reproduction rate (constant), K is the carrying capacity (contant). The (1-$\frac{N}{K}$) 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:

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

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

PROBLEM
My problem is with the second integral equation $\int$ $\frac{dN}{K(1-N/K)}$. 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:
$\int$ $\frac{dN}{K-N}$
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:
$\int$ $\frac{-du}{u}$ = - 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:
$\int$ $\frac{-du}{u}$ = - 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?

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

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

QUESTION
In conclusion, taking different approach when solving the initial integral equation $\int$ $\frac{dN}{K(1-N/K)}$ 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=$\frac{K}{1+Ce^{-rt}}$.
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=$\frac {KC} {Ke^{-rt}+C}$.
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 $\int$ $\frac{dN}{K(1-N/K)}$. 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 $\frac{1}{K-N}$. 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=$\frac{K}{1+Ce^{-rt}}$ equal to N=$\frac {KC} {Ke^{-rt}+C}$.

Again, I am very sorry for the long post :(

2. Jul 14, 2013

### micromass

Staff Emeritus
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

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

In your second approach, you get

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

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:

$$-\textrm{ln}(K- N) = -\textrm{ln}(K(1-N/K)) = -\textrm{ln}(K) - \textrm{ln}(1-K/N)$$

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.

3. Jul 14, 2013

### EvanOktavianus

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

4. Jul 14, 2013

### micromass

Staff Emeritus
Also, if you look at things purely mathematically, then you should have an absolute value:

$$\int \frac{1}{K-N}dN = - \textrm{ln}|K-N| + C$$

But I guess it doesn't matter here since $K-N$ is always positive?

5. Jul 14, 2013

### HallsofIvy

Staff Emeritus
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.