If you have a function like $$f(x) = ce^{kx}$$, where $$c$$ is a constant then its derivative is $$f^\prime (x) = k \cdot f(x)$$, where $$k$$ is also a constant.

For example, the general form of a function like $$\frac{dA}{dt} = 5A$$ is $$A(t) = ce^{5t}$$. The general form of a function like $$\frac{dP}{dt} = kP$$ is $$P(t) = ce^{kt}$$. Whereas solutions of an algebraic equation is a number, the solutions to the equations in these examples are functions. Equations which include a derivative and have a function as a solution, are called differential equations.

Let’s solve the differential equation

$f^\prime(z) = k \cdot f(z)$

from sympy import *

z, k, f = symbols("z, k, f")

f = Function("f")(z)

differential = Eq(f.diff(z), k * f)
differential
## Eq(Derivative(f(z), z), k*f(z))
dsolve(differential, f)
## Eq(f(z), C1*exp(k*z))

## Uninhibited Population Growth

The equation

$\frac{dP}{dt} = kP$

or

$P^\prime(t) = kP(t)$

is the basic model of uninhibited (unrestrained) population growth. In absence of restraining factors, a population normally reproduces at a rate proportional to its size. The function that satisfies this model (this rate of change) is

$P(t) = ce^{kt}$

where $$t$$ is time and $$k$$ is the rate expressed in decimal notation. $$c$$ represents the initial population. The constant $$k$$ is called the rate of exponential growth, or simply growth rate.

## Investing Example

Suppose that an amount $$P_0$$, in dollars, is invested in a fund with interest compounded continuously at 7% per year. That is, the baalnce $$P$$ grows at the rate given by

$\frac{dP}{dt} = 0.07 P$

1. find the function that satisfies the equation
2. suppose that $100 is invested, what is the balance after 1 year 3. in what period of time will an investment of$100 double itself
from math import e

P, t = symbols("P, t")

P = Function("P")(t)

differential = Eq(P.diff(t), 0.07 * P)
function = dsolve(differential, P)
function
## Eq(P(t), C1*exp(0.07*t))
def principal(x, c0):
return c0 * e**(0.07 * x)

principal(1, 100)
## 107.25081812542166

To find the time to double the investment, the doubling time, we need to solve the equation $$200 = 100e^{0.07t}$$

solve(100*e**(0.07*t) - 200, t)
## [9.90210257942777]

## Growth Rate & Doubling Time

Growth rate and doubling time are related by

$kT = \ln 2 \approx 0.693147$

and

$T = \frac{\ln 2}{k} \approx \frac{0.693147}{k}$

A business has been doubling its customer base every 6 months. What is the exponential growth rate of the business?

import numpy as np

def k(x):
return np.log(2) / x

k(6)
## 0.11552453009332421

That’s roughly 11.6% per month.

## The Rule of 70

This relationship between doubling time $$T$$ and interest rate $$k$$ is the basis of a rule called, the Rule of 70, which is formalized as

$T = \frac{\ln 2}{k} \approx \frac{0.693147}{k}$

## World Population

The world propulation was approximately 6.04 billion at the beginning of 2000. It has been estimated that the population is growing exponentially at the rate of 1.6% per year. Thus

$\frac{dP}{dt} = 0.016P$

where $$t$$ is the time in years after 2000.

1. find the function that satisfies the equation
2. estimate the world population at the beginning of 2020
3. after what period of time will the population be double that in 2000
differential = Eq(P.diff(t), 0.016 * P)
dsolve(differential, P)
## Eq(P(t), C1*exp(0.016*t))
def population(x, c0):
return c0 * e**(0.016 * x)

population(20, 6.04)
## 8.31785169658918
def doubling(r):
return np.log(2) / r

doubling(0.016)
## 43.32169878499658

## Models of Limited Growth

The model of unrestricted growth is useful and has many applications. However, in reality, there are often factors that prevent a population from exceeding some limiting value $$L$$. One model of such limited growth is the logistic function.

$P(t) = \frac{L}{1 + be^{-kt}}$

where $$k > 0$$, $$e$$ is the natural logarithm, $$k$$ is the growth rate, $$t$$ is time, and $$b$$ is the starting value.

Satellite radio companies provide subscribers with clear signals of hundreds of ratio stations. The provider XM started up in 2001, followed by Sirius in 2002. Both companies did well, experiencing what seemed like exponential growth, but the slowing of this growth led Sirius to buy out XM in 2008, forming Sirius XM. The combined number of subscribers $$N$$, in millions, after time $$t$$, in years since 2000, with $$t = 1$$ corresponding to 2001, can be modeled by the logistic function

$N(t) = \frac{19.362}{1 + 295.393e^{-1.11t}}$

1. find the combined number of subscribers after 1 year, 3 years, 5, years, and 8 years
2. find the rate at which the number of subscribers was growing after 8 years
3. graph the equation
4. explain why an uninhibited growth model is inappropriate but a logistic equation is appropriate for this case
import matplotlib.pyplot as plt

def N(t):
return 19.362 / (1 + 295.393 * e**(-1.11 * t))

N(1)
## 0.19686950804091893
N(3)
## 1.673027332297896
N(5)
## 9.012591692987794
N(8)
## 18.597597591832223
Nt = 19.362 / (1 + 295.393 * e**(-1.11 * t))
dNdt = Nt.diff(t)
dNdt
## 6348.53318526*2.71828182845905**(-1.11*t)/(1 + 295.393*2.71828182845905**(-1.11*t))**2
dNdt.subs({t:8})
## 0.814988829032035
x = np.linspace(0, 20)

plt.plot(x, N(x))
plt.title("number of subscribers (millions) over time ($t_0$ = 2000)") The main idea behind why restricted growth models apply to cases like this is that as more subscribers join a service, you have less people in the population who are not subscribed to draw from. This is a pretty common case in business. No growth is infinite, yet lots of businesses will claim that they can keep growing indefinetly. That’s simply impossible. Any company that aggressively chases growth at the expense of economical sustainability is going to suffer, and so will its employees and customers.

## Another Limited Growth Model

There are a handful of growth models. Certain kinds of growth can be estimated by

$P(t) = L(1 - e^{-kt})$

This model increases more rapidly at the beginning and then tapers off.