Algebraic
Content
content of a polynomial with algebraic number coefficients
PrimitivePart
primitive part of a polynomial with algebraic number coefficients
Calling Sequence
Parameters
Options
Description
Examples
Content(a, v, options)
Content(a, v, `pp`, options)
PrimitivePart(a, v, options)
PrimitivePart(a, v, `co`, options)
a
-
polynomial with algebraic number coefficients
v
(optional) name, set of names, or list of names
co, pp
(optional) unevaluated names
options
(optional) equation(s) of the form keyword = value, where keyword is either 'symbolic', 'makeindependent', or 'characteristic'
If the option 'symbolic'=true is given and a RootOf whose minimal polynomial factors nontrivially is detected, then it will be reduced to a RootOf of lower degree by picking one of the factors arbitrarily. This will eliminate the possibility of a "reducible RootOf detected" error. The default is 'symbolic'=false.
If the option 'characteristic'=p is given, where p is a nonnegative integer, the content and primitive part are computed over an extension of the ring ℤp of integers modulo p. The default is 'characteristic'=0 and means that the content and primitive part are computed over an extension of the rational numbers.
Note that if p is positive but not a prime, then ℤp is not a field, so Content and PrimitivePart may not be able to perform the computation. If they do not succeed because they encounter an integer that has no inverse modulo p, they issue the error "zero divisor modulo p detected".
If the option 'makeindependent'=true is given, then Content and PrimitivePart will always try to find a field representation for algebraic numbers in the input, regardless of how many algebraic objects the input contains. If the input contains many RootOfs, then this can be a very expensive calculation. If 'makeindependent'=false is given, then no independence checking is performed. The default is 'makeindependent'=FAIL, in which case algebraic dependencies will only be checked for if there are 4 or fewer algebraic objects in the input.
The Content and PrimitivePart commands compute the content and primitive part of the multivariate polynomial a with respect to the variable(s) v. The content is defined as a greatest common divisor of the coefficients of a with respect to the indeterminates v and is free of v. The primitive part is a polynomial in v defined as aContent⁡a.
The input a may contain algebraic number coefficients. These may be represented by radicals or with the RootOf notation (see type/algnum, type/radnum). In general, algebraic numbers will be returned in the same representation as they were received in. Nested radicals and RootOfs are also supported.
Formally, the input will be considered as an element of the domain K(y)[v], where
K is an algebraic field generated over the rationals and any algebraic numbers in a (unless the option 'characteristic' is given; see below).
v is the set of indeterminates, which can be given as the optional second argument to Content or PrimitivePart. If the argument v is omitted, then by default, all of the variables in a will be used.
y is the set of names and other non-algebraic subexpressions in the input that are not included in v. These will be treated as elements of the coefficient field.
A primitive part pp of a will then be a polynomial in K[y][v] whose coefficients are relatively prime polynomials in K[y]. The corresponding content co is an element of K(y) such that a=co⁢pp. The content and primitive part are unique up to a multiplicative constant in K. In particular, it is important to note that the Content and PrimitivePart commands will normalize their output differently, so a will not necessarily be the product of Content(a) and PrimitivePart(a). To obtain the associated factors, use the optional third arguments `co` and `pp` (see below).
Note that the input must be a polynomial in v, but its coefficients may be rational functions in other variables. The primitive part will always be a polynomial in v whose denominator is 1, so any factors in the denominator of the input will be considered as part of the content. If a is a polynomial disguised as a rational function, it will first be normalized using Algebraic[Normal].
The Content command will return the unsigned content, and if the optional parameter `pp` is included, it will be assigned the value of the corresponding primitive part. In this case, priority is given to normalizing the content:
There are no constant factors in the content. All constant factors are multiplied into the primitive part.
The primitive part will contain at most two constant factors, and at most one of them is not a rational number.
All remaining non-constant factors in both the content and the primitive part have signed integer content equal to 1 (except possibly if there is only one non-constant factor in the primitive part).
The PrimitivePart command will return the primitive part, and if the optional parameter `co` is included, it will be assigned the value of the corresponding content. In this case, priority is given to normalizing the primitive part:
There are no constant factors in the primitive part, with the possible exception of −1, since the content is always unsigned. The denominator of the primitive part is 1, and all other constant factors are multiplied into the content.
The content will contain at most two constant factors, and at most one of them is not a rational number.
All remaining non-constant factors in both the content and the primitive part have signed integer content equal to 1 (except possibly if there is only one non-constant factor in the content).
Note that in both Content and PrimitivePart, no effort is made to rationalize leading coefficients or denominators in the output. This helps to keep the output as small and simplified as possible for subsequent computations. To rationalize the output, simply apply Algebraic[Normal] to it.
If the input is mathematically equivalent to zero, both the content and the primitive part are defined to be zero.
These commands preserve partial factorizations in the input and expand polynomials only if necessary.
Non-algebraic sub-expressions such as sin⁡x that are neither variables, rational numbers, or algebraic objects are frozen and temporarily replaced by new local variables, which are considered as elements of the coefficient field.
The v parameter can also contain functions such as sin⁡x, in which case they will be frozen and treated as variables. However, functions that are also of type AlgebraicObject such as sin⁡π3 will be converted to algebraic numbers before proceeding, so they cannot be treated as variables. Proceed with caution when using functions in v, as treating some functions as variables may produce mathematically unsound results.
All algebraic numbers occurring in the results will be reduced modulo their minimal polynomial (see Algebraic,Reduce), and all arguments of functions, if any, will be normalized recursively (see Algebraic,Normal).
If the set of radicals and RootOfs in the input cannot be embedded into a field algebraically, then Content and PrimitivePart may not be able to perform the computation. Content and PrimitivePart will try to find a field representation if there are at most 4 algebraic objects in the input (unless the option 'makeindependent' is given; see below), and otherwise attempt to proceed anyway. If unsuccessful, a "reducible RootOf detected" error will be returned (unless the option 'symbolic'=true is given; see below).
These functions do not support input containing floats or radical functions such as x.
with⁡Algebraic:
Introductory examples:
co1≔Content⁡x⁢y+sqrt⁡2⁢x+sqrt⁡2⁢y2+2⁢y,x,pp1
co1≔2+y
co1
2+y
pp1
y⁢2+x
expand⁡co1⁢pp1
x⁢y+x⁢2+2⁢y2+2⁢y
PrimitivePart⁡x2+1+x⁢y−I⁢y,y,co2,co2
y+x+I,−I+x
The input may contain both radicals and RootOfs. Content and PrimitivePart will embed the coefficients into an algebraic field, if possible:
Content⁡x2−3⁢x−1+x−RootOf⁡_Z2−3⁢_Z−1⁢y,y,pp3,pp3
x−RootOf⁡_Z2−3⁢_Z−1,y+x+RootOf⁡_Z2−3⁢_Z−1−3
Content⁡x2⁢sqrt⁡2+x2⁢y+y+RootOf⁡_Z2−2,index=1,x,pp4,pp4
2+y,x2+1
PrimitivePart⁡x⁢y+x⁢sqrt⁡2+y⁢sqrt⁡3+sqrt⁡6,y,co5,co5
2+y,3+x
Nested and mixed radicals and RootOfs are handled as well:
Content⁡x⁢y+RootOf⁡_Z2−RootOf⁡_Z2−2,index=1,index=1+x2⁢y+x2⁢214,x,pp6,pp6
y+214,x2+x
The content and primitive part will be calculated with respect to the variables in v:
Content⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y,,pp7,pp7
x2⁢y2+x2⁢y+y2⁢x+x⁢y,1
Content⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y,x,pp8,pp8
y2+y,x2+x
Content⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y,y,pp9,pp9
x2+x,y2+y
Content⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y,x,y,pp10,pp10
1,x2⁢y2+x2⁢y+y2⁢x+x⁢y
If the v parameter is omitted, then all the variables in the input will be used:
Content⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y
1
PrimitivePart⁡x2⁢y2+x2⁢y+y2⁢x+x⁢y
x2⁢y2+x2⁢y+y2⁢x+x⁢y
The coefficients of the input may be rational functions, but the primitive part will always be a polynomial in v with a denominator of 1:
Content⁡x2y+x⁢y+1,x,pp11,pp11
1y,y2⁢x+x2+y
PrimitivePart⁡x2sqrt⁡2+xI⁢y,x,co12,co12
x⁢y⁢2−2⁢I⁢x,12⁢y
An error message will be returned if any elements of v occur in the denominator of the input:
Content⁡x2⁢y+yx,x
Error, (in Algebraic:-Content) polynom in [x] expected
Content⁡x2⁢y+yx,x,y
Error, (in Algebraic:-Content) polynom in [x, y] expected
However, if a is a polynomial in v disguised as a rational function, then it will first be normalized using Algebraic[Normal]:
PrimitivePart⁡x2⁢y⁢z+2⁢y⁢zx+sqrt⁡2⁢I,x,y
−I⁢2⁢y+x⁢y
The content will always be unsigned, so negatives will always be moved into the primitive part, regardless of which command is used:
Content⁡−x⁢y−y,x,pp13,pp13
y,−x−1
PrimitivePart⁡−x⁢y−y,x,pp14,pp14
−x−1,y
Depending on which command is used, priority may be given to normalizing either the content or the primitive part, so the values returned by Content and PrimitivePart can differ by a constant. Here, the constant is 3⁢5:
Content⁡3⁢x⁢y⁢sqrt⁡5+6⁢y⁢sqrt⁡10,x,pp15,pp15
y,6⁢5⁢2+3⁢5⁢x
PrimitivePart⁡3⁢x⁢y⁢sqrt⁡5+6⁢y⁢sqrt⁡10,x,co16,co16
x+2⁢2,3⁢5⁢y
If the input is mathematically equivalent to zero, both the content and the primitive part are, by definition, zero:
Content⁡x2+1−x−I⁢x+I,x,pp17,pp17
0,0
PrimitivePart⁡x2+1−x−I⁢x+I,x,co18,co18
Factorizations in the input will be preserved and expanded only if necessary:
Content⁡x⁢y+3⁢y⁢x⁢z+x⁢z+2,x,pp19,pp19
y⁢z+1⁢z+2,x+3⁢x
Content⁡expand⁡x⁢y+3⁢y⁢x⁢z+x⁢z+2,x,pp20,pp20
y⁢z2+3⁢y⁢z+2⁢y,x2+3⁢x
Non-algebraic sub-expressions such as sin⁡x will be frozen and treated as elements of the coefficient field:
Content⁡x2⁢sin⁡x+x⁢sin⁡x⁢foo⁡y,x,pp21,pp21
sin⁡x,foo⁡y⁢x+x2
PrimitivePart⁡3⁢xfoo⁡y+RootOf⁡_Z2−3⁢x2foo⁡y2,x,co22,co22
RootOf⁡_Z2−3⁢x+3⁢foo⁡y⁢x,1foo⁡y2
However, whenever possible, such expressions will be converted to algebraic numbers (see ConvertRootOf):
PrimitivePart⁡x⁢y⁢z⁢sin⁡π3+x2⁢y2⁢z2⁢tan⁡π6,x,y,co23,co23
2⁢z⁢y2⁢x2+3⁢x⁢y,3⁢z6
Content⁡x⁢y2+exp⁡I⁢π+y−sec⁡π,x,pp24,pp24
y+1,x⁢y−x+1
Non-algebraic functions can also be included in the v parameter, as long as they are not of type Algebraic Object:
Content⁡sin⁡x2⁢cos⁡y+sin⁡x⁢cos⁡y,sin⁡x,pp25,pp25
cos⁡y,sin⁡x2+sin⁡x
Content⁡sin⁡π92⁢cos⁡y+sin⁡π9⁢cos⁡y,sin⁡π9
Error, invalid input: too many and/or wrong type of arguments passed to Algebraic:-Content; first unused argument is sin(1/9*Pi)
The arguments of functions in the input will be recursively normalized and simplified (see Algebraic,Normal):
Content⁡sin⁡x2−3x−RootOf⁡_Z2−3⁢x+sin⁡x+RootOf⁡_Z2−3,x
sin⁡x+RootOf⁡_Z2−3
Content⁡sin⁡x⁢y2+cos⁡x−π2⁢y,y
sin⁡x
Non-algebraic functions in the input may become algebraic after recursive treatment:
Content⁡x⁢y−x+y+cos⁡π⁢y+πy+1,x,pp26,pp26
y−1,x+1
All algebraic numbers will be reduced modulo their minimal polynomial (see Reduce):
PrimitivePart⁡x⁢y+x⁢RootOf⁡_Z2−_Z−32+y+RootOf⁡_Z2−_Z−3+3,x,co27,co27
x+1,RootOf⁡_Z2−_Z−3+y+3
Algebraic functions such as y are not accepted:
Content⁡x2⁢y+2⁢x⁢sqrt⁡y+x⁢y,x
Error, (in Algebraic:-Content) polynom with radalgnum coefficients expected
Floats are not accepted.
Content⁡x22−x⋅0.5
When a non-indexed RootOf is given in the input, sometimes the content and primitive part can still be computed:
Content⁡x2⁢y2−4+x⁢y+RootOf⁡_Z2−4,x,pp28,pp28
y+RootOf⁡_Z2−4,x2⁢y−x2⁢RootOf⁡_Z2−4+x
Content⁡x2⁢y2−4+x⁢y+RootOf⁡_Z2−4,index=1,x,pp29,pp29
y+2,x2⁢y−2⁢x2+x
However, in this case, Content and PrimitivePart must know whether RootOf⁡_Z2−3⁢_Z+2 without an index represents 1 or 2 in order to determine whether the coefficients of the input can be factored out into the content:
Content⁡x2⁢y+1+x⁢y+RootOf⁡_Z2−3⁢_Z+2,index=1,x,pp30,pp30
y+1,x2+x
Content⁡x2⁢y+1+x⁢y+RootOf⁡_Z2−3⁢_Z+2,index=2,x,pp31,pp31
1,x2⁢y+x2+x⁢y+2⁢x
Content⁡x2⁢y+1+x⁢y+RootOf⁡_Z2−3⁢_Z+2,x
Error, (in Algebraic:-Content) reducible RootOf detected. Substitutions are {RootOf(_Z^2-3*_Z+2) = 1, RootOf(_Z^2-3*_Z+2) = 2}
To force Content or PrimitivePart to reduce this RootOf to one of lower degree by picking one of the substitutions arbitrarily, use option 'symbolic'=true. Here, it makes the substitution RootOf⁡_Z2−3⁢_Z+2 = 2:
Content⁡x2⁢y+1+x⁢y+RootOf⁡_Z2−3⁢_Z+2,x,pp32,symbolic=true,pp32
Non-indexed RootOfs can be treated as constants, even if one of them is a zero divisor. However, if the input contains a zero divisor as a common factor, then it will always be left in the primitive part:
PrimitivePart⁡x2⁢RootOf⁡_Z2−8⁢_Z−3+x⁢RootOf⁡_Z2−8⁢_Z−3,x,co33,co33
x2+x,RootOf⁡_Z2−8⁢_Z−3
PrimitivePart⁡x2⁢RootOf⁡_Z2−8⁢_Z+x⁢RootOf⁡_Z2−8⁢_Z,x,co34,co34
x2⁢RootOf⁡_Z2−8⁢_Z+x⁢RootOf⁡_Z2−8⁢_Z,1
Using option 'characteristic', the content and primitive part can be computed over finite fields:
Content⁡x⁢y+4⁢x+3⁢y+2,x,pp35,pp35
1,x⁢y+4⁢x+3⁢y+2
Content⁡x⁢y+4⁢x+3⁢y+2,x,pp36,characteristic=5,pp36
y+4,x+3
PrimitivePart⁡x2⁢y2−6+x⁢y2+2⁢I⁢y−1,x,co37,characteristic=7,co37
x2⁢y+6⁢I⁢x2+x⁢y+I⁢x,y+I
In composite characteristic, the content and primitive part cannot always be computed. Content and PrimitivePart will return an error if they encounter a zero divisor:
Content⁡2⁢x⁢y+x+4⁢y+2,x,pp38,characteristic=9,pp38
y+5,2⁢x+4
Content⁡2⁢x⁢y+x+4⁢y+2,x,characteristic=10
Error, (in Algebraic:-Content) zero divisor modulo 10 detected
With the value of 'makeindependent' set to true, the input will be checked for algebraic dependencies even if there are more than 4 algebraic objects in the input:
CubeRootOf−4≔RootOf⁡_Z3+4,index=1
CubeRootOf−2≔RootOf⁡_Z3+2,index=1
CubeRootOf2≔RootOf⁡_Z3−2,index=1
CubeRootOf3≔RootOf⁡_Z3−3,index=1
CubeRootOf4≔RootOf⁡_Z3−4,index=1
CubeRootOf6≔RootOf⁡_Z3−6,index=1
PrimitivePart⁡x⁢y+CubeRootOf4⁢CubeRootOf−2⁢CubeRootOf3+y+CubeRootOf−4⁢CubeRootOf6,x,co39,co39
Error, (in Algebraic:-PrimitivePart) reducible RootOf detected. Substitutions are {RootOf(_Z^3+4,index = 1) = 1/2*RootOf(_Z^3-4,index = 1)^2*RootOf(_Z^3+2,index = 1), RootOf(_Z^3+4,index = 1) = RootOf(RootOf(_Z^3-4,index = 1)^2*RootOf(_Z^3+2,index = 1)*_Z-2*RootOf(_Z^3-4,index = 1)^2+2*_Z^2+4*RootOf(_Z^3+2,index = 1))}
PrimitivePart⁡x⁢y+CubeRootOf4⁢CubeRootOf−2⁢CubeRootOf3+y+CubeRootOf−4⁢CubeRootOf6,x,co40,makeindependent=true,co40
x+1,RootOf⁡_Z3+2,index=1⁢RootOf⁡_Z3−6,index=1⁢RootOf⁡_Z3−4,index=122+y
With option 'makeindependent'=false, the input will never be checked for algebraic dependencies:
PrimitivePart⁡x⁢y+CubeRootOf2⁢CubeRootOf3+y+CubeRootOf6,x,co41,co41
x+1,y+RootOf⁡_Z3−6,index=1
PrimitivePart⁡x⁢y+CubeRootOf2⁢CubeRootOf3+y+CubeRootOf6,x,co42,makeindependent=false,co42
Error, (in Algebraic:-PrimitivePart) reducible RootOf detected. Substitutions are {RootOf(_Z^3-2,index = 1) = 1/3*RootOf(_Z^3-6,index = 1)*RootOf(_Z^3-3,index = 1)^2, RootOf(_Z^3-2,index = 1) = RootOf(RootOf(_Z^3-6,index = 1)*RootOf(_Z^3-3,index = 1)^2*_Z+RootOf(_Z^3-6,index = 1)^2*RootOf(_Z^3-3,index = 1)+3*_Z^2)}
See Also
Algebraic[GreatestCommonDivisor]
Algebraic[Normal]
content
evala,Content
evala,Primpart
primpart
Download Help Document