Function reference · Calculus

limit

Computes the limit of an expression as a variable approaches a value.

It handles removable singularities, 0/0 and ∞/∞ forms, and the growth of polynomials, logarithms and exponentials. For a one-sided limit, pass left or right.

If it can't find the limit, the call is returned unevaluated.

Notation

limit(expression, variable, value[, direction])

Write it in an expression: nerdamer('limit(sin(x)/x,x,0)'), or in the Playground.

nerdamer.limit

nerdamer.limit(expr: ExpressionInput, x: ExpressionInput, val: ExpressionInput, dir: LimitDir, depth: number): Expression

A method on the default import. Arguments can be strings, as in Notation.

import { limit }

import { limit } from 'nerdamer/calculus';
limit(expr: ExpressionInput, x: ExpressionInput, val: ExpressionInput, dir: LimitDir, depth: number): Expression

Import only this function, from nerdamer/calculus.

Parameters

expression
Expression whose limit should be evaluated.
variable
Variable approaching the requested value.
value
Value approached by the variable.
direction
Optional one-sided or two-sided limit direction.

Examples

A removable singularity at 0.

limit(sin(x)/x,x,0)
// → 1
Open in Playground

Leading terms decide the limit at infinity.

limit((4*x^2-x)/(3*x^2+x),x,Infinity)
// → 4/3
Open in Playground

x grows faster than log(x).

limit(log(x)/x,x,Infinity)
// → 0
Open in Playground

From the right.

limit(1/x,x,0,right)
// → Inf
Open in Playground

From the left.

limit(1/x,x,0,left)
// → -Inf
Open in Playground

The two sides differ, so there is no limit: unevaluated.

limit(1/x,x,0)
// → limit(x^-1, x, 0, both)
Open in Playground

Good to know

  • The variable is local to the call: a value stored under its name, as in x:5, isn't substituted inside it.

← Back to Function reference