Gcd - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Gcd

greatest common divisor of polynomials over algebraic extensions

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

evala(Gcd(P, Q, 'p', 'q'), opts)

Parameters

P, Q

-

polynomials over an algebraic number or function field.

p, q

-

(optional) names

opts

-

(optional) an option name or a set of option names.

 

-

Options currently supported: 'independent'.

Description

• 

This function computes the monic greatest common divisor of two polynomials with coefficients in an algebraic function field or an algebraic number field.

  

Since the ordering of objects may vary from a session to another, the leading coefficient may change accordingly.

• 

Algebraic functions and algebraic numbers may be represented by radicals or with the RootOf notation (see type,algnum, type,algfun, type,radnum, type,radfun).

• 

The optional arguments p and q are respectively assigned the co-factors of P and Q. Namely, p=PG, q=QG where G is the Gcd.

• 

The computation is performed in the domain Kx, where:

  

x is the set of names in P and Q which do not appear inside a RootOf or a radical,

  

K is a field generated over the rational numbers by the coefficients of P and Q.

  

The arguments P and Q must be polynomials in x.

• 

Partial factorizations are preserved. The result may be a product of powers of expanded polynomials.

• 

Algebraic numbers and functions occurring in the results are reduced modulo their minimal polynomial (see Normal).

• 

If the RootOf and the radicals defining the algebraic numbers are not independent, a case discussion T of the gcd of P and Q over the direct product of rings F defined by the towers of algebraic extensions is computed first. Then, the result of T is combined. If the gcd values over all the branches of T can be combined into one, namely G, then G is the output. Otherwise, an error is reported.

• 

If the expression contains only algebraic numbers in radical notation (2^(1/2), 3^(1/2), 6^(1/2)), the algebraic quantities are not necessarily independent. A basis over Q for the radicals can be computed by Maple in this case.

• 

To skip the independence checking, use the option 'independent'. However, if a zero-divisor is hit when normalizing P and Q during the computation, an error is reported. Furthermore, the result may be incorrect if the option 'independent' is used but the RootOfs are not actually independent.

• 

If a or b contains functions, their arguments are normalized recursively and the functions are frozen before the computation proceeds.

• 

Other objects are frozen and considered as variables.

Examples

aliasα=RootOfx3+x+1

α

(1)

P1xαx2α22x1

P1xαα2+x22x1

(2)

Q1evalaExpandx+α3

Q13α2x+3αx2+x3α1

(3)

G1evalaGcdP1,Q1,p1,q1

G1x+α2

(4)

p1

xα3x1

(5)

q1

x+α

(6)

P2xsqrttysqrttx+12

P2xtytx+12

(7)

Q2expanddiffP2,x

Q23tx2+4tx+12t32yx2ty

(8)

evalaGcdP2,Q2

x+1t

(9)

The second argument below is not a polynomial. Therefore, an error is returned:

evalaGcdP2,Q2+1x

Error, (in `evala/Gcd/preproc0`) arguments should be polynomials

If a polynomial defining a RootOf is reducible, the RootOf does not generate a well-defined field. The command computes a case discussion and then tries to combine the result. In some cases, an error is returned, as described above.

infolevelGcd1

infolevelGcd1

(10)

P3x2RootOfx2x

P3x2RootOf_Z2_Z

(11)

Q3x22x+1

Q3x22x+1

(12)

evalaGcdP3,Q3

evala/Gcd/preproc0:   "a case discussion result: Array(1..2, {1 = [[1], [RootOf(_Z^2-_Z) = 0]], 2 = [[x-1], [RootOf(_Z^2-_Z) = 1]]}) "
MergeGcds:   "Merge result: #cases: 2; gcd(s): [[[1], Record('property' = isPrime, 'polynomials' = [[_z[1], 1, 1, _z[1], isPrimeIrreducible]], 'type' = regular_chain, 'ModulePrint' = module_print_inner)], [[x-1], Record('property' = isPrime, 'polynomials' = [[_z[1], 1, 1, _z[1]-1, isPrimeIrreducible]], 'type' = regular_chain, 'ModulePrint' = module_print_inner)]]"

Error, (in `evala/Gcd/preproc`) reducible RootOf detected. Substitutions are {RootOf(_Z^2-_Z) = 0, RootOf(_Z^2-_Z) = 1}

To pretend that all the defining polynomials are irreducible, use the option 'independent':

evalaGcdP3,Q3,independent

1

(13)

Alternatively, use indexed RootOfs:

P31x2RootOfx2x,index=1

P31x2

(14)

evalaGcdP31,Q3

1

(15)

P32x2RootOfx2x,index=2

P32x21

(16)

evalaGcdP32,Q3

x1

(17)

Q4x2+x

Q4x2+x

(18)

evalaGcdP3,Q4

evala/Gcd/preproc0:   "a case discussion result: Array(1..2, {1 = [[x], [RootOf(_Z^2-_Z) = 0]], 2 = [[x+1], [RootOf(_Z^2-_Z) = 1]]}) "
MergeGcds:   "Merge result: #cases: 1; gcd(s): [[x+RootOf(_Z^2-_Z), [RootOf(_Z^2-_Z)]]]"

x+RootOf_Z2_Z

(19)

evalaGcdP3,Q4,independent

1

(20)

evalaGcdP31,Q4

x

(21)

evalaGcdP32,Q4

x+1

(22)

A bivariate example with dependent RootOfs:

aliass=RootOf_Z22,t=RootOf_Z2_Z+RootOf_Z222:

P5tsy+1x3+s+t1y2x4

P53tsy+1x+4s+t1y2x

(23)

Q5tsy+1x6+s+t1yy12x8

Q56tsy+1x+8s+t1yy12x

(24)

evalaGcdP5,Q5

evala/Gcd/preproc0:   "a case discussion result: Array(1..2, {1 = [[(y+1)*x], [RootOf(_Z^2-_Z+RootOf(_Z^2-2)-2) = -RootOf(_Z^2-2)+1]], 2 = [[y*x], [RootOf(_Z^2-_Z+RootOf(_Z^2-2)-2) = RootOf(_Z^2-2)]]}) "
MergeGcds:   "Merge result: #cases: 1; gcd(s): [[y*x+(1/7*(-2*s-1)*t+1/7*s+4/7)*x, [s, t]]]"

yx+2s1t7+s7+47x

(25)

See Also

evala

GaussInt[GIgcd]

Gcd

gcd

Gcdex

gcdex

RootOf