solve_inequality
Solves a previously introduced inequality in one real variable over the reals and returns the solution set as a LaTeX string.
Instructions
Solves an inequality in one real variable using SymPy's solveset over the reals.
The inequality is introduced with introduce_expression, e.g. "x**2 - 1 > 0",
"(x - 1)/(x + 2) <= 0", or a combination "And(x > 0, x**2 < 4)" / "Or(...)".
For a double inequality a < f(x) < b use "And(a < f(x), f(x) < b)".
Args:
expr_key: The key of the inequality (previously introduced).
var_name: The variable (previously introduced) to solve for.
Example:
intro("x", [Assumption.REAL], [])
expr_key = introduce_expression("x**2 - 1 > 0")
solve_inequality(expr_key, "x")
# \left(-\infty, -1\right) \cup \left(1, \infty\right)
Returns:
A LaTeX string representing the solution set. Returns an error message string if issues occur.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr_key | Yes | ||
| var_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |