Exponential function

From Wikipedia, the free encyclopedia

The exponential function is one of the most important functions in mathematics. It is written as exp(x) or ex, where e equals approximately 2.71828183 and is the base of the natural logarithm.

The exponential function is nearly flat (climbing slowly) for negative values of x, climbs quickly for positive values of x, and equals 1 when x is equal to 0. Its y value always equals the slope at that point.
The exponential function is nearly flat (climbing slowly) for negative values of x, climbs quickly for positive values of x, and equals 1 when x is equal to 0. Its y value always equals the slope at that point.

As a function of the real variable x, the graph of y=ex is always positive (above the x axis) and increasing (viewed left-to-right). It never touches the x axis, although it gets arbitrarily close to it (thus, the x axis is a horizontal asymptote to the graph). Its inverse function, the natural logarithm, ln(x), is defined for all positive x.

Sometimes, especially in the sciences, the term exponential function is reserved for functions of the form kax, where a, called the base, is any positive real number. This article will focus initially on the exponential function with base e, Euler's number.

In general, the variable x can be any real or complex number, or even an entirely different kind of mathematical object; see the formal definition below.

Contents

[edit] Properties

Most simply, exponential functions multiply at a constant rate. For example the population of a bacteria which doubles every three hours can be expressed as an exponential, as can the value of a car which decreases by 10% per year.

Using the natural logarithm, one can define more general exponential functions. The function

\!\, a^x=(e^{\ln a})^x=e^{x \ln a}

defined for all a > 0, and all real numbers x, is called the exponential function with base a.

Note that the equation above holds for a = e, since

\!\, e^{x \ln e}=e^{x \cdot 1}=e^x.

Exponential functions "translate between addition and multiplication" as is expressed in the following exponential laws:

\!\, a^0 = 1
\!\, a^1 = a
\!\, a^{x + y} =  a^x a^y
\!\, a^{x y} = \left( a^x \right)^y
\!\, {1 \over a^x} = \left({1 \over a}\right)^x = a^{-x}
\!\, a^x b^x = (a b)^x

These are valid for all positive real numbers a and b and all real numbers x and y. Expressions involving fractions and roots can often be simplified using exponential notation because:

{1 \over a} = a^{-1}

and, for any a > 0, real number b, and integer n > 1:

\sqrt[n]{a^b} = \left(\sqrt[n]{a}\right)^b = a^{b/n}

[edit] Derivatives and differential equations

The importance of exponential functions in mathematics and the sciences stems mainly from properties of their derivatives. In particular,

{d \over dx} e^x = e^x

That is, ex is its own derivative. It is the only function with that property (up to multiplication by a constant). Other ways of saying the same thing include:

  • The slope of the graph at any point is the height of the function at that point.
  • The rate of increase of the function at x is equal to the value of the function at x.
  • The function solves the differential equation y' = y.
  • exp is a fixed point of derivative as a functional

In fact, many differential equations give rise to exponential functions, including the Schrödinger equation and the Laplace's equation as well as the equations for simple harmonic motion.

For exponential functions with other bases:

{d \over dx} a^x = (\ln a) a^x

Thus any exponential function is a constant multiple of its own derivative.

If a variable's growth or decay rate is proportional to its size — as is the case in unlimited population growth (see Malthusian catastrophe), continuously compounded interest, or radioactive decay — then the variable can be written as a constant times an exponential function of time.

Furthermore for any differentiable function f(x), we find, by the chain rule:

{d \over dx} e^{f(x)} = f'(x)e^{f(x)}.

[edit] Formal definition

The exponential function ex can be defined in a variety of equivalent ways, as an infinite series. In particular it may be defined by a power series:

e^x = \sum_{n = 0}^{\infty} {x^n \over n!} = 1 + x + {x^2 \over 2!} + {x^3 \over 3!} + {x^4 \over 4!} + \cdots

or as the limit of a sequence:

e^x = \lim_{n \to \infty} \left( 1 + {x \over n} \right)^n.

In these definitions, n! stands for the factorial of n, and x can be any real number, complex number, element of a Banach algebra (for example, a square matrix), or member of the field of p-adic numbers.

For further explanation of these definitions and a proof of their equivalence, see the article Definitions of the exponential function.

[edit] Numerical value

To obtain the numerical value of the exponential function, the infinite series can be rewritten as :

e^x = {1 \over 0!} + x \, \left( {1 \over 1!} + x \, \left( {1 \over 2!} + x \, \left( {1 \over 3!} + \cdots \right)\right)\right)
= 1 + {x \over 1} \left(1 + {x \over 2} \left(1 + {x \over 3} \left(1 + \cdots \right)\right)\right)

This expression will converge quickly if we can ensure that x is less than one.

To ensure this, we can use the following identity.

e^x\, =e^{z+f}\,
= e^z \times \left[{1 \over 0!} + f \, \left( {1 \over 1!} + f \, \left( {1 \over 2!} + f \, \left( {1 \over 3!} + \cdots \right)\right)\right)\right]
  • Where z is the integer part of x
  • Where f is the fractional part of x
  • Hence, f is always less than 1 and f and z add up to x.

The value of the constant ez can be calculated beforehand by multiplying e with itself z times.

[edit] Computing exp(x) for real x

An even better algorithm can be found as follows.

First, notice that the answer y = ex is usually a floating point number represented by a mantissa m and an exponent n so y = m 2n for some integer n and suitably small m. Thus, we get:

y = m\,2^n = e^x.

Taking log on both sides of the last two gives us:

log(y) = log(m) + nlog(2) = x.

Thus, we get n as the result of dividing x by log(2) and finding the greatest integer that is not greater than this - that is, the floor function:

n = \left\lfloor\frac{x}{\log(2)}\right\rfloor.

Having found n we can then find the fractional part u like this:

u = xnlog(2).

The number u is small and in the range 0 ≤ u < log(2) and so we can use the previously mentioned series to compute m:

m = e^u = 1 + u(1 + u(\frac12 + u(\frac13 + u(....)))).

Having found m and n we can then produce y by simply combining those two into a floating point number:

y = e^x = m\,2^n.

[edit] Computation of an for natural number (positive integer) n

There is a fast way to compute an when n is a positive integer. It makes use of the fact that testing that such a number is odd is very easy on a computer and dividing by 2 is also fast by simply shifting all the bits to the right.

step 1, initialize some variables
y: = 1,k: = n,f: = a

step 2, test k
if k is 0, go to step OUT

step 3, (k is not 0 here, test if k is even)
if k is even go to step 5

step 4, (k is odd here, multiply in)
y: = y * f

step 5, (divide k by 2 / ignore remainder, divide by shift, also square f)
k := k shift right by 1 f := f * f

step 6, (loop)
go back to step 2

step 7, (done, y is result = an)
return y

In C you can write the algorithm like this:

  double power(double a, unsigned int n)
  {
       double y = 1;
       double f = a;
       unsigned int k = n;
       while (k != 0) {
          if ((k & 1) != 0) y *= f;
          k >>= 1;
          f *= f;
       }
       return y;
  }

While a naive multiplication of a^100 would require 100 iterations of a loop multiplying a, this loop iterates only 7 times (The number 100 is written using 7 bits).

This algorithm can easily be extended for signed integers by doing the following steps before and after:

step 1. if k is negative, negate the value so we get a positive k. n still remembers the original value.

step 2. Perform the above computation for y = a | k |

step 3. If n is negative, invert the result so y := 1/y. y is now the result of an for an integer n.

[edit] On the complex plane

When considered as a function defined on the complex plane, the exponential function retains the important properties

\!\, e^{z + w} = e^z e^w
\!\, e^0 = 1
\!\, e^z \ne 0
\!\, {d \over dz} e^z = e^z

for all z and w.

It is a holomorphic function which is periodic with imaginary period i and can be written as

\!\, e^{a + bi} = e^a (\cos b + i \sin b)

where a and b are real values. This formula connects the exponential function with the trigonometric functions and to the hyperbolic functions. Thus we see that all elementary functions except for the polynomials spring from the exponential function in one way or another.

See also Euler's formula.

Extending the natural logarithm to complex arguments yields a multi-valued function, ln(z). We can then define a more general exponentiation:

\!\, z^w = e^{w \ln z}

for all complex numbers z and w. This is also a multi-valued function. The above stated exponential laws remain true if interpreted properly as statements about multi-valued functions.

