RootOfUnityQ[a]
yields True if a is a root of unity, and yields False otherwise.
RootOfUnityQ
RootOfUnityQ[a]
yields True if a is a root of unity, and yields False otherwise.
Examples
open all close allBasic Examples (1)
Scope (5)
RootOfUnityQ[(Sqrt[2 + Sqrt[2]] + I Sqrt[2 - Sqrt[2]]) / 2]Root objects:
RootOfUnityQ[Root[1 + # + # ^ 2 + # ^ 3 + # ^ 4&, 1]]AlgebraicNumber objects:
RootOfUnityQ[AlgebraicNumber[1 + I Sqrt[3], {-1, 1 / 2}]]RootOfUnityQ[Pi]RootOfUnityQ threads automatically over lists:
RootOfUnityQ[{(1 + Sqrt[3]) / 2, I}]Properties & Relations (4)
Roots of unity are solutions of
for some integer n:
a = (Sqrt[2 + Sqrt[2]] + I Sqrt[2 - Sqrt[2]]) / 2;Simplify[a ^ 16]All roots of unity are algebraic integers that lie on the unit circle:
AlgebraicIntegerQ[a]Abs[a]Not all algebraic numbers on the unit circle are roots of unity:
Abs[(1 + 2I) / Sqrt[5]]RootOfUnityQ[(1 + 2I) / Sqrt[5]]The minimal polynomial of a root of unity is a cyclotomic polynomial or one of its factor:
a = (1 + I) / Sqrt[2];RootOfUnityQ[a]MinimalPolynomial[(1 + I) / Sqrt[2], x] == Cyclotomic[8, x]Roots of cyclotomic polynomials are roots of unity:
Solve[Cyclotomic[16, x] == 0, x]RootOfUnityQ[x /. %]Use NumberFieldRootsOfUnity to find all roots of unity in a number field:
NumberFieldRootsOfUnity[I + Sqrt[2]]RootOfUnityQ[%]Possible Issues (1)
Approximate numbers will always return False:
RootOfUnityQ[Exp[I Pi / 4.]]Use RootApproximant to get an exact number:
RootApproximant[Exp[I Pi / 4.]]RootOfUnityQ[%]See Also
NumberFieldRootsOfUnity RootReduce Cyclotomic MinimalPolynomial
Function Repository: EisensteinIntegers
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), RootOfUnityQ, Wolfram Language function, https://reference.wolfram.com/language/ref/RootOfUnityQ.html.
CMS
Wolfram Language. 2007. "RootOfUnityQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RootOfUnityQ.html.
APA
Wolfram Language. (2007). RootOfUnityQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RootOfUnityQ.html
BibTeX
@misc{reference.wolfram_2026_rootofunityq, author="Wolfram Research", title="{RootOfUnityQ}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/RootOfUnityQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rootofunityq, organization={Wolfram Research}, title={RootOfUnityQ}, year={2007}, url={https://reference.wolfram.com/language/ref/RootOfUnityQ.html}, note=[Accessed: 13-June-2026]}