Gcd
greatest common divisor of polynomials over algebraic extensions
Calling Sequence
Parameters
Description
Examples
evala(Gcd(P, Q, 'p', 'q'), opts)
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'.
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.
alias⁡α=RootOf⁡x3+x+1
α
P1≔x−α⁢x2−α22⁢x−1
P1≔x−α⁢−α2+x22⁢x−1
Q1≔evala⁡Expand⁡x+α3
Q1≔3⁢α2⁢x+3⁢α⁢x2+x3−α−1
G1≔evala⁡Gcd⁡P1,Q1,p1,q1
G1≔x+α2
p1
x−α3⁢x−1
q1
x+α
P2≔x−sqrt⁡t⁢y⁢sqrt⁡t⁢x+12
P2≔x−t⁢y⁢t⁢x+12
Q2≔expand⁡diff⁡P2,x
Q2≔3⁢t⁢x2+4⁢t⁢x+1−2⁢t32⁢y⁢x−2⁢t⁢y
evala⁡Gcd⁡P2,Q2
x+1t
The second argument below is not a polynomial. Therefore, an error is returned:
evala⁡Gcd⁡P2,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.
infolevelGcd≔1
P3≔x2−RootOf⁡x2−x
P3≔x2−RootOf⁡_Z2−_Z
Q3≔x2−2⁢x+1
evala⁡Gcd⁡P3,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':
evala⁡Gcd⁡P3,Q3,independent
1
Alternatively, use indexed RootOfs:
P31≔x2−RootOf⁡x2−x,index=1
P31≔x2
evala⁡Gcd⁡P31,Q3
P32≔x2−RootOf⁡x2−x,index=2
P32≔x2−1
evala⁡Gcd⁡P32,Q3
x−1
Q4≔x2+x
evala⁡Gcd⁡P3,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
evala⁡Gcd⁡P3,Q4,independent
evala⁡Gcd⁡P31,Q4
x
evala⁡Gcd⁡P32,Q4
x+1
A bivariate example with dependent RootOfs:
alias⁡s=RootOf⁡_Z2−2,t=RootOf⁡_Z2−_Z+RootOf⁡_Z2−2−2:
P5≔t−s⁢y+1⁢x⋅3+s+t−1⁢y2⁢x⋅4
P5≔3⁢t−s⁢y+1⁢x+4⁢s+t−1⁢y2⁢x
Q5≔t−s⁢y+1⁢x⋅6+s+t−1⁢y⁢y−12⁢x⋅8
Q5≔6⁢t−s⁢y+1⁢x+8⁢s+t−1⁢y⁢y−12⁢x
evala⁡Gcd⁡P5,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]]]"
y⁢x+−2⁢s−1⁢t7+s7+47⁢x
See Also
evala
GaussInt[GIgcd]
gcd
Gcdex
gcdex
RootOf
Download Help Document