The exponential function maps any line in the complex plane to a logarithmic spiral in the complex plane with the center at the origin. Two special cases might be noted: when the original line is parallel to the real axis, the resulting sprial never closes in on itself; when the original line is parallel to the imaginary axis, the resulting spiral is a circle of some radius.

[edit] Computation of exp(z) for a complex z

This is fairly straightforward given the formulae

ex + yi = exeyi = ex(cos(y) + isin(y)) = excos(y) + iexsin(y).

Note that the argument y to the trigonometric functions are real.

[edit] Computation of ab where both a and b are complex

This is also straightforward given the formulae:

if a = x + yi and b = u + vi we can first convert a to polar co-ordinates by finding a θ and an r such that:

reθi = rcosθ + irsinθ = a = x + yi

or

x = rcosθ and y = rsinθ.

Thus, x2 + y2 = r2 or r = \sqrt{x^2 + y^2} and \tan\theta = \frac{y}{x} or θ = arctan2(y,x).

Now, we have that:

a = reθi = elog(r) + θi

so:

ab = (elog(r) + θi)u + vi = e(log(r) + θi)(u + vi)

The exponent is thus a simple multiplication of two complex values yielding a complex result which can then be brought back to regular cartesian format by the formula:

ep + qi = ep(cos(q) + isin(q)) = epcos(q) + iepsin(q)

where p is the real part of the multiplication:

p = ulog(r) − vθ

and q is the imaginary part of the multiplication:

q = vlog(r) + uθ.

Note that all of x,y,u,v,r, θ, p and q are all real values in these computations. The result of ab is thus p + qi.

Also note that since we compute and use log(r) rather than r itself you don't have to compute the square root. Instead simply compute \log(r) = \frac12\log(x^2 + y^2). Watch out for potential overflow though and possibly scale down the x and y prior to computing x2 + y2 by a suitable power of 2 if x and y are so large that you would overflow. If you instead run the risk of underflow, scale up by a suitable power of 2 prior to computing the sum of the squares. In either case you then get the scaled version of x - we can call it x' and the scaled version of y - call it y' and so you get:

x = x'2s and y = y'2s

where 2s is the scaling factor.

Then you get \log(r) = \frac12(\log(x'^2 + y'^2) + s) where x' and y' are scaled so that the sum of the squares will not overflow or underflow. If x is very large while y is very small so that you cannot find such a scaling factor you will overflow anyway and so the sum is essentially equal to x2 since y is ignored and thus you get r = | x | in this case and log(r) = log( | x | ). The same happens in the case when x is very small and y is very large. If both are very large or both are very small you can find a scaling factor as mentioned earlier.

[edit] Matrices and Banach algebras

The definition of the exponential function given above can be used verbatim for every Banach algebra, and in particular for square matrices (in which case the function is called the matrix exponential). In this case we have

\ e^{x + y} = e^x e^y \mbox{ if } xy = yx
\ e^0 = 1
\ e^x is invertible with inverse \ e^{-x}
the derivative of \ e^x at the point \ x is that linear map which sends \ u to \ ue^x.

In the context of non-commutative Banach algebras, such as algebras of matrices or operators on Banach or Hilbert spaces, the exponential function is often considered as a function of a real argument:

\ f(t) = e^{t A}

where A is a fixed element of the algebra and t is any real number. This function has the important properties

\ f(s + t) = f(s) f(t)
\ f(0) = 1
\ f'(t) = A f(t)

[edit] On Lie algebras

The "exponential map" sending a Lie algebra to the Lie group that gave rise to it shares the above properties, which explains the terminology. In fact, since R is the Lie algebra of the Lie group of all positive real numbers with multiplication, the ordinary exponential function for real arguments is a special case of the Lie algebra situation. Similarly, since the Lie algebra M (n, R) of all square real matrices belongs to the Lie group of all invertible square matrices, the exponential function for square matrices is a special case of the Lie algebra exponential map.

[edit] Double exponential function

The term double exponential function can have two meanings:

  • a function with two exponential terms, with different exponents
  • a function f(x) = a^{a^x}; this grows even faster than an exponential function; for example, if a = 10: f(−1) = 1.26, f(0) = 10, f(1) = 1010, f(2) = 10100 = googol, f(3) = 101000, ..., f(100) = googolplex.

Compare the super-exponential function, which grows even faster.

[edit] See also

[edit] External links