# Exponential function

In mathematics, the exponential function is the unique real function which maps zero to one and has a derivative equal to its value. The exponential of a variable ⁠$x$⁠ is denoted ⁠$\exp x$⁠ or ⁠$e^{x}$⁠, with the two notations used interchangeably. It is called exponential because its argument can be seen as an exponent to which a constant number e ≈ 2.718, the base, is raised. There are several other definitions of the exponential function, which are all equivalent although being of very different nature.
The exponential function converts sums to products: it maps the additive identity 0 to the multiplicative identity 1, and the exponential of a sum is equal to the product of separate exponentials, ⁠$\exp(x+y)=\exp x\cdot \exp y$⁠. Its inverse function, the natural logarithm, ⁠$\ln$⁠ or ⁠$\log$⁠, converts products to sums: ⁠$\ln(x\cdot y)=\ln x+\ln y$⁠.
The exponential function is occasionally called the natural exponential function, matching the name natural logarithm, for distinguishing it from some other functions that are also commonly called exponential functions. These functions include the functions of the form ⁠$f(x)=b^{x}$⁠, which is exponentiation with a fixed base ⁠$b$⁠. More generally, and especially in applications, functions of the general form ⁠$f(x)=ab^{x}$⁠ are also called exponential functions. They grow or decay exponentially in that the amount that ⁠$f(x)$⁠ changes when ⁠$x$⁠ is increased is proportional to the current value of ⁠$f(x)$⁠.
The exponential function can be generalized to accept complex numbers as arguments. This reveals relations between multiplication of complex numbers, rotations in the complex plane, and trigonometry. Euler's formula ⁠$\exp i\theta =\cos \theta +i\sin \theta$⁠ expresses and summarizes these relations.
The exponential function can be even further generalized to accept other types of arguments, such as matrices and elements of Lie algebras.

## Graph

The graph of $y=e^{x}$ is upward-sloping, and increases faster than every power of ⁠$x$⁠. The graph always lies above the x-axis, but becomes arbitrarily close to it for large negative x; thus, the x-axis is a horizontal asymptote. The equation ${\tfrac {d}{dx}}e^{x}=e^{x}$ means that the slope of the tangent to the graph at each point is equal to its height (its y-coordinate) at that point.

## Definitions and fundamental properties

There are several equivalent definitions of the exponential function, although of very different nature.

### Differential equation

One of the simplest definitions is: The exponential function is the unique differentiable function that equals its derivative, and takes the value 1 for the value 0 of its variable.
This "conceptual" definition requires a uniqueness proof and an existence proof, but it allows an easy derivation of the main properties of the exponential function.
Uniqueness: If ⁠$f(x)$⁠ and ⁠$g(x)$⁠ are two functions satisfying the above definition, then the derivative of ⁠$f/g$⁠ is zero everywhere because of the quotient rule. It follows that ⁠$f/g$⁠ is constant; this constant is 1 since ⁠$f(0)=g(0)=1$⁠.
Existence is proved in each of the two following sections.

### Inverse of natural logarithm

The exponential function is the inverse function of the natural logarithm. The inverse function theorem implies that the natural logarithm has an inverse function, that satisfies the above definition. This is a first proof of existence. Therefore, one has
    ${\begin{aligned}\ln(\exp x)&=x\\\exp(\ln y)&=y\end{aligned}}$
for every real number $x$ and every positive real number $y.$

### Power series

The exponential function is the sum of the power series ${\begin{aligned}\exp(x)&=1+x+{\frac {x^{2}}{2!}}+{\frac {x^{3}}{3!}}+\cdots \\&=\sum _{n=0}^{\infty }{\frac {x^{n}}{n!}},\end{aligned}}$
where $n!$ is the factorial of n (the product of the n first positive integers). This series is absolutely convergent for every $x$ per the ratio test. So, the derivative of the sum can be computed by term-by-term derivation, and this shows that the sum of the series satisfies the above definition. This is a second existence proof, and shows, as a byproduct, that the exponential function is defined for every ⁠$x$⁠, and is everywhere the sum of its Maclaurin series.

