refine_expression
Simplify mathematical expressions using variable assumptions, reducing sqrt(x^2) to x and Abs(x) to x under positivity constraints.
Instructions
Simplify expression using assumptions.
═══════════════════════════════════════════════════════════════════════
🆕 NOT AVAILABLE IN SYMPY-MCP!
═══════════════════════════════════════════════════════════════════════
SymPy can simplify expressions differently when it knows
properties of the variables. For example:
- sqrt(x**2) → x when x is positive
- Abs(x) → x when x is positive
Args:
expression: Expression to refine
assumptions: Assumptions about symbols
Returns:
Refined expression
Examples:
# sqrt(x**2) simplifies to x when x is positive
refine_expression("sqrt(x**2)", {"x": ["positive"]})
→ {"result": "x", ...}
# Abs simplifies under assumptions
refine_expression("Abs(a*b)", {"a": ["positive"], "b": ["positive"]})
→ {"result": "a*b", ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | ||
| assumptions | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||