> For the complete documentation index, see [llms.txt](https://daniel-soto.gitbook.io/qm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daniel-soto.gitbook.io/qm/exponential.md).

# Exponential Functions

## Exponential

note: migrated 18 Mar 2021

The word exponential makes this concept sound unnecessarily difficult.

A simple definition is that exponential models arise when the change in a quantity is proportional to the amount of the quantity. That is, the slope of an exponential function at any point is equal to the value of the function at any point multiplied by a number.

If a function is exponential, the relative difference between any two evenly spaced values is the same, anywhere on the graph. This is similar to linear functions where the absolute difference between any two values separated by the same x-axis distance is the same.

If you plot something on a log axis, you will notice that the distance between any two numbers with the same ratio is the equal. This preservation of the size of a ratio is the key feature of logarithms and exponentials.

## Concepts

* Euler's Number
* Exponential notation
* Place value
* Slope proportional to the value
* Doubling time

## Euler's number

The following things are true about Euler's number ($$e$$)

$$e = 2.71828...$$

$$e = (1 + \frac{1}{x})^x$$ as $$x$$ goes to infinity.

$$e = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + ...$$

### Exponential notation

You've probably seen notation like $$x^2$$ or $$x^3$$ several times before. In exponential notation, our symbol for a variable, $$x$$ is in the exponent.

For example $$2^x$$ or $$3^x$$.

Recall that $$1 = 2^0$$, $$2 = 2^1$$, $$2 \cdot 2 = 2^2 = 4$$, etc. So, $$2^x$$ means to multiply 2 by itself x times.

### Place Value

Recall from place value, that if we were using a base 2 system, each of these multiplications would be the same as shifting numbers one place to the left.

### Slope proportional to function value

The exponential is defined as a function whose slope is proportional to its value.

The function that is exactly equal to its slope is $$y = e^x$$.

### Doubling Time

A property of an exponential function, is that in a given interval of time, the value increases by a fixed ratio.

So, if the function doubles over a time, let's call it $$t$$, if we wait for a time $$t$$ at any time, the value of the function doubles.

## Examples

### Folding paper

* Zero folds $$2^0$$ makes one sheet thick
* One fold $$2^1$$ is two sheets thick
* How many times can you fold?
* How can we express the number of pages by the number of folds?
* Can we write out the pattern?

$$\textrm{pages} = 2^{\textrm{folds}}$$

### Rabbits

* start with two
* wait one year
* now we have double (4)
* wait another year
* now we have eight (8)
* how many in 5 years?

The number of rabbits at the start of the generation (starting with generation zero) is $$\textrm{rabbits} = 2^{\textrm{generations+1}}$$

### Money grows the same way

* Start with $1000
* Grow by 10%
* Now $1100
* Grow by 10%
* Now $1210

$$1000 \cdot (1+0.10)^{years}$$

### Exponential growth

* The rate of change is proportional to the total number
* The doubling time is constant over the entire range
* What things exhibit these characteristics?

### Exponential growth

* Populations
* Disease spread
* Credit card balances
* Viruses

## Definitions

### Doubling

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQdxibLamgU1Nb00%2Fdoubling.png?generation=1565805363616106\&alt=media)

### Doubling Time

Exponential growth means that if you measure how long it takes a quantity to double, the time to double from any current amount will be the same.

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQdzrSQdWhlLAGRh%2Fdoubling-time.png?generation=1565805373714260\&alt=media)

### Constant Growth

This is in contrast to linear growth where if you wait for the amount to increase by a fixed amount, the amount will always increase by that fixed amount in that amount of time.

For linear growth, the slope of the function is a number that does not change along the function.

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQe0rMEdyopUVxJT%2Flinear-growth.png?generation=1565805375022878\&alt=media)

### Which gets bigger faster?

$$x^2$$ or $$2^x$$

Draw these out in your notebook to see

