This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)


gives a list of polynomials that form a Gröbner basis for the set of polynomials .
finds a Gröbner basis in which the have been eliminated.
  • The set of polynomials in a Gröbner basis have the same collection of roots as the original polynomials.
  • For linear functions in any number of variables, GroebnerBasis is equivalent to Gaussian elimination.
  • The Gröbner basis in general depends on the ordering assigned to monomials. This ordering is affected by the ordering of the .
  • The following options can be given:
MonomialOrderLexicographicthe criterion used for ordering monomials
CoefficientDomainAutomaticthe type of objects assumed to be coefficients
MethodAutomaticthe method to use
Modulus0the modulus for numerical coefficients
  • Possible settings for are , , , or an explicit weight matrix. Monomials are specified for the purpose of by lists of the exponents with which the appear in them.
  • The ordering of the and the setting for can substantially affect the efficiency of GroebnerBasis.
  • Possible settings for are , Rationals, , and .
  • Possible settings for the Method option include and .
Compute a Gröbner basis:
Prove that polynomials have no common roots:
Compute a Gröbner basis:
Click for copyable input
Prove that polynomials have no common roots:
Click for copyable input
Polynomials with a finite number of common roots:
Polynomials with an infinite number of common roots:
Polynomials with no common roots:
Eliminate a variable:
A lexicographic Gröbner basis:
A degree reverse lexicographic Gröbner basis:
Polynomial equations can be given instead of polynomials:
By default, Gröbner bases are computed over the field of rational numbers:
This computes the strong Gröbner basis over the ring of integers:
This computes the Gröbner basis over the field of rational functions (a):
This uses approximate arithmetic:
The Automatic method setting uses for lexicographic bases over the rationals:
In this case the method is much slower than :
These polynomials are "close" to the lexicographic Gröbner basis:
The method computes the degree reverse lexicographic basis first:
Computing the lexicographic basis directly with the method is faster here:
This computes the Gröbner basis over the field of integers modulo 7:
By default, GroebnerBasis uses the monomial order:
This gives the Gröbner basis in the monomial order:
A monomial order may be specified by giving a full rank square rational weight matrix:
For the order to be well-founded the first nonzero entry in each column must be positive:
Eliminate z and return a degree reverse lexicographic basis with respect to :
Parameters are ordered lexicographically after all other variables:
This is an equivalent input:
By default, GroebnerBasis is not allowed to reorder the variables:
Reordering the variables may make computations faster; the Gröbner basis may be different:
Find an approximate GCD of a pair of univariate polynomials:
The polynomials are close to polynomials with integer coefficients:
With the default setting Tolerance, the approximate GCD has a too low degree:
With a higher setting of Tolerance, GroebnerBasis gives a "better" approximate GCD:
Solve a system of polynomial equations:
A Gröbner basis has the same set of roots as the input polynomials:
Solve the first polynomial of the Gröbner basis for its only variable x:
Solve the second polynomial of the Gröbner basis for the other variable y:
This method finds all common roots of polys:
Reduce and Solve use Gröbner bases to solve systems of equations:
Get a fuzzy solution to a system of overdetermined equations:
This gives a low-precision approximate solution to this overdetermined set of polynomials:
A Gröbner basis generates the same ideal as the input polynomials:
Use PolynomialReduce to show that is in the ideal generated by and :
By Hilbert's Nullstellensatz, if the ideal is then the polynomials have no common zero:
Reduce or Solve proves that there is no common solution:
Conversely, if the ideal is not , then there is at least one common zero:
Use FindInstance to find a solution instance:
GroebnerBasis of univariate polynomials is equivalent to computing PolynomialGCD:
GroebnerBasis of linear polynomials is equivalent to a Gaussian elimination process:
GroebnerBasis is used to solve systems of polynomial equations:
Use Reduce to directly solve the system:
Solve gives solutions in terms of replacement rules:
Eliminate a variable from a system of polynomial equations:
Eliminate a variable using Resolve:
Eliminate a variable using Eliminate:
Eliminate a variable using Resultant:
New in 2 | Last modified in 6