Compute a limit
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.
Left | Right | Real>, <Intervals>, <NoWarning>) limit(
x = x0, <
Left | Right | Real>, <Intervals>, <NoWarning>)
limit(f, x = x0, Real) computes
the bidirectional limit , .
limit(f, x = x0, Left | Right) computes
the one-sided limit , respectively.
limit(f, x = x0, Intervals) computes
a set containing all accumulation points of , .
limit(f, x = x0, <Real>) computes the
bidirectional limit of
x0 on the real axis. The limit point
be omitted, in which case
If the limit point
x0 is infinity or -
∞, then the limit is taken from the left
to infinity or
from the right to - ∞,
limit(f, x = x0, Left) returns the limit
x tends to
x0 from the
limit(f, x = x0, Right) returns the limit
x tends to
x0 from the
right. See Example 2.
If it cannot be determined whether a limit exist, or cannot
determine its value, then a symbolic to
returned. See Example 3. The same holds,
in case the option
Intervals is given, if no information
on the set of accumulation points could be obtained.
You can compute the limit of a piecewise function. The conditions you use to define a piecewise function can depend on the limit variable. See Example 6.
limit tries to determine the
limit from a series expansion of
= x0 computed via
It may be necessary to increase the value of the environment variable
order to find the limit.
limit works on a symbolic level and should
not be called with arguments containing floating
The following command computes :
limit((1 - cos(x))/x^2, x)
A possible definition of e is given by the limit of the sequence for :
limit((1 + 1/n)^n, n = infinity)
Here is a more complex example:
limit( (exp(x*exp(-x)/(exp(-x) + exp(-2*x^2/(x+1)))) - exp(x))/x, x = infinity )
The bidirectional limit of for does not exist:
limit(1/x, x = 0)
You can compute the one-sided limits from the left and from
the right by passing the options
limit(1/x, x = 0, Left), limit(1/x, x = 0, Right)
limit is not able to compute the limit,
then a symbolic
limit call is returned:
delete f: limit(f(x), x = infinity)
The function sin(x) oscillates for between - 1 and 1; no accumulation points outside that interval exist:
limit(sin(x), x = infinity, Intervals)
In fact, all elements of the interval returned are accumulation points. This need not be the case in general. In the following example, the limit inferior and the limit superior are in fact and , respectively:
limit(sin(1/x) + cos(1/x), x = 0, Intervals)
limit is not able to compute the limit of xn for without
additional information about the parameter n:
assume(n in R_): limit(x^n, x = infinity)
We can also
that n > 0 and
get no case analysis then:
assume(n > 0): limit(x^n, x = infinity)
Similarly, we can assume that n < 0:
assume(n < 0): limit(x^n, x = infinity)
Compute limit of the piecewise function:
limit(piecewise([x^3 > 10000*x, 1/x], [x^3 <= 10000*x, 10]), x = infinity)
Compute limits of the incomplete Gamma function:
limit(igamma(z, t), t = infinity); limit(igamma(z, t), t = 0)
expression representing a function in
This controls the direction of the limit computation. The option
If this option is set to
expression. If the option
given, the result is a (finite or infinite) set.
limit uses an algorithm based on the thesis
of Dominik Gruntz: “On Computing Limits in a Symbolic Manipulation
System”, Swiss Federal Institute of Technology, Zurich, Switzerland,
1995. If this fails, it tries to proceed recursively; finally, it
attempts a series expansion.