limit_expression
Computes symbolic limits as a variable approaches a specified point, including two-sided and one-sided cases, and indicates when a limit does not exist.
Instructions
Computes the limit of an expression as a variable tends to a point, using SymPy's limit.
Args:
expr_key: The key of the expression (previously introduced).
var_name: The variable (previously introduced) that tends to the point.
point: The limit point, e.g. "0", "1/2", "pi/2", "oo" (+infinity), "-oo".
Parsed without eval: only numbers, introduced variables, oo/inf/pi/E/I,
arithmetic operators and sqrt/exp/log/sin/cos/tan/Rational are accepted.
direction: "+-" for the two-sided limit (default), "+" from the right, "-" from the left.
Ignored for limits at +oo or -oo.
Example:
intro("x", [Assumption.REAL], [])
expr_key = introduce_expression("sin(x)/x")
result_key = limit_expression(expr_key, "x", "0")
# 1
expr_key = introduce_expression("(1 + 1/x)**x")
result_key = limit_expression(expr_key, "x", "oo")
# e
Returns:
A key for the limit. Returns an error message if the limit does not exist
(one-sided limits differ, or the expression oscillates).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| point | Yes | ||
| expr_key | Yes | ||
| var_name | Yes | ||
| direction | No | +- |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |