## Solving the Logistic Differential Equation

### Learning Outcomes

• Draw a direction field for a logistic equation and interpret the solution curves
• Solve a logistic equation and interpret the results

The logistic differential equation is an autonomous differential equation, so we can use separation of variables to find the general solution.

Step 1: Setting the right-hand side equal to zero leads to $P=0$ and $P=K$ as constant solutions. The first solution indicates that when there are no organisms present, the population will never grow. The second solution indicates that when the population starts at the carrying capacity, it will never change.

Step 2: Rewrite the differential equation in the form

$\frac{dP}{dt}=\frac{rP\left(K-P\right)}{K}$.

Then multiply both sides by $dt$ and divide both sides by $P\left(K-P\right)$. This leads to

$\frac{dP}{P\left(K-P\right)}=\frac{r}{K}dt$.

Multiply both sides of the equation by $K$ and integrate:

$\displaystyle\int \frac{K}{P\left(K-P\right)}dP=\displaystyle\int rdt$.

The left-hand side of this equation can be integrated using partial fraction decomposition. We leave it to you to verify that

$\frac{K}{P\left(K-P\right)}=\frac{1}{P}+\frac{1}{K-P}$.

Then the equation becomes

$\begin{array}{ccc}\hfill {\displaystyle\int \frac{1}{P}+\frac{1}{K-P}dP}& =\hfill & {\displaystyle\int rdt}\hfill \\ \hfill \text{ln}|P|-\text{ln}|K-P|& =\hfill & rt+C\hfill \\ \hfill \text{ln}|\frac{P}{K-P}|& =\hfill & rt+C.\hfill \end{array}$

Now exponentiate both sides of the equation to eliminate the natural logarithm:

$\begin{array}{ccc}\hfill {e}^{\text{ln}|\frac{P}{K-P}|}& =\hfill & {e}^{rt+C}\hfill \\ \hfill |\frac{P}{K-P}|& =\hfill & {e}^{C}{e}^{rt}.\hfill \end{array}$

We define ${C}_{1}={e}^{c}$ so that the equation becomes

$\frac{P}{K-P}={C}_{1}{e}^{rt}$.

To solve this equation for $P\left(t\right)$, first multiply both sides by $K-P$ and collect the terms containing $P$ on the left-hand side of the equation:

$\begin{array}{ccc}\hfill P& =\hfill & {C}_{1}{e}^{rt}\left(K-P\right)\hfill \\ \hfill P& =\hfill & {C}_{1}K{e}^{rt}-{C}_{1}P{e}^{rt}\hfill \\ \hfill P+{C}_{1}P{e}^{rt}& =\hfill & {C}_{1}K{e}^{rt}.\hfill \end{array}$

Next, factor $P$ from the left-hand side and divide both sides by the other factor:

$\begin{array}{ccc}\hfill P\left(1+{C}_{1}{e}^{rt}\right)& =\hfill & {C}_{1}K{e}^{rt}\hfill \\ \hfill P\left(t\right)& =\hfill & \frac{{C}_{1}K{e}^{rt}}{1+{C}_{1}{e}^{rt}}.\hfill \end{array}$

The last step is to determine the value of ${C}_{1}$. The easiest way to do this is to substitute $t=0$ and ${P}_{0}$ in place of $P$ in the equation $\frac{P}{K-P}={C}_{1}{e}^{rt}$ and solve for ${C}_{1}\text{:}$

$\begin{array}{ccc}\hfill \frac{P}{K-P}& =\hfill & {C}_{1}{e}^{rt}\hfill \\ \hfill \frac{{P}_{0}}{K-{P}_{0}}& =\hfill & {C}_{1}{e}^{r\left(0\right)}\hfill \\ \hfill {C}_{1}& =\hfill & \frac{{P}_{0}}{K-{P}_{0}}.\hfill \end{array}$

Finally, substitute the expression for ${C}_{1}$ into the equation before the last:

$P\left(t\right)=\frac{{C}_{1}K{e}^{rt}}{1+{C}_{1}{e}^{rt}}=\frac{\frac{{P}_{0}}{K-{P}_{0}}K{e}^{rt}}{1+\frac{{P}_{0}}{K-{P}_{0}}{e}^{rt}}$

Now multiply the numerator and denominator of the right-hand side by $\left(K-{P}_{0}\right)$ and simplify:

$\begin{array}{cc}\hfill P\left(t\right)& =\frac{\frac{{P}_{0}}{K-{P}_{0}}K{e}^{rt}}{1+\frac{{P}_{0}}{K-{P}_{0}}{e}^{rt}}\hfill \\ & =\frac{\frac{{P}_{0}}{K-{P}_{0}}K{e}^{rt}}{1+\frac{{P}_{0}}{K-{P}_{0}}{e}^{rt}}\cdot \frac{K-{P}_{0}}{K-{P}_{0}}\hfill \\ & =\frac{{P}_{0}K{e}^{rt}}{\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}}.\hfill \end{array}$

We state this result as a theorem.

### Solution of the Logistic Differential Equation

Consider the logistic differential equation subject to an initial population of ${P}_{0}$ with carrying capacity $K$ and growth rate $r$. The solution to the corresponding initial-value problem is given by

