Algebraic
Expand
expand expressions containing algebraic numbers
Calling Sequence
Parameters
Options
Description
Examples
Expand(p, options)
p
-
any Maple object; typically an expression containing algebraic numbers
options
(optional) equation(s) of the form keyword = value, where keyword is one of 'symbolic', 'characteristic', 'makeindependent', or 'recursive'.
If the option 'symbolic'=true is given and a RootOf whose minimal polynomial factors nontrivially is detected, Expand will reduce it to a RootOf of lower degree by picking one of the factors arbitrarily. The default is 'symbolic'=false.
If the option 'characteristic'=p is given, where p is a nonnegative integer, the expansion is performed over an extension of the ring ℤp of integers modulo p. The default is 'characteristic'=0 and means that the expansion is performed over an extension of the rational numbers.
Note that if p is positive but not a prime, then ℤp is not a field, and Expand may not be able to expand the input. If it does not succeed because it encounters an integer that has no inverse modulo p, it issues the error "zero divisor modulo p detected".
If the option 'makeindependent'=true is given, then Expand 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.
If the option 'recursive'=false is given, then Expand will not map itself recursively over non-algebraic subexpressions. The default is 'recursive'=true.
This command expands products and powers of (multivariate) rational functions with algebraic number coefficients. Powers of algebraic numbers are also reduced.
The input p 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.
Non-algebraic subexpressions such as sin⁡x that are neither variables, rational numbers, or algebraic objects will first be mapped over recursively (unless the option 'recursive'=false is given; see below). Then they are frozen and temporarily replaced by new local variables, which are not considered to be constant in what follows.
All radicals and powers of RootOfs in the result are reduced with respect to their respective minimal polynomials. That is, every radical is of the form ar, where 0<r<1 is a rational number, and every integer exponent in a power of the form RootOf⁡f,...n satisfies 0<n<degf .
Partial factorizations in denominators of the input are preserved, but the factors themselves will be recursively expanded.
Expand can be used to normalize polynomials over algebraic number fields. However, if p is not a polynomial, then Expand cannot be used to determine if p is mathematically equivalent to zero. In this case, use Normal.
If, after freezing non-algebraic subexpressions, the input contains floating point numbers, only expand will be applied to it.
Expand will check algebraic objects for dependencies if there are at most 4 of them in the input (unless option 'makeindependent' is given; see below). If there are more than 4 algebraic objects in the input, then expansion will be performed anyway, but not all of the properties of the expanded form given above may be satisfied.
with⁡Algebraic:
Introductory examples:
Expand⁡x−sqrt⁡2⁢I⁢y+sqrt⁡8⁢I
x⁢y+2⁢I⁢x⁢2−I⁢2⁢y+4
Expand⁡x+RootOf⁡_Z2−3⁢_Z+12
2⁢RootOf⁡_Z2−3⁢_Z+1⁢x+x2+3⁢RootOf⁡_Z2−3⁢_Z+1−1
Expand⁡x+1⁢x+2y+z
x2y+z+3⁢xy+z+2y+z
Powers of radicals and RootOfs are reduced. Nested and mixed radicals and RootOfs are handled as well:
p≔RootOf⁡x2−x−15+2⁢RootOf⁡x2−x−13,sqrt⁡35
p≔RootOf⁡_Z2−_Z−15+2⁢RootOf⁡_Z2−_Z−13,9⁢3
Expand⁡p
9⁢RootOf⁡_Z2−_Z−1+5,9⁢3
Expand⁡1+sqrt⁡254
1+214+1+214⁢2
Expand⁡RootOf⁡x2−x+RootOf⁡x2−22
RootOf⁡_Z2−_Z+RootOf⁡_Z2−2−RootOf⁡_Z2−2
Expand⁡RootOf⁡x2−sqrt⁡35
3⁢RootOf⁡_Z2−3
Expand⁡x+yRootOf⁡_Z2+_Z+28
x3⁢RootOf⁡_Z2+_Z+2−14+y3⁢RootOf⁡_Z2+_Z+2−14
Algebraic functions in the coefficients are not accepted:
Expand⁡x+sqrt⁡y⁢x−sqrt⁡y
Error, (in Algebraic:-Expand) ratpoly(s) with radalgnum coefficients expected
Non-algebraic subexpressions are first handled recursively (unless option 'recursive'=false is present) and then temporarily replaced by new variables:
Expand⁡foo⁡x+sqrt⁡2⁢y+RootOf⁡_Z2−2,index=1
foo⁡x⁢y+x⁢2+2⁢y+2
Expand⁡foo⁡x+sqrt⁡2⁢y+RootOf⁡_Z2−2,index=1,recursive=false
foo⁡x+2⁢y+RootOf⁡_Z2−2,index=1
Non-algebraic subexpressions may evaluate to something algebraic after recursive treatment:
Expand⁡x+cos⁡I+RootOf⁡_Z2+1,index=2⁢x−1
x2−1
Products and powers of polynomials in denominators will not be expanded, but other expressions in denominators will be expanded recursively:
Expand⁡xx+1⁢x+22
xx+1⁢x+22
Expand⁡xx+1⁢x+2+3
xx2+3⁢x+5
Expand⁡a+bc+d+ef+g
ac+df+g+ef+g+bc+df+g+ef+g
If the input has floating point coefficients, only expand is applied to it:
Expand⁡1.5⁢x+RootOf⁡_Z3−33⁢x−RootOf⁡_Z3−33
−1.5⁢RootOf⁡_Z3−36+1.5⁢x2
Expand⁡32⁢x+RootOf⁡_Z3−33⁢x−RootOf⁡_Z3−33
3⁢x22−272
If there is a RootOf in the input whose leading coefficient is not invertible, the output may not satisfy all of the properties listed above. By using option 'symbolic'=true, Expand can be forced to eliminate the zero divisor by making a substitution:
Expand⁡RootOf⁡RootOf⁡_Z2−_Z⁢_Z2−12
RootOf⁡RootOf⁡_Z2−_Z⁢_Z2−12
Expand⁡RootOf⁡RootOf⁡_Z2−_Z⁢_Z2−12,symbolic=true
1
Using option 'characteristic', expansion can be performed over finite fields:
Expand⁡x+110,characteristic=2
x10+x8+x2+1
Expand⁡x+RootOf⁡_Z2−5,index=12,characteristic=3
2⁢RootOf⁡_Z2+1,index=1⁢x+x2+2
Expand⁡x−6⁢I⁢x+6⁢I,characteristic=7
x2+1
The polynomial defining a RootOf will also be reduced modulo the characteristic:
Expand⁡RootOf⁡_Z2−3,characteristic=7
RootOf⁡_Z2+4
The expansion cannot always be performed in composite characteristic:
Expand⁡1x2−1−x+1⁢x−1+2x+2,characteristic=9
5⁢x+1
Expand⁡1x2−1−x+1⁢x−1+2x+2,characteristic=10
Error, (in Algebraic:-Expand) zero divisor modulo 10 detected
With option 'makeindependent'=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
Expand⁡CubeRootOf4⁢CubeRootOf−2⁢CubeRootOf3−CubeRootOf−4⁢CubeRootOf6
RootOf⁡_Z3+2,index=1⁢RootOf⁡_Z3−3,index=1⁢RootOf⁡_Z3−4,index=1−RootOf⁡_Z3+4,index=1⁢RootOf⁡_Z3−6,index=1
Expand⁡CubeRootOf4⁢CubeRootOf−2⁢CubeRootOf3−CubeRootOf−4⁢CubeRootOf6,makeindependent=true
0
With option 'makeindependent'=false, the input will never be checked for algebraic dependencies:
Expand⁡CubeRootOf2⁢CubeRootOf3−CubeRootOf6,makeindependent=false
RootOf⁡_Z3−2,index=1⁢RootOf⁡_Z3−3,index=1−RootOf⁡_Z3−6,index=1
See Also
Algebraic[Normal]
Algebraic[Reduce]
evala,Expand
expand
Download Help Document