gizmobench

Algebra Constraint Solver

Type up to six polynomial or rational constraints in one variable, such as (x - 1)/(x + 2) >= 0, and combine them with AND or OR. The solver moves each comparison to one side, keeps every point where a typed denominator is zero out of the domain, and finds the boundary points exactly: rational ones as fractions, irrational ones in square-root form or as the root of a stated polynomial inside a certified interval. You get the solution set in interval and inequality notation, a sign table with a test point in every interval, a number line, and LaTeX or JSON to take away.

Your constraints

Example input

Read as 1, with x as the variable.

Use numbers, one letter, + - * / ^ and brackets, then a comparison: < <= > >= = or !=. Chain two in one row, as in -1 < 2x + 1 <= 5. AND is applied before OR, and blank rows are skipped. Up to 6 rows; after moving everything to one side, each numerator and denominator can reach degree 8 with coefficients up to 100 digits.

Solution set

(-∞, -2) ∪ [1, ∞)

x < -2 or x ≥ 1

f1+−+-21

Text equivalent: Critical points in order, evenly spaced and not to scale: -2 open (not included); 1 filled (included). Shaded: (-∞, -2) ∪ [1, ∞).

The example below is already solved. Edit it or type your own constraints.

Domain restriction
x ≠ -2
Critical points
-2, 1
Solution
(-∞, -2) ∪ [1, ∞)
Certification
2 exact rational

Sign table

Each f is the left side minus the right side of one comparison. A test point inside every interval fixes each sign exactly; at a critical point the sign is 0, undefined or the same as on both sides.

  • f1(x) = (x - 1)/(x + 2), from constraint 1, needs f1 ≥ 0
RegionTest pointf1 signConstraint 1In the set
x < -2-3+holdsyes
x = -2boundaryundefinedfailsno
-2 < x < 10−failsno
x = 1boundary0holdsyes
x > 12+holdsyes

Critical points

PointApproximationCertificateRoleIn the set
-2-2exact rationaloutside the domain of constraint 1; pole of f1no
11exact rationalzero of f1yes

Worked examples

  • x^2 > 1quadratic example
    (-∞, -1) ∪ (1, ∞)
  • (x - 1)/(x + 2) >= 0rational example
    (-∞, -2) ∪ [1, ∞)
  • -2x + 4 < 0 AND x <= 3AND example
    (2, 3]
  • x^2 - 2x - 1 >= 0irrational example
    (-∞, 1 - √2] ∪ [1 + √2, ∞)
  • (x^2 - 1)/(x - 1) = 2excluded root example
    ∅

Common questions

How do I type an inequality?
Use numbers, a single letter as the variable, + - * / ^ and brackets, then one of < <= > >= = or !=. Pasted symbols such as ≤, ≥, ≠, x² and the typographic minus sign are read too. 2x means 2 times x and x^-1 means 1/x. Implied multiplication has the same precedence as * and /, read left to right, so 1/2x is read as (1/2)x; write 1/(2x) for the other meaning. One row can chain two comparisons, as in -1 < 2x + 1 <= 5, and both must hold.
Why is a value missing when it solves the simplified equation?
(x^2 - 1)/(x - 1) = 2 simplifies to x + 1 = 2, whose solution is x = 1, but the typed expression divides by zero at 1. The solver keeps every point where any denominator in the row is zero out of that row's domain, including denominators that cancel and nested ones such as 1/(1/x), so the answer here is the empty set. Excluded points are listed under Domain restriction and in the critical point table.
How are AND and OR combined?
Each row after the first has an AND or OR toggle joining it to the row above. AND is applied before OR, as in ordinary logic, and the page states the grouping it used, for example 1 OR (2 AND 3). A point outside one row's domain makes that row false, but it can still be in the answer through an OR. Blank rows are skipped, and each typed row joins the rows before it with the toggle directly above it.
How are irrational boundaries shown?
Every boundary is found exactly. A rational boundary is shown as a fraction. When an irrational boundary's defining polynomial is quadratic it is shown in square-root form, such as 1 - √2; otherwise it is named r1, r2 and so on. Factors you type, such as (x^2 - 2)(x^2 - 3), are kept apart so each can get its own form. Each irrational point lists its defining polynomial, an interval that a Sturm count certifies holds exactly one root of that polynomial, and an approximation to 10 significant digits. The points are ordered by exact interval refinement, never by comparing decimals.
What are the limits?
Up to six rows of at most 4000 characters each, enough for a dense degree 8 numerator and denominator with 100-digit coefficients. After a comparison is moved to one side, its numerator and denominator can each reach degree 8, the points excluded by one row's denominators together are limited to degree 8, and every normalized coefficient to 100 digits. Powers must be whole numbers no larger than 64 either way, and a row may grow to degree 32 while it is expanded. Past a limit the page names the row and the limit instead of truncating. If exact root separation runs past its work limit, the result is reported as unresolved, never as a partial set.
What does it not solve?
It solves real constraints in one variable. It does not handle absolute values, roots, logarithms, trigonometric or other transcendental functions, two or more variables, integer-only answers or word problems. Rewrite |x - 1| < 3 as -3 < x - 1 < 3 to solve it here.
What do the copy and download buttons give me?
Copy solution copies the set in interval and inequality notation, the grouping, each constraint with its normalized function and domain, and every critical point with its role. Copy LaTeX copies the same set written in LaTeX, plus a line defining each r1 style point. Download JSON saves the constraints, the critical points with their certified intervals, the full sign table and the solution pieces. Constraints you type are remembered in this browser; examples are not stored.

Real rational constraints in one variable only: no multivariate regions, transcendental functions, integer-only solutions or word-problem interpretation. Exact polynomial GCDs, Sturm root counts and rational interval isolation establish every boundary and its order; an irrational boundary shows its defining polynomial, a certified isolating interval and an approximation. A resource failure returns unresolved and never silently drops roots.