$P\left(t\right)=\dfrac{{P}_{0}K{e}^{rt}}{\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}}$.

The solution to the logistic differential equation has a point of inflection. To find this point, set the second derivative equal to zero:

$\begin{array}{ccc}\hfill P\left(t\right)& =\hfill & \frac{{P}_{0}K{e}^{rt}}{\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}}\hfill \\ \hfill {P}^{\prime }\left(t\right)& =\hfill & \frac{r{P}_{0}K\left(K-{P}_{0}\right){e}^{rt}}{{\left(\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}\right)}^{2}}\hfill \\ \hfill P^{\prime\prime}\left(t\right)& =\hfill & \frac{{r}^{2}{P}_{0}K{\left(K-{P}_{0}\right)}^{2}{e}^{rt}-{r}^{2}{P}_{0}{}^{2}K\left(K-{P}_{0}\right){e}^{2rt}}{{\left(\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}\right)}^{3}}\hfill \\ & =\hfill & \frac{{r}^{2}{P}_{0}K\left(K-{P}_{0}\right){e}^{rt}\left(\left(K-{P}_{0}\right)-{P}_{0}{e}^{rt}\right)}{{\left(\left(K-{P}_{0}\right)+{P}_{0}{e}^{rt}\right)}^{3}}.\hfill \end{array}$

Setting the numerator equal to zero,

${r}^{2}{P}_{0}K\left(K-{P}_{0}\right){e}^{rt}\left(\left(K-{P}_{0}\right)-{P}_{0}{e}^{rt}\right)=0$.

As long as ${P}_{0}\ne K$, the entire quantity before and including ${e}^{rt}$ is nonzero, so we can divide it out:

$\left(K-{P}_{0}\right)-{P}_{0}{e}^{rt}=0$.

Solving for $t$,

$\begin{array}{ccc}\hfill {P}_{0}{e}^{rt}& =\hfill & K-{P}_{0}\hfill \\ \hfill {e}^{rt}& =\hfill & \frac{K-{P}_{0}}{{P}_{0}}\hfill \\ \hfill \text{ln}{e}^{rt}& =\hfill & \text{ln}\frac{K-{P}_{0}}{{P}_{0}}\hfill \\ \hfill rt& =\hfill & \text{ln}\frac{K-{P}_{0}}{{P}_{0}}\hfill \\ \hfill t& =\hfill & \frac{1}{r}\text{ln}\frac{K-{P}_{0}}{{P}_{0}}.\hfill \end{array}$

Notice that if ${P}_{0}>K$, then this quantity is undefined, and the graph does not have a point of inflection. In the logistic graph, the point of inflection can be seen as the point where the graph changes from concave up to concave down. This is where the “leveling off” starts to occur, because the net growth rate becomes slower as the population starts to approach the carrying capacity.

### try it

A population of rabbits in a meadow is observed to be $200$ rabbits at time $t=0$. After a month, the rabbit population is observed to have increased by $4\text{%}$. Using an initial population of $200$ and a growth rate of $0.04$, with a carrying capacity of $750$ rabbits,

1. Write the logistic differential equation and initial condition for this model.
2. Draw a slope field for this logistic differential equation, and sketch the solution corresponding to an initial population of $200$ rabbits.
3. Solve the initial-value problem for $P\left(t\right)$.
4. Use the solution to predict the population after $1$ year.

### Activity: Logistic Equation with a Threshold Population

An improvement to the logistic model includes a threshold population. The threshold population is defined to be the minimum population that is necessary for the species to survive. We use the variable $T$ to represent the threshold population. A differential equation that incorporates both the threshold population $T$ and carrying capacity $K$ is

$\frac{dP}{dt}=\text{-}rP\left(1-\frac{P}{K}\right)\left(1-\frac{P}{T}\right)$

where $r$ represents the growth rate, as before.

1. The threshold population is useful to biologists and can be utilized to determine whether a given species should be placed on the endangered list. A group of Australian researchers say they have determined the threshold population for any species to survive: $5000$ adults. (Catherine Clabby, “A Magic Number,” American Scientist 98(1): 24, doi:10.1511/2010.82.24. accessed April 9, 2015, http://www.americanscientist.org/issues/pub/a-magic-number). Therefore we use $T=5000$ as the threshold population in this project. Suppose that the environmental carrying capacity in Montana for elk is $25,000$. Set up the above equation using the carrying capacity of $25,000$ and threshold population of $5000$. Assume an annual net growth rate of $18\text{%}$.
2. Draw the direction field for the differential equation from step $1$, along with several solutions for different initial populations. What are the constant solutions of the differential equation? What do these solutions correspond to in the original population model (i.e., in a biological context)?
3. What is the limiting population for each initial population you chose in step $2?$ (Hint: use the slope field to see what happens for various initial populations, i.e., look for the horizontal asymptotes of your solutions.)
4. This equation can be solved using the method of separation of variables. However, it is very difficult to get the solution as an explicit function of $t$. Using an initial population of $18,000$ elk, solve the initial-value problem and express the solution as an implicit function of $t$, or solve the general initial-value problem, finding a solution in terms of $r,K,T,\text{and}{P}_{0}$.