### Exponential growth

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQe2j-H4CiNR6lTZ%2Fexponential.png?generation=1565805364194292\&alt=media)

### Exponential Decay

What if instead of doubling every year, something fell by half each year?

### Halving

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQe44WCf3zPHYqZu%2Fhalving.png?generation=1565805363366891\&alt=media)

### Exponential Decay

![](https://3104074691-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmGGOR79oy-_JywJoK5%2F-LmGGPVIa9dVx26dpNEz%2F-LmGGQe6pSmbF1QnKaQc%2Fexponential-decay.png?generation=1565805364653553\&alt=media)

### Exponential decay

* A quantity loses the same fraction of itself for a given time interval
* Nuclear waste
* Toxins in a body
* The water in a stream (baseflow)

## Logarithm

### Inverse functions

* Recall that the square root and the cube root were the inverse of the squared function and the cube function

### Logarithm

* The inverse of exponentiation is the logarithm
* Properties of $e$
* You have to specify your base on a computer (2, e, 10)

### Logarithm

* Inverse of exponential function
* If $$y = 10^x$$ then $$\log y = x$$
* If $$y = e^x$$ then $$\ln y = x$$
* For any other number (called the base, $$b$$):
  * If $$y = b^x$$ then $$\log\_b y = x$$

### Logarithm

The logarithm in base 10 basically asks, if you are in base 10, how many digits?

### Logarithmic scales

* Musical pitch
* Richter scale
* Vision
* Sound

In each of these, we perceive or use the logarithm.

### This rule is a consequence of logarithms

$$10^a \cdot 10^b = 10^{a+b}$$

Take log of both sides

$$a \cdot \log 10 + b \cdot \log 10 = (a+b) \cdot \log 10$$

## Solving Problems

### Analytical Approach

Use the logarithm as an inverse function.

$$y = \beta e^x$$ $$\log {y/\beta} = \log{e^x}$$ $$\log {y/\beta} = x$$

### Brute force approach

If you know y and $$\beta$$ you can try different values for x until you come close to the value for y.

$$y = \beta e^x$$

## Miscellaneous Stuff

## Unexpected connections

The number e and the natural logarithm are connected in various places to other mathematical numbers in fascinating ways.

The natural logarithm is the area under the 1/x curve

### Definitions of e

$$e = \lim\_{n \to \infty} (1 + 1/n)^n$$

$$e = 1 + 1 + \frac{1}{2 \cdot 1} + \frac{1}{3 \cdot 2 \cdot 1} + \frac{1}{4 \cdot 3 \cdot 2 \cdot 1} + \cdots$$

### Euler

$$e^{i \theta} = \cos \theta + i \sin \theta$$

$$e^{i \pi} + 1 = 0$$

where $$i = \sqrt{-1}$$

### Calculation examples

* Most scripting languages and calculators use the `^` symbol for

  &#x20; exponents.  `2^2 = 4`.
* Python uses `**` for exponentiation.  `2**2 = 4`
* Some computer programs use `log` to mean the natural logarithm, not

  &#x20; the base 10 logarithm.  Check carefully and see what your tool uses.
* If you type `log(10)` and get 2.3 you are not using base 10.

## Advanced Topics

I call these advanced topics mainly because the notation we use to express them is intimidating. The ideas behind them are simple and are unnecessarily obscured by our notation.

### Differential equation

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

* P is the population
* r is the rate of growth

Any equation where the change is proportional to the population is exponential growth

This relates to our earlier definitions where the percent change is constant for a given time interval.

### Differential equation

$$\frac{dP}{dt} = \textrm{constant}$$

Linear growth has the changes is constant

### Logistic function

Here the rate of change decreases as the population gets very large

This gives an s-shaped function.

You can see an example of this curve in the gangham style video statistics on youtube.

### Time constant

This number expresses the time it takes for an exponential function to increase by a certain fraction.

$$e^{t/\tau}$$
