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

Online Help

All Products    Maple    MapleSim


Algebraic

  

Expand

  

expand expressions containing algebraic numbers

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

Expand(p, options)

Parameters

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'.

Options

• 

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.

Description

• 

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 sinx 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 RootOff&comma;...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.

Examples

withAlgebraic&colon;

Introductory examples:

Expandxsqrt2Iy+sqrt8I

xy+2Ix2I2y+4

(1)

Expandx+RootOf_Z23_Z+12

2RootOf_Z23_Z+1x+x2+3RootOf_Z23_Z+11

(2)

Expandx+1x+2y+z

x2y+z+3xy+z+2y+z

(3)

Powers of radicals and RootOfs are reduced. Nested and mixed radicals and RootOfs are handled as well:

pRootOfx2x15+2RootOfx2x13&comma;sqrt35

pRootOf_Z2_Z15+2RootOf_Z2_Z13&comma;93

(4)

Expandp

9RootOf_Z2_Z1+5&comma;93

(5)

Expand1+sqrt254

1+214+1+2142

(6)

ExpandRootOfx2x+RootOfx222

RootOf_Z2_Z+RootOf_Z22RootOf_Z22

(7)

ExpandRootOfx2sqrt35

3RootOf_Z23

(8)

Expandx+yRootOf_Z2+_Z+28

x3RootOf_Z2+_Z+214+y3RootOf_Z2+_Z+214

(9)

Algebraic functions in the coefficients are not accepted:

Expandx+sqrtyxsqrty

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:

Expandfoox+sqrt2y+RootOf_Z22&comma;index=1

fooxy+x2+2y+2

(10)

Expandfoox+sqrt2y+RootOf_Z22&comma;index=1&comma;recursive=false

foox+2y+RootOf_Z22&comma;index=1

(11)

Non-algebraic subexpressions may evaluate to something algebraic after recursive treatment:

Expandx+cosI+RootOf_Z2+1&comma;index=2x1

x21

(12)

Products and powers of polynomials in denominators will not be expanded, but other expressions in denominators will be expanded recursively:

Expandxx+1x+22

xx+1x+22

(13)

Expandxx+1x+2+3

xx2+3x+5

(14)

Expanda+bc+d+ef+g

ac+df+g+ef+g+bc+df+g+ef+g

(15)

If the input has floating point coefficients, only expand is applied to it:

Expand1.5x+RootOf_Z333xRootOf_Z333

1.5RootOf_Z336+1.5x2

(16)

Expand32x+RootOf_Z333xRootOf_Z333

3x22272

(17)

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:

ExpandRootOfRootOf_Z2_Z_Z212

RootOfRootOf_Z2_Z_Z212

(18)

ExpandRootOfRootOf_Z2_Z_Z212&comma;symbolic=true

1

(19)

Using option 'characteristic', expansion can be performed over finite fields:

Expandx+110&comma;characteristic=2

x10+x8+x2+1

(20)

Expandx+RootOf_Z25&comma;index=12&comma;characteristic=3

2RootOf_Z2+1&comma;index=1x+x2+2

(21)

Expandx6Ix+6I&comma;characteristic=7

x2+1

(22)

The polynomial defining a RootOf will also be reduced modulo the characteristic:

ExpandRootOf_Z23&comma;characteristic=7

RootOf_Z2+4

(23)

The expansion cannot always be performed in composite characteristic:

Expand1x21x+1x1+2x+2&comma;characteristic=9

5x+1

(24)

Expand1x21x+1x1+2x+2&comma;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:

CubeRootOf4RootOf_Z3+4&comma;index=1

CubeRootOf−4RootOf_Z3+4&comma;index=1

(25)

CubeRootOf2RootOf_Z3+2&comma;index=1

CubeRootOf−2RootOf_Z3+2&comma;index=1

(26)

CubeRootOf2RootOf_Z32&comma;index=1

CubeRootOf2RootOf_Z32&comma;index=1

(27)

CubeRootOf3RootOf_Z33&comma;index=1

CubeRootOf3RootOf_Z33&comma;index=1

(28)

CubeRootOf4RootOf_Z34&comma;index=1

CubeRootOf4RootOf_Z34&comma;index=1

(29)

CubeRootOf6RootOf_Z36&comma;index=1

CubeRootOf6RootOf_Z36&comma;index=1

(30)

ExpandCubeRootOf4CubeRootOf2CubeRootOf3CubeRootOf4CubeRootOf6

RootOf_Z3+2&comma;index=1RootOf_Z33&comma;index=1RootOf_Z34&comma;index=1RootOf_Z3+4&comma;index=1RootOf_Z36&comma;index=1

(31)

ExpandCubeRootOf4CubeRootOf2CubeRootOf3CubeRootOf4CubeRootOf6&comma;makeindependent=true

0

(32)

With option 'makeindependent'=false, the input will never be checked for algebraic dependencies:

ExpandCubeRootOf2CubeRootOf3CubeRootOf6&comma;makeindependent=false

RootOf_Z32&comma;index=1RootOf_Z33&comma;index=1RootOf_Z36&comma;index=1

(33)

See Also

Algebraic

Algebraic[Normal]

Algebraic[Reduce]

evala,Expand

expand