### Functional equation

The exponential satisfies the functional equation: $\exp(x+y)=\exp(x)\cdot \exp(y).$ This results from the uniqueness and the fact that the function $f(x)=\exp(x+y)/\exp(y)$ satisfies the above definition.
It can be proved that a function that satisfies this functional equation has the form ⁠$x\mapsto \exp(cx)$⁠ if it is either continuous or monotonic. It is thus differentiable, and equals the exponential function if its derivative at 0 is 1.

### Limit of integer powers

The exponential function is the limit $\exp(x)=\lim _{n\to \infty }\left(1+{\frac {x}{n}}\right)^{n},$ where $n$ takes only integer values (otherwise, the exponentiation would require the exponential function to be defined). By continuity of the logarithm, this can be proved by taking logarithms and proving $x=\lim _{n\to \infty }\ln \left(1+{\frac {x}{n}}\right)^{n}=\lim _{n\to \infty }n\ln \left(1+{\frac {x}{n}}\right),$ for example with Taylor's theorem.

### Properties

Reciprocal: The functional equation implies ⁠$e^{x}e^{-x}=1$⁠. Therefore ⁠$e^{x}\neq 0$⁠ for every ⁠$x$⁠ and ${\frac {1}{e^{x}}}=e^{-x}.$
Positiveness: ⁠$e^{x}>0$⁠ for every real number ⁠$x$⁠. This results from the intermediate value theorem, since ⁠$e^{0}=1$⁠ and, if one would have ⁠$e^{x}<0$⁠ for some ⁠$x$⁠, there would be an ⁠$y$⁠ such that ⁠$e^{y}=0$⁠ between ⁠$0$⁠ and ⁠$x$⁠. Since the exponential function equals its derivative, this implies that the exponential function is monotonically increasing.
Extension of exponentiation to positive real bases: Let b be a positive real number. The exponential function and the natural logarithm being the inverse each of the other, one has $b=\exp(\ln b).$ If n is an integer, the functional equation of the logarithm implies $b^{n}=\exp(\ln b^{n})=\exp(n\ln b).$ Since the right-most expression is defined if n is any real number, this allows defining ⁠$b^{x}$⁠ for every positive real number b and every real number x: $b^{x}=\exp(x\ln b).$ In particular, if b is the Euler's number $e=\exp(1),$ one has $\ln e=1$ (inverse function) and thus $e^{x}=\exp(x).$ This shows the equivalence of the two notations for the exponential function.

## General exponential functions

