integrate_expression
Perform symbolic integration of an expression with respect to a specified variable. Supports both indefinite and definite integration using SymPy's functionality via the Symbolic Algebra MCP Server.
Instructions
Integrates an expression with respect to a variable using SymPy's integrate function.
Args:
expr_key: The key of the expression (previously introduced) to integrate.
var_name: The name of the variable to integrate with respect to.
lower_bound: Optional lower bound for definite integration.
upper_bound: Optional upper bound for definite integration.
Example:
# Introduce a variable
intro("x", [Assumption.REAL], [])
# Create an expression to integrate: x^2
expr_key = introduce_expression("x**2")
# Indefinite integration
indefinite_result = integrate_expression(expr_key, "x")
# Returns x³/3
# Definite integration from 0 to 1
definite_result = integrate_expression(expr_key, "x", "0", "1")
# Returns 1/3
Returns:
A key for the integrated expression.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
expr_key | Yes | ||
lower_bound | No | ||
upper_bound | No | ||
var_name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"expr_key": {
"title": "Expr Key",
"type": "string"
},
"lower_bound": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Lower Bound"
},
"upper_bound": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Upper Bound"
},
"var_name": {
"title": "Var Name",
"type": "string"
}
},
"required": [
"expr_key",
"var_name"
],
"title": "integrate_expressionArguments",
"type": "object"
}