Method on @sym: limit (expr, x, a, dir)
Method on @sym: limit (expr, x, a)
Method on @sym: limit (expr, a)
Method on @sym: limit (expr)

Evaluate symbolic limits.

The limit of expr as x tends to a from dir. dir can be left or right.

Examples:

syms x
L = limit(sin(x)/x, x, 0)
  ⇒ L = (sym) 1
L = limit(1/x, x, sym(inf))
  ⇒ L = (sym) 0
L = limit(1/x, x, 0, 'left')
  ⇒ L = (sym) -∞
L = limit(1/x, x, 0, 'right')
  ⇒ L = (sym) ∞

If x is omitted, symvar is used to determine the variable. If a is omitted, it defaults to 0.

dir defaults to right. Note this is different from Matlab’s Symbolic Math Toolbox which returns NaN for limit(1/x, x, 0) (and +/-inf if you specify left/right). I’m not sure how to get this nicer behaviour from SymPy. FIXME: this is https://github.com/cbm755/octsympy/issues/74

See also: @sym/diff.

Package: symbolic