greatest common divisor of polynomials
least common multiple of polynomials
gcd(a, b, 'cofa', 'cofb')
multivariate polynomials over an algebraic number field or an algebraic function field.
(optional) unevaluated names
The gcd function computes the greatest common divisor of two polynomials a and b.
If the coefficients of a and b are integers, then the product of the primitive unit normal greatest common divisor and the greatest common divisor of all coefficients is returned. The primitive normal greatest common divisor can be obtained from this by removing the icontent using %icontent(%).
If the coefficients of a or b are rational numbers or belong to an algebraic number or function field, then the monic greatest common divisor of a and b is computed. See type/algnum and type/algfun.
Algebraic numbers and functions may be represented by radicals (see type/radical) or with the RootOf notation (see evala).
Names occurring inside a RootOf or a radical are viewed as elements of the coefficient field, provided the RootOf defines an algebraic function. Therefore, they may occur in denominators as well. Other names are not allowed in denominators.
If a or b contains objects which are not algebraic numbers nor algebraic functions, these objects will be frozen before the computation proceeds. See frontend.
The RootOf and the radicals defining the algebraic numbers must form an independent set of algebraic quantities, otherwise an error is returned. Note that this condition does not need to be satisfied if the expression contains only algebraic numbers in radical notation (such as 2^(1/2), 3^(1/2), 6^(1/2)) since a basis over Q for the radicals can be computed by Maple in this case.
Since the ordering of the variables depends on the session, the result may also depend on the session when a and b have several variables.
The lcm function computes the least common multiple of an arbitrary number of polynomials.
The optional third argument cofa is assigned the cofactor agcd⁡a,b.
The optional fourth argument cofb is assigned the cofactor bgcd⁡a,b.
The lcm command will compute the least common multiple of an arbitrary number of polynomials, where the gcd command will compute the greatest common divisor of two polynomials.
Note that the arguments must be polynomials in all the indeterminates, otherwise an error is returned:
Error, (in `gcd/Freeze`) arguments should be polynomials
However, when a name appears inside a radical or a RootOf representing an algebraic function, then it is considered as an element of the coefficient field. In the following example, a greatest common divisor in Q(x^(1/2))[y] is computed:
Download Help Document