RootOf
a representation for roots of equations
Calling Sequence
Parameters
Description
Examples
Compatibility
RootOf(expr)
RootOf(expr, x)
RootOf(expr, x, c)
RootOf(expr, x, a..b)
RootOf(expr, x, index=i)
RootOf(expr, x, label=e)
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
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,p⁢prime,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 degree⁡expr,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 GF⁡pk 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 mod⁢p.
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).
RootOf⁡x2+1=0
RootOf⁡_Z2+1
RootOf⁡x2−y,x
RootOf⁡_Z2−y
RootOf⁡x3=12,x
RootOf⁡2⁢_Z3−1
RootOf⁡a⁢x+b,x
−ba
alias⁡a=RootOf⁡z4−z2+1
a
a4
evala⁡a4
a2−1
evala⁡a6
−1
evala⁡1a
−a3+a
Find the values of all roots.
allvalues⁡a
I2+32,−32+I2,−I2−32,32−I2
Some functions use only the principal root.
convert⁡a,radical
I2+32
evalf⁡a
0.8660254038+0.5000000000⁢I
Factor x4−x2+1 over ℚ and over ℚ⁡a=ℚz/z4−z2+1.
factor⁡x4−x2+1
x4−x2+1
factor⁡x4−x2+1,a
a3−a+x⁢a3−a−x⁢x+a⁢−x+a
Selected RootOfs:
Numerical approximation:
r1≔RootOf⁡x3−2,x,1.26
r1≔RootOf⁡_Z3−2,1.26
evalf⁡r1
1.259921050
evalf⁡RootOf⁡x2−x−1,12
Error, (in `evalf/RootOf`) there are ambiguous values encoded in RootOf(_Z^2-_Z-1,1/2)
allvalues⁡RootOf⁡x2−x−1,12
−52+12,52+12
Bounding box:
r2≔RootOf⁡x3−2,x,−0.7−1.1⁢I..−0.6−1.0⁢I
r2≔RootOf⁡_Z3−2,−0.7−1.1⁢I..−0.6−I
evalf⁡r2
−0.6299605249−1.091123636⁢I
evala⁡r1−r2
RootOf⁡_Z3−2,1.26−RootOf⁡_Z3−2,−0.7−1.1⁢I..−0.6−I
RootOf⁡x2−x−1,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.
alias⁡a=RootOf⁡z3+1,index=1:
Define an alias for the real root.
alias⁡b=RootOf⁡z3+1,index=2:
−113
convert⁡b,radical
evalf⁡a−b
1.500000000+0.8660254038⁢I
Label selector:
alias⁡a=RootOf⁡z3+1,label=1:
alias⁡b=RootOf⁡z3+1,label=2:
evala⁡a−b
a−b
evala⁡a3−b3
0
Functions and Nested RootOfs:
alias⁡β=RootOf⁡y3−x2+1,y:
f≔diff⁡β+β2x−1,x
f≔2⁢x3⁢β2+4⁢x3⁢β⁢x−1−β2x−12
int⁡f,x
β+β2x−1
r≔RootOf⁡y⁢exp⁡y−x,y
r≔RootOf⁡_Z⁢ⅇ_Z−x
series⁡r,x
x−x2+32⁢x3−83⁢x4+12524⁢x5+O⁡x6
asympt⁡r,x
LambertW⁡x
f≔RootOf⁡cos⁡x−z,x
f≔RootOf⁡cos⁡_Z−z
series⁡f,z
12⁢π+π⁢_Z1~−1−1_Z1~⁢z−16⁢1−1_Z1~3⁢z3−340⁢1−1_Z1~5⁢z5+O⁡z6
r1≔RootOf⁡x2−2
r1≔RootOf⁡_Z2−2
r2≔RootOf⁡y2−r1−1,y
r2≔RootOf⁡_Z2−RootOf⁡_Z2−2−1
convert⁡r2,radical
1+2
alias⁡α=r1,β=r2:
evala⁡r23
β⁢α+β
evala⁡1r2
β⁢α−β
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
Download Help Document