How this calculation works
A polynomial ideal consists of all polynomial combinations of its generators. Ordinary substitution at a few roots cannot decide membership. A Gröbner basis puts the same ideal into a form that supports a deterministic multivariate division remainder for the selected monomial order. This solver uses exact rational Buchberger reductions, tracks each new polynomial as a combination of the original generators, and then interreduces the result. It verifies both containment directions and the final S-polynomial criterion before interpreting the query remainder.
G is monic and reduced; every S(gᵢ,gⱼ) reduces to zero. Query f belongs to ⟨G⟩ exactly when its remainder is zero.A worked example
Start with f1=xy−1 and f2=y²−x, using lexicographic order x>y. The reduced monic basis is x−y² and y³−1. The first relation replaces x by y²; substituting into xy−1 gives y³−1. Reducing query xy−1 by these two basis elements gives zero, proving membership. The ideal is not the same as requiring x and y independently to equal one: it also has complex solutions associated with the other cube roots of unity.
Good to know
One to five rational generators in x,y or x,y,z, with total input degree at most six. Intermediate term, degree, basis-size, pair-count, operation and fraction-growth limits raise explicit errors. Lex, graded lex and graded reverse lex use the declared variable priority. The result is an ideal basis and remainder, not a general equation solver, real-solution classifier or promise that every supported-looking input fits the computational budget.
Reference: SymPy — Gröbner bases, orders and ideal reduction (opens in a new tab) ↗
The leading monomial depends on the chosen order
Lexicographic order compares the exponent of the first variable before considering the second. Graded orders compare total degree first; their tie-breaking rules then differ. These choices can produce very different-looking bases for the same ideal. A reduced basis is canonical after the coefficient field, variables and order are fixed, so changing the selector changes the normal form rather than changing the input equations.
Buchberger pairs cancel two leading terms at their least common multiple. A nonzero remainder adds a missing reduction rule. When every final pair reduces to zero, the leading-term ideal is represented completely. Tracking generator combinations also proves that the new rules did not enlarge the original ideal. Both checks matter: a convenient-looking collection that merely makes the original generators vanish under division could represent a larger ideal.
A nonzero remainder answers membership, not approximate root fitting
The query equals a polynomial combination of basis elements plus its remainder. Zero therefore proves exact ideal membership. A nonzero remainder proves nonmembership for the completed basis over Q, even when the query vanishes at some common solutions. Vanishing on all complex solutions concerns the radical ideal and is a different question; this tool does not silently replace the ideal by its radical.
The zero ideal has an empty nonzero basis and contains only the zero polynomial. An ideal containing one has basis {1} and contains every polynomial. These edge cases require no invented root list. The Polynomial extended Euclidean algorithm calculator instead works in one-variable division, where a single gcd generates the ideal; multivariate leading terms require the richer basis calculation used here.
A few questions, answered
Why can the basis change when I change order?
The ideal stays fixed, but its leading monomials and division rules depend on order. The zero/nonzero membership decision agrees after each computation completes.
Does zero remainder mean the polynomial is identically zero?
No. It means the polynomial is a combination of the ideal generators. For example xy−1 is nonzero as a polynomial but belongs to the ideal generated by xy−1 and y²−x.