A function is commonly called an exponential function—with an indefinite article—if it has the form ⁠$x\mapsto b^{x}$⁠, that is, if it is obtained from exponentiation by fixing the base and letting the exponent vary.
More generally and especially in applied contexts, the term exponential function is commonly used for functions of the form ⁠$f(x)=ab^{x}$⁠. This may be motivated by the fact that, if the values of the function represent quantities, a change of measurement unit changes the value of ⁠$a$⁠, and so, it is nonsensical to impose ⁠$a=1$⁠.
These most general exponential functions are the differentiable functions that satisfy the following equivalent characterizations.
* ⁠$f(x)=ab^{x}$⁠ for every ⁠$x$⁠ and some constants ⁠$a$⁠ and ⁠$b>0$⁠.
* ⁠$f(x)=ae^{kx}$⁠ for every ⁠$x$⁠ and some constants ⁠$a$⁠ and ⁠$k$⁠.
* The value of $f'(x)/f(x)$ is independent of $x$.
* For every $d,$ the value of $f(x+d)/f(x)$ is independent of $x;$ that is, ${\frac {f(x+d)}{f(x)}}={\frac {f(y+d)}{f(y)}}$ for every x, y.
The base of an exponential function is the base of the exponentiation that appears in it when written as ⁠$x\to ab^{x}$⁠, namely ⁠$b$⁠. The base is ⁠$e^{k}$⁠ in the second characterization, exp⁡ f$^′$(x)/f(x) {\textstyle \exp {\frac {f'(x)}{f(x)}}} in the third one, and ((f(x+d))/f(x))$^{1/d}${\textstyle \left({\frac {f(x+d)}{f(x)}}\right)^{1/d}} in the last one.

### In applications

The last characterization is important in empirical sciences, as allowing a direct experimental test whether a function is an exponential function.
Exponential growth or exponential decay—where the varaible change is proportional to the variable value—are thus modeled with exponential functions. Examples are unlimited population growth leading to Malthusian catastrophe, continuously compounded interest, and radioactive decay.
If the modeling function has the form ⁠$x\mapsto ae^{kx},$⁠ or, equivalently, is a solution of the differential equation ⁠$y'=ky$⁠, the constant ⁠$k$⁠ is called, depending on the context, the decay constant, disintegration constant, rate constant, or transformation constant.

### Equivalence proof

For proving the equivalence of the above properties, one can proceed as follows.
The two first characterizations are equivalent, since, if ⁠$b=e^{k}$⁠ and ⁠$k=\ln b$⁠, one has s.$e^{kx}=(e^{k})^{x}=b^{x}.$ The basic properties of the exponential function (derivative and functional equation) implies immediately the third and ths last condititon
Suppose that the third condition is verified, and let ⁠$k$⁠ be the constant value of $f'(x)/f(x).$ Since ∂e$^{kx}$/∂x=ke$^{kx}$, {\textstyle {\frac {\partial e^{kx}}{\partial x}}=ke^{kx}, } the quotient rule for derivation implies that ${\frac {\partial }{\partial x}}\,{\frac {f(x)}{e^{kx}}}=0,$ and thus that there is a constant ⁠$a$⁠ such that $f(x)=ae^{kx}.$
If the last condition is verified, let φ(d)=f(x+d)/f(x), {\textstyle \varphi (d)=f(x+d)/f(x), } which is independent of ⁠$x$⁠. Using ⁠$\varphi (0)=1$⁠, one gets ${\frac {f(x+d)-f(x)}{d}}=f(x)\,{\frac {\varphi (d)-\varphi (0)}{d}}.$ Taking the limit when ⁠$d$⁠ tends to zero, one gets that the third condition is verified with ⁠$k=\varphi '(0)$⁠. It follows therefore that ⁠$f(x)=ae^{kx}$⁠ for some ⁠$a,$⁠ and ⁠$\varphi (d)=e^{kd}.$⁠ As a byproduct, one gets that $\left({\frac {f(x+d)}{f(x)}}\right)^{1/d}=e^{k}$ is independent of both ⁠$x$⁠ and ⁠$d$⁠.

## Compound interest

The earliest occurrence of the exponential function was in Jacob Bernoulli's study of compound interests in 1683. This is this study that led Bernoulli to consider the number $\lim _{n\to \infty }\left(1+{\frac {1}{n}}\right)^{n}$ now known as Euler's number and denoted ⁠$e$⁠.
The exponential function is involved as follows in the computation of continuously compounded interests.
If a principal amount of 1 earns interest at an annual rate of x compounded monthly, then the interest earned each month is ⁠x/12⁠ times the current value, so each month the total value is multiplied by (1 + ⁠x/12⁠), and the value at the end of the year is (1 + ⁠x/12⁠)$^{12}$. If instead interest is compounded daily, this becomes (1 + ⁠x/365⁠)$^{365}$. Letting the number of time intervals per year grow without bound leads to the limit definition of the exponential function, $\exp x=\lim _{n\to \infty }\left(1+{\frac {x}{n}}\right)^{n}$ first given by Leonhard Euler.

## Differential equations

Exponential functions occur very often in solutions of differential equations.
The exponential functions can be defined as solutions of differential equations. Indeed, the exponential function is a solution of the simplest possible differential equation, namely ⁠$y'=y$⁠. Every other exponential function, of the form ⁠$y=ab^{x}$⁠, is a solution of the differential equation ⁠$y'=ky$⁠, and every solution of this differential equation has this form.
The solutions of an equation of the form $y'+ky=f(x)$ involve exponential functions in a more sophisticated way, since they have the form $y=ce^{-kx}+e^{-kx}\int f(x)e^{kx}dx,$ where ⁠$c$⁠ is an arbitrary constant and the integral denotes any antiderivative of its argument.
More generally, the solutions of every linear differential equation with constant coefficients can be expressed in terms of exponential functions and, when they are not homogeneous, antiderivatives. This holds true also for systems of linear differential equations with constant coefficients.

## Complex exponential

The exponential function can be naturally extended to a complex function, which is a function with the complex numbers as domain and codomain, such that its restriction to the reals is the above-defined exponential function, called real exponential function in what follows. This function is also called the exponential function, and also denoted ⁠$e^{z}$⁠ or ⁠$\exp(z)$⁠. For distinguishing the complex case from the real one, the extended function is also called complex exponential function or simply complex exponential.
Most of the definitions of the exponential function can be used verbatim for definiting the complex exponential function, and the proof of their equivalence is the same as in the real case.
The complex exponential function can be defined in several equivalent ways that are the same as in the real case.
The complex exponential is the unique complex function that equals its complex derivative and takes the value ⁠$1$⁠ for the argument ⁠$0$⁠: ${\frac {de^{z}}{dz}}=e^{z}\quad {\text{amd}}\quad e^{0}=1.$
The complex exponential function is the sum of the series $e^{z}=\sum _{k=0}^{\infty }{\frac {z^{k}}{k!}}.$ This series is absolutely convergent for every complex number ⁠$z$⁠. So, the complex differential is an entire function.
The complex exponential function is the limit $e^{z}=\lim _{n\to \infty }\left(1+{\frac {z}{n}}\right)^{n}$
The functional equation $e^{w+z}=e^{w}e^{z}$ holds for every complex numbers ⁠$w$⁠ and ⁠$z$⁠. The complex exponential is the unique continuous function that satisfies this functional equation and has the value ⁠$1$⁠ for ⁠$z=0$⁠.
The complex logarithm is a right-inverse function of the complex exponential: $e^{\log z}=z.$ However, since the complex logarithm is a multivalued function, one has $\log e^{z}=\{z+2ik\pi \mid k\in \mathbb {Z} \},$ and it is difficult to define the complex exponential from the complex logarithm. On the opposite, this is the complex logarithm that is often defined from the complex exponential.
The complex exponential has the following properties: ${\frac {1}{e^{z}}}=e^{-z}$ and $e^{z}\neq 0\quad {\text{for every }}z\in \mathbb {C} .$ It is periodic function of period ⁠$2i\pi$⁠; that is $e^{z+2ik\pi }=e^{z}\quad {\text{for every }}k\in \mathbb {Z} .$ This results from Euler's identity ⁠$e^{i\pi }=-1$⁠ and the functional identity.
The complex conjugate of the complex exponential is ${\overline {e^{z}}}=e^{\overline {z}}.$ Its modulus is $|e^{z}|=e^{|\Re (z)|},$ where ⁠$\Re (z)$⁠ denotes the real part of ⁠$z$⁠.

### Relationship with trigonometry

Complex exponential and trigonometric functions are strongly related by Euler's formula: $e^{it}=\cos(t)+i\sin(t).$
This formula provides the decomposition of complex exponential into real and imaginary parts: $e^{x+iy}=e^{x}\,\cos y+ie^{x}\,\sin y.$
The trigonometric functions can be expressed in terms of complex exponentials: ${\begin{aligned}\cos x&={\frac {e^{ix}+e^{-ix}}{2}}\\\sin x&={\frac {e^{ix}-e^{-ix}}{2i}}\\\tan x&=i\,{\frac {1-e^{2ix}}{1+e^{2ix}}}\end{aligned}}$
In these formulas, ⁠$x,y,t$⁠ are commonly interpreted as real variables, but the formulas remain valid if the variables are interpreted as complex variables. These formulas may be used to define trigonometric functions of a complex variable.

### Plots

* 3D plots of real part, imaginary part, and modulus of the exponential function
* z = Re(e$^{x+iy}$)
* z = Im(e$^{x+iy}$)
* z = |e$^{x+iy}$|
Considering the complex exponential function as a function involving four real variables: $v+iw=\exp(x+iy)$ the graph of the exponential function is a two-dimensional surface curving through four dimensions.
Starting with a color-coded portion of the $xy$ domain, the following are depictions of the graph as variously projected into two or three dimensions.
* Graphs of the complex exponential function
* Checker board key: $x>0:\;{\text{green}}$ $x<0:\;{\text{red}}$ $y>0:\;{\text{yellow}}$ $y<0:\;{\text{blue}}$
* Projection onto the range complex plane (V/W). Compare to the next, perspective picture.
* Projection into the $x$, $v$, and $w$ dimensions, producing a flared horn or funnel shape (envisioned as 2-D perspective image)
* Projection into the $y$, $v$, and $w$ dimensions, producing a spiral shape ($y$ range extended to ±2π, again as 2-D perspective image)
The second image shows how the domain complex plane is mapped into the range complex plane:
* zero is mapped to 1
* the real $x$ axis is mapped to the positive real $v$ axis
* the imaginary $y$ axis is wrapped around the unit circle at a constant angular rate
* values with negative real parts are mapped inside the unit circle
* values with positive real parts are mapped outside of the unit circle
* values with a constant real part are mapped to circles centered at zero
* values with a constant imaginary part are mapped to rays extending from zero
The third and fourth images show how the graph in the second image extends into one of the other two dimensions not shown in the second image.
The third image shows the graph extended along the real $x$ axis. It shows the graph is a surface of revolution about the $x$ axis of the graph of the real exponential function, producing a horn or funnel shape.
The fourth image shows the graph extended along the imaginary $y$ axis. It shows that the graph's surface for positive and negative $y$ values doesn't really meet along the negative real $v$ axis, but instead forms a spiral surface about the $y$ axis. Because its $y$ values have been extended to ±2π, this image also better depicts the 2π periodicity in the imaginary $y$ value.

## Matrices and Banach algebras

The power series definition of the exponential function makes sense for square matrices (for which the function is called the matrix exponential) and more generally in any unital Banach algebra B. In this setting, e$^0$ = 1, and e$^x$ is invertible with inverse e$^{−x}$ for any x in B. If xy = yx, then e$^{x+y}$ = e$^x$e$^y$, but this identity can fail for noncommuting x and y.
Some alternative definitions lead to the same function. For instance, e$^x$ can be defined as $\lim _{n\to \infty }\left(1+{\frac {x}{n}}\right)^{n}.$
Or e$^x$ can be defined as f$_x$(1), where f$_x$ : R → B is the solution to the differential equation ⁠df$_x$/dt⁠(t) = x f$_x$(t), with initial condition f$_x$(0) = 1; it follows that f$_x$(t) = e$^{tx}$ for every t in R.

## Lie algebras

Given a Lie group G and its associated Lie algebra ${\mathfrak {g}}$, the exponential map is a map ${\mathfrak {g}}$ ↦ G satisfying similar properties. In fact, since R is the Lie algebra of the Lie group of all positive real numbers under multiplication, the ordinary exponential function for real arguments is a special case of the Lie algebra situation. Similarly, since the Lie group GL(n,R) of invertible n × n matrices has as Lie algebra M(n,R), the space of all n × n matrices, the exponential function for square matrices is a special case of the Lie algebra exponential map.
The identity $\exp(x+y)=\exp(x)\exp(y)$ can fail for Lie algebra elements x and y that do not commute; the Baker–Campbell–Hausdorff formula supplies the necessary correction terms.

## Transcendency

The function e$^z$ is a transcendental function, which means that it is not a root of a polynomial over the ring of the rational fractions $\mathbb {C} (z).$
If a$_1$, ..., a$_n$ are distinct complex numbers, then e$^{a1z}$, ..., e$^{anz}$ are linearly independent over $\mathbb {C} (z)$, and hence e$^z$ is transcendental over $\mathbb {C} (z)$.

## Computation

The Taylor series definition above is generally efficient for computing (an approximation of) $e^{x}$. However, when computing near the argument $x=0$, the result will be close to 1, and computing the value of the difference $e^{x}-1$ with floating-point arithmetic may lead to the loss of (possibly all) significant figures, producing a large relative error, possibly even a meaningless result.
Following a proposal by William Kahan, it may thus be useful to have a dedicated routine, often called expm1, which computes e$^x$ − 1 directly, bypassing computation of e$^x$. For example, one may use the Taylor series: $e^{x}-1=x+{\frac {x^{2}}{2}}+{\frac {x^{3}}{6}}+\cdots +{\frac {x^{n}}{n!}}+\cdots .$
This was first implemented in 1979 in the Hewlett-Packard HP-41C calculator, and provided by several calculators, operating systems (for example Berkeley UNIX 4.3BSD), computer algebra systems, and programming languages (for example C99).
In addition to base e, the IEEE 754-2008 standard defines similar exponential functions near 0 for base 2 and 10: $2^{x}-1$ and $10^{x}-1$.
A similar approach has been used for the logarithm; see log1p.
An identity in terms of the hyperbolic tangent, $\operatorname {expm1} (x)=e^{x}-1={\frac {2\tanh(x/2)}{1-\tanh(x/2)}},$ gives a high-precision value for small values of x on systems that do not implement expm1(x).

### Continued fractions

The exponential function can also be computed with continued fractions.
A continued fraction for e$^x$ can be obtained via an identity of Euler: $e^{x}=1+{\cfrac {x}{1-{\cfrac {x}{x+2-{\cfrac {2x}{x+3-{\cfrac {3x}{x+4-\ddots }}}}}}}}$
The following generalized continued fraction for e$^z$ converges more quickly: $e^{z}=1+{\cfrac {2z}{2-z+{\cfrac {z^{2}}{6+{\cfrac {z^{2}}{10+{\cfrac {z^{2}}{14+\ddots }}}}}}}}$
or, by applying the substitution z = ⁠x/y⁠: $e^{\frac {x}{y}}=1+{\cfrac {2x}{2y-x+{\cfrac {x^{2}}{6y+{\cfrac {x^{2}}{10y+{\cfrac {x^{2}}{14y+\ddots }}}}}}}}$ with a special case for z = 2: $e^{2}=1+{\cfrac {4}{0+{\cfrac {2^{2}}{6+{\cfrac {2^{2}}{10+{\cfrac {2^{2}}{14+\ddots }}}}}}}}=7+{\cfrac {2}{5+{\cfrac {1}{7+{\cfrac {1}{9+{\cfrac {1}{11+\ddots }}}}}}}}$
This formula also converges, though more slowly, for z > 2. For example: $e^{3}=1+{\cfrac {6}{-1+{\cfrac {3^{2}}{6+{\cfrac {3^{2}}{10+{\cfrac {3^{2}}{14+\ddots }}}}}}}}=13+{\cfrac {54}{7+{\cfrac {9}{14+{\cfrac {9}{18+{\cfrac {9}{22+\ddots }}}}}}}}$