evala/RealPart
real part of an algebraic number
evala/ImaginaryPart
imaginary part of an algebraic number
Calling Sequence
Parameters
Description
Examples
Compatibility
evala(RealPart(RootOf(p, x))
evala(ImaginaryPart(RootOf(p, x))
evala(RealPart(RootOf(p, x, c))
evala(ImaginaryPart(RootOf(p, x, c))
evala(RealPart(RootOf(p, x, a..b))
evala(ImaginaryPart(RootOf(p, x, a..b))
evala(RealPart(RootOf(p, x, index=i))
evala(ImaginaryPart(RootOf(p, x, index=i))
p
-
polynomial in x with rational or complex rational coefficients
x
variable (default: _Z)
c
complex(numeric) approximation to the root
a,b
complex(numeric) interval bounds for the root
i
posint; root selector, between 1 and the degree of p; see RootOf
The RealPart and ImaginaryPart functions are placeholders for representing the real or imaginary parts, respectively, of an algebraic number given in RootOf notation. It is used in conjunction with evala.
The call evala(RealPart(RootOf(p))) computes RootOf⁡q, where q is a squarefree polynomial with rational coefficients of smallest possible degree whose roots include the real parts of all the roots of p. Note that in general q will have additional (real or complex) roots that do not correspond to real parts of roots of p.
The call evala(ImaginaryPart(RootOf(p))) works analogously.
The other calling sequences return a RootOf expression or a rational number encoding the real/imaginary part of the given RootOf. Usually, the 1st operand of the RootOf will be an irreducible polynomial, and the 2nd operand (selector) will be of the same type as the selector of the input.
evala⁡RealPart⁡RootOf⁡x4+x2+1
RootOf⁡4⁢_Z2−1
evala⁡ImaginaryPart⁡RootOf⁡x4+x2+1
RootOf⁡4⁢_Z2−3
f≔RootOf⁡x4+x2+1,index=1:
re,im≔evala⁡RealPart⁡f,evala⁡ImaginaryPart⁡f
re,im≔12,RootOf⁡4⁢_Z2−3,index=real2
evala⁡Normal⁡re+I⁢im−f
0
g≔RootOf⁡x4+x2+1,−1−I..0:
evalf⁡g
−0.5000000000−0.8660254038⁢I
re,im≔evala⁡RealPart⁡g,evala⁡ImaginaryPart⁡g
re,im≔−12,RootOf⁡4⁢_Z2−3,−1..0
evalf⁡re,evalf⁡im
−0.5000000000,−0.8660254038
evala⁡RealPart⁡RootOf⁡x10+1=RootOf⁡expand⁡ChebyshevT⁡5,x
RootOf⁡16⁢_Z5−20⁢_Z3+5⁢_Z=RootOf⁡16⁢_Z5−20⁢_Z3+5⁢_Z
The input may have complex rational coefficients.
f≔RootOf⁡x3−I:
evala⁡RealPart⁡f,evala⁡ImaginaryPart⁡f
RootOf⁡4⁢_Z3−3⁢_Z,RootOf⁡2⁢_Z2+_Z−1
g≔RootOf⁡x3−I,0..1+I:
evala⁡RealPart⁡g,evala⁡ImaginaryPart⁡g
RootOf⁡4⁢_Z2−3,0..1,12
For the first two calling sequences, the result in general has more roots than just the real or imaginary parts, some of them even real.
p≔x4+x−1
fsolve⁡p,complex
−1.220744085,0.2481260628−1.033982061⁢I,0.2481260628+1.033982061⁢I,0.7244919590
r≔evala⁡RealPart⁡RootOf⁡p
r≔RootOf⁡64⁢_Z10+64⁢_Z7−48⁢_Z6−_Z4+16⁢_Z3−16⁢_Z2−_Z+1
fsolve⁡op⁡r
−1.220744085,−0.2481260628,0.2481260628,0.7244919590
In this example, the polynomial p has real roots, and therefore appears as a factor in the polynomial q defining the resulting RootOf.
factor⁡op⁡r
_Z4+_Z−1⁢64⁢_Z6+16⁢_Z2−1
forito4dor≔evala⁡RealPart⁡RootOf⁡p,index=i;print⁡r,evalf⁡renddo:
RootOf⁡_Z4+_Z−1,index=real2,0.7244919590
RootOf⁡64⁢_Z6+16⁢_Z2−1,index=real2,0.2481260628
RootOf⁡_Z4+_Z−1,index=real1,−1.220744085
For an irreducible polynomial with all roots real, RealPart returns the input RootOf.
p≔x4−3⁢x2+1
fsolve⁡p
−1.618033989,−0.6180339887,0.6180339887,1.618033989
evala⁡RealPart⁡RootOf⁡p,evala⁡ImaginaryPart⁡RootOf⁡p
RootOf⁡_Z4−3⁢_Z2+1,0
The evala/RealPart and evala/ImaginaryPart commands were introduced in Maple 2025.
For more information on Maple 2025 changes, see Updates in Maple 2025.
See Also
evala
evala/Minpoly
evalc
Im
Re
RootOf
Download Help Document