Compute Bidirectional Limits

Suppose, you have a function f(x). The value C is a limit of the function f(x) at x = x0:


MuPAD® provides the limit command for computing limits. When computing a limit for a variable approaching 0, you can omit specifying x0. By default, the limit command assumes x0 = 0:

limit(sin(x)/x, x = 0);
limit((1 - cos(x))/x, x)

    Note:   Avoid computing limits for floating-point arguments.

If you use floating-point numbers as the parameters of limit, the round-off error can completely change the result. For example, a small error in the following example with the floating-point parameter changes the result from a rational number to the floating-point infinity:

limit((sin(x) - x)/x^3, x = 0);
limit((1.000001*sin(x) - x)/x^3, x = 0)

Was this topic helpful?