TOPICS
Search

Polynomial Greatest Common Divisor


A polynomial greatest common divisor of polynomials f,g in K[x], not both zero, over a field K is a polynomial h that divides both f and g and is divisible by every common divisor. It is customary to choose h to be monic. This makes h unique, and it is denoted GCD(f,g).

The Euclidean algorithm computes h by repeated polynomial division. For g!=0, if

 f=qg+r,
(1)

where r=0 or degr<degg, then

 GCD(f,g)=GCD(g,r).
(2)

The last nonzero polynomial remainder, divided by its leading coefficient, is the desired monic polynomial (Brown and Traub 1971, pp. 506-507). Back substitution gives polynomials A,B in K[x] such that

 Af+Bg=GCD(f,g).
(3)

For example,

 x^4-1=x(x^3-1)+(x-1),
(4)

and x-1 divides x^3-1, so GCD(x^4-1,x^3-1)=x-1.

Subresultants provide another characterization. For nonzero f and g with degrees m>=n>0, let S_j be their jth subresultant and s_j its principal subresultant coefficient, using the terminal convention S_n=b_n^(m-n-1)g, where b_n is the leading coefficient of g. If d is the first index with s_d!=0, then

 GCD(f,g)=(S_d(f,g))/(s_d),
(5)

and d=degGCD(f,g) (El Kahoui 2003, pp. 290-291). In particular, the resultant is zero iff the polynomials have a common divisor of positive degree.

The ring of coefficients matters. In Z[x], a greatest common divisor is determined up to sign and need not be monic. For example, a greatest common divisor of 2x and 4x in Z[x] is 2x, whereas their monic greatest common divisor in Q[x] is x. Moreover, the linear combination property over a field need not hold with integer coefficients. Although 2 and x have greatest common divisor 1 in Z[x], an identity 2A(x)+xB(x)=1 with A,B in Z[x] is impossible, as evaluating at x=0 shows.

Polynomial greatest common divisors are computed in the Wolfram Language using PolynomialGCD[f, g]. To make a nonzero output monic, divide it by its leading coefficient. The coefficients in a linear combination are returned by PolynomialExtendedGCD[f, g, x].


See also

Euclidean Algorithm, Greatest Common Divisor, Polynomial Division, Principal Subresultant Coefficient, Resultant, Subresultant

Explore with Wolfram|Alpha

References

Brown, W. S. and Traub, J. F. "On Euclid's Algorithm and the Theory of Subresultants." J. ACM 18, 505-514, 1971. https://doi.org/10.1145/321662.321665.El Kahoui, M. "An Elementary Approach to Subresultants Theory." J. Symb. Comput. 35, 281-292, 2003. https://doi.org/10.1016/S0747-7171(02)00135-9.Trott, M. "Polynomials in Equations." §1.2.2 in The Mathematica GuideBook for Symbolics. New York: Springer-Verlag, 2006. https://www.mathematicaguidebooks.org/.

Cite this as:

Weisstein, Eric W. "Polynomial Greatest Common Divisor." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PolynomialGreatestCommonDivisor.html

Subject classifications