solve_equation
Solve algebraic equations for x and return all solutions. Enter one equation string with an equals sign, such as x**2 - 5*x + 6 = 0, for SymPy-supported polynomial or trigonometric results.
Instructions
Solves an algebraic equation for x and returns all solutions.
The equation must contain exactly one equality sign (=) and use a variable x. Can solve polynomial, trigonometric, and other equations supported by SymPy.
Args: equation: The equation to solve as a string. Format: ' = ' Examples: "x**2 - 5x + 6 = 0", "sin(x) = 0.5", "2x + 3 = 7"
Returns: On success: {"solutions": } On error: {"error": }
Examples: >>> solve_equation("x**2 - 5x + 6 = 0") {'solutions': '[2, 3]'} >>> solve_equation("2x + 3 = 7") {'solutions': '[2]'} >>> solve_equation("x = 0") {'solutions': '[0]'}
Notes: - Use 'x' as the variable (e.g., x2, not x^2) - Multiplication must be explicitly indicated with * (e.g., 2*x, not 2x) - Powers can be represented with ** or ^ (e.g., x2 or x^2)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| equation | Yes |