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

Online Help

All Products    Maple    MapleSim


RootOf

a representation for roots of equations

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

RootOf(expr)

RootOf(expr, x)

RootOf(expr, x, c)

RootOf(expr, x, a..b)

RootOf(expr, x, index=i)

RootOf(expr, x, label=e)

Parameters

expr

-

algebraic expression or equation

x

-

(optional) variable name

c

-

(optional) number; specify a root selector

a...b

-

(optional) complex numbers; specify a bounding box

index=i

-

(optional) index where i is an integer

label=e

-

(optional) label where e is anything: a name, an expression, a list, or an integer

Description

• 

The function RootOf is a placeholder for representing all the roots of an equation in one variable.  In particular, it is the standard representation for Maple algebraic numbers, algebraic functions (see evala), and finite fields GFpk,pprime,k>1 (see mod).

• 

Maple automatically generates RootOfs to express the solutions to polynomial equations and systems of equations (see solve), eigenvalues of matrices (see LinearAlgebra[Eigenvalues]), and rational function integrals (see int). Maple can apply diff, series, evalf, and simplify to RootOf expressions.

• 

If x is not specified, then expr must be either a univariate expression or an expression in _Z.  In this case, the RootOf represents the roots of expr with respect to its single variable or _Z, respectively.  If the first argument is not an equation, then the equation expr=0 is assumed.

• 

The RootOf function checks the validity of its arguments and solves it for polynomials of degree one. The RootOf is expressed in a single-argument canonical form, obtained by making the argument primitive and expressing the RootOf in terms of the global variable _Z.

• 

The alias function is often used with RootOfs to obtain a more compact notation.

  

Notes: (1) Maple allows nested RootOfs, but an alias cannot be defined in terms of another alias. (2) The function alias is an interactive tool and should not be used in a Maple procedure.

• 

If expr is an irreducible polynomial over a field F, then alpha = RootOf(expr) represents an algebraic extension field K over F of degree degreeexpr,x where elements of K are represented as polynomials in alpha.

• 

Evaluation in the context of evala uses the RootOf notation for the representation of algebraic numbers and algebraic functions.

• 

Evaluation in the context of the mod operator uses the RootOf notation for the representation of finite fields.  The elements of the finite field GFpk are represented as polynomials in RootOf(expr) where expr is an irreducible polynomial of degree k mod p, that is, an algebraic extension over the integers modp.

• 

RootOfs are not restricted to algebraic extensions. They can be used to represent the solutions of transcendental equations, for example RootOf(cos(x)=x, x).

• 

The third (optional) argument is a root selector. Selectors are meant to specify a particular root of an equation or a subset of the roots. They can also be used for working with several (not necessarily specified) roots of the same polynomial. The RootOf function supports the following selectors:

– 

A numerical approximation c; if the polynomial is univariate with rational coefficients, the c will select among all the roots of the polynomial the closest one to c. If the approximation is ambiguous, an error will be raised by evalf or convert.

– 

A bounding box defined by two complex numbers a and b. The numbers should be given in the order of the lower-left corner of the box to the upper-right corner of the box (or left and right endpoints, in the case of a real interval), otherwise, an error will be raised. Moreover, if there is no root contained in the range, an error will be raised.

– 

An index i, using the syntax index=i where i is an integer. The RootOf represents the i-th root of the equation in an order described in the help page RootOf/indexed. This option should be used only when the roots of the equation can be numbered. See RootOf/indexed.

– 

A label e, using the syntax label=e. Essentially, labels are meant to distinguish several unspecified roots of the same equation. If the root is an algebraic number, an index selector should be used instead.

• 

When a selector is present, especially when expr is a univariate polynomial with rational coefficients, the user should choose a selector specific enough to encode only one number to avoid errors in later computation such as evalf or evala.

• 

If r is a RootOf of a polynomial, the allvalues command returns a sequence of formulae (in terms of radicals) for the roots. The convert/radical command returns a formula for the root selected (the principal root if none is selected).

Examples

RootOfx2+1=0

RootOf_Z2+1

(1)

RootOfx2y,x

RootOf_Z2y

(2)

RootOfx3=12,x

RootOf2_Z31

(3)

RootOfax+b,x

ba

(4)

aliasa=RootOfz4z2+1

a

(5)

a4

a4

(6)

evalaa4

a21

(7)

evalaa6

−1

(8)

evala1a

a3+a

(9)

Find the values of all roots.

allvaluesa

I2+32,32+I2,I232,32I2

(10)

Some functions use only the principal root.

converta,radical

I2+32

(11)

evalfa

0.8660254038+0.5000000000I

(12)

Factor x4x2+1 over  and over a=z/z4z2+1.

factorx4x2+1

x4x2+1

(13)

factorx4x2+1,a

a3a+xa3axx+ax+a

(14)

Selected RootOfs:

Numerical approximation:

r1RootOfx32,x,1.26

r1RootOf_Z32,1.26

(15)

evalfr1

1.259921050

(16)

evalfRootOfx2x1,12

Error, (in `evalf/RootOf`) there are ambiguous values encoded in RootOf(_Z^2-_Z-1,1/2)

allvaluesRootOfx2x1,12

52+12,52+12

(17)

Bounding box:

r2RootOfx32,x,0.71.1I..0.61.0I

r2RootOf_Z32,−0.71.1I..−0.6I

(18)

evalfr2

−0.62996052491.091123636I

(19)

evalar1r2

RootOf_Z32,1.26RootOf_Z32,−0.71.1I..−0.6I

(20)

RootOfx2x1,2..3

Error, (in RootOf) there is no root of _Z^2-_Z-1 in 2 .. 3

Index selector:

Define an alias for the principal root.

aliasa=RootOfz3+1,index=1:

Define an alias for the real root.

aliasb=RootOfz3+1,index=2:

converta,radical

−113

(21)

convertb,radical

−1

(22)

evalfab

1.500000000+0.8660254038I

(23)

Label selector:

aliasa=RootOfz3+1,label=1:

aliasb=RootOfz3+1,label=2:

evalaab

ab

(24)

evalaa3b3

0

(25)

Functions and Nested RootOfs:

aliasβ=RootOfy3x2+1,y:

fdiffβ+β2x1,x

f2x3β2+4x3βx1β2x12

(26)

intf,x

β+β2x1

(27)

rRootOfyexpyx,y

rRootOf_Zⅇ_Zx

(28)

seriesr,x

xx2+32x383x4+12524x5+Ox6

(29)

asymptr,x

LambertWx

(30)

fRootOfcosxz,x

fRootOfcos_Zz

(31)

seriesf,z

12π+π_Z1~1−1_Z1~z161−1_Z1~3z33401−1_Z1~5z5+Oz6

(32)

r1RootOfx22

r1RootOf_Z22

(33)

r2RootOfy2r11,y

r2RootOf_Z2RootOf_Z221

(34)

convertr2,radical

1+2

(35)

aliasα=r1,β=r2:

evalar23

βα+β

(36)

evala1r2

βαβ

(37)

Compatibility

• 

The RootOf command was updated in Maple 18.

Applications

Using the RootOf Function

See Also

algnum

alias

allvalues

convert/radical

convert/RootOf

evala

initialfunctions

mod

RootOf/indexed

Roots

solve

type/RootOf