Exponential function

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

For the exp function in MATLAB®, see exp.




exp(x) represents the value of the exponential function at the point x.

The exponential function is defined for all complex arguments.

For most exact arguments, an unevaluated function call is returned subject to some simplifications:

  • Calls of the form with integer or rational q are rewritten such that q lies in the interval . Explicit results are returned if the denominator of q is 1, 2, 3, 4, 5, 6, 8, 10, or 12.

  • Further, the following special values are implemented: , , .

  • A call of the form with an unevaluated ln(y) and a constant c (i.e., of type Type::Constant) yields the result yc.

  • The call yields the result , if f is lambertW.

Floating point results are computed, when the argument is a floating-point number.


Numerical exceptions may happen, when the absolute value of the real part of a floating-point argument x is large. If (x) < - 7.4 108, then exp(x) may return the truncated result 0.0 (protection against underflow). If (x) > 7.4 108, then exp(x) may return the floating-point equivalent RD_INF of infinity. See Example 2.

For arguments of type DOM_INTERVAL, the return value is another interval containing the image set of the exponential function over the input interval. See Example 4.

The protected identifier E is an alias for exp(1).

Environment Interactions

When called with a floating-point argument, the function is sensitive to the environment variable DIGITS which determines the numerical working precision.


Example 1

We demonstrate some calls with exact and symbolic input data:

exp(1), exp(2), exp(-3), exp(1/4), exp(1 + I), exp(x^2)

Floating point values are computed for floating-point arguments:

exp(1.23), exp(4.5 + 6.7*I), exp(1.0/10^20), exp(123456.7)

Some special symbolic simplifications are implemented:

exp(I*PI), exp(x - 22*PI*I), exp(3 + I*PI)

exp(ln(-2)), exp(ln(x)*PI), exp(lambertW(5))

Example 2

The truncated result 0.0 may be returned for floating-point arguments with negative real parts. This prevents numerical underflow:



exp(-742261118.6 + 10.0^10*I), exp(-744261118.7 + 10.0^10*I)

When internal numerical overflow occurs, the floating-point equivalent RD_INF of infinity is returned:



Example 3

System functions such as limit, series, expand, combine etc. handle expressions involving exp:

limit(x*exp(-x), x = infinity), series(exp(x/(x + 1)), x = 0)

expand(exp(x + y + (sqrt(2) + 5)*PI*I))

combine(%, exp)

Example 4

exp transforms intervals (of type DOM_INTERVAL) to intervals:

exp(-1 ... 1)

Note that the MuPAD® floating-point numbers cannot be arbitrarily large. In the context of floating-point intervals, all values larger than a machine-dependent constant are regarded as “infinite”:

exp(1 ... 1e1000)

Finally, we would like to mention that you can also use exp on disjunct unions of intervals:

exp((1 ... PI) union (10 ... 20))

Return Values

Arithmetical expression or a floating-point interval

Overloaded By


See Also

MuPAD Functions