integrate
Computes the indefinite integral of a mathematical expression with respect to a variable, supporting polynomials, trig, exponential, and logarithmic functions.
Instructions
Computes the indefinite integral of a mathematical expression with respect to a variable.
Supports polynomials, trigonometric functions, exponential functions, logarithms, and other functions supported by SymPy.
Args: expression: The mathematical expression to integrate as a string. Examples: "x**2", "sin(x)", "exp(x)", "1/x" variable: The variable with respect to which to integrate. Default is "x". Optionally, other variables can be specified.
Returns: On success: {"result": } On error: {"error": }
Examples: >>> integrate("x2") {'result': 'x3/3'} >>> integrate("sin(x)") {'result': '-cos(x)'} >>> integrate("exp(x)") {'result': 'exp(x)'} >>> integrate("1/x") {'result': 'log(x)'} >>> integrate("xy", "y") {'result': 'xy**2/2'}
Notes: - The result is the indefinite integral without the constant of integration - Complex expressions may be returned in simplified form
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable | No | x | |
| expression | Yes |