dsolve_ode
Solves ordinary differential equations symbolically using SymPy, returning a LaTeX solution; specify the equation expression and function, with an optional method hint.
Instructions
Solves an ordinary differential equation using SymPy's dsolve function.
Args:
expr_key: The key of the expression (previously introduced) containing the differential equation.
func_name: The name of the function (previously introduced) to solve for.
hint: Optional solving method from ODEHint enum. If None, SymPy will try to determine the best method.
Example:
# First introduce a variable and a function
intro("x", [Assumption.REAL], [])
introduce_function("f")
# Create a second-order ODE: f''(x) + 9*f(x) = 0
expr_key = introduce_expression("Derivative(f(x), x, x) + 9*f(x)")
# Solve the ODE
result = dsolve_ode(expr_key, "f")
# Returns solution with sin(3*x) and cos(3*x) terms
Returns:
A LaTeX string representing the solution. Returns an error message string if issues occur.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| expr_key | Yes | ||
| func_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |