# Root of unity

In mathematics, a root of unity, occasionally called a de Moivre number, is any complex number that gives 1 when raised to some integer power Template:Mvar. Roots of unity are used in many branches of mathematics, and are especially important in number theory, the theory of group characters, and the discrete Fourier transform.

In field theory and ring theory the notion of root of unity also applies to any ring with a multiplicative identity element. Any algebraically closed field has exactly Template:Mvar Template:Mvarth roots of unity, if Template:Mvar is not divisible by the characteristic of the field.

## General definition

An Template:Mvarth root of unity, where Template:Mvar is a positive integer (i.e. n = 1, 2, 3, …), is a number Template:Mvar satisfying the equation

$z^{n}=1.$ Traditionally, Template:Mvar is assumed to be a complex number, and subsequent sections of this article will comply with this usage. Generally, zR can be considered for any field Template:Mvar, or even for a unital ring. In this general formulation, an Template:Mvarth root of unity is just an element of the group of units of order Template:Mvar. Interesting cases are finite fields and modular arithmetics, for which the article root of unity modulo n contains some information.

An Template:Mvarth root of unity is Template:Visible anchor if it is not a Template:Mvarth root of unity for some smaller Template:Mvar:

$z^{k}\neq 1\qquad (k=1,2,3,\dots ,n-1).$ ## Elementary facts

Every Template:Mvarth root of unity Template:Mvar is a primitive Template:Mvarth root of unity for some Template:Mvar where 1 ≤ an: if z1 = 1 then Template:Mvar is a primitive first root of unity, otherwise if z2 = 1 then Template:Mvar is a primitive second (square) root of unity, otherwise, ..., and by assumption there must be a "1" at or before the Template:Mvarth term in the sequence.

If Template:Mvar is an Template:Mvarth root of unity and ab (mod n) then za = zb. By the definition of congruence, a = b + kn for some integer Template:Mvar. But then,

$z^{a}=z^{b+kn}=z^{b}z^{kn}=z^{b}(z^{n})^{k}=z^{b}1^{k}=z^{b}.$ Therefore, given a power za of Template:Mvar, it can be assumed that 1 ≤ an. This is often convenient.

Any integer power of an Template:Mvarth root of unity is also an Template:Mvarth root of unity:

$(z^{k})^{n}=z^{kn}=(z^{n})^{k}=1^{k}=1.$ Here Template:Mvar may be negative. In particular, the reciprocal of an Template:Mvarth root of unity is its complex conjugate, and is also an Template:Mvarth root of unity:

${\frac {1}{z}}=z^{-1}=z^{n-1}={\bar {z}}.$ Let Template:Mvar be a primitive Template:Mvarth root of unity. Then the powers Template:Mvar, z2, … , zn −1, zn = z0 = 1 are all distinct. Assume the contrary, that za = zb where 1 ≤ a < bn. Then zb − a = 1. But 0 < ba < n, which contradicts Template:Mvar being primitive.

Since an Template:Mvarth degree polynomial equation can only have Template:Mvar distinct roots, this implies that the powers of a primitive root Template:Mvar, z2, … , zn − 1, zn = z0 = 1 are in fact all of the Template:Mvarth roots of unity.

From the preceding facts it follows that if Template:Mvar is a primitive Template:Mvarth root of unity:

$z^{a}=z^{b}\iff a\equiv b{\pmod {n}}.$ If Template:Mvar is not primitive there is only one implication:

$a\equiv b{\pmod {n}}\implies z^{a}=z^{b}.$ An example showing that the converse implication is false is given by:

$n=4,\;\;z=-1,\;\;z^{2}=z^{4}=1,\;\;2\not \equiv 4{\pmod {4}}.$ Let Template:Mvar be a primitive Template:Mvarth root of unity and let Template:Mvar be a positive integer. From the above discussion, zk is a primitive root of unity for some Template:Mvar. Now if zka = 1, ka must be a multiple of Template:Mvar. The smallest number that is divisible by both Template:Mvar and Template:Mvar is their least common multiple, denoted by lcm(n, k). It is related to their greatest common divisor, gcd(n, k), by the formula:

$k\,n=\gcd(k,n)\,\operatorname {lcm} (k,n),$ i.e.

$\operatorname {lcm} (k,n)=k{\frac {n}{\gcd(k,n)\,}}.$ Therefore, zk is a primitive Template:Mvarth root of unity where

$a={\frac {n}{\gcd(k,n)}}.$ Thus, if Template:Mvar and Template:Mvar are coprime, zk is also a primitive Template:Mvarth root of unity, and therefore there are φ(n) (where φ is Euler's totient function) distinct primitive Template:Mvarth roots of unity. (This implies that if Template:Mvar is a prime number, all the roots except +1 are primitive).

In other words, if R(n) is the set of all Template:Mvarth roots of unity and P(n) is the set of primitive ones, R(n) is a disjoint union of the P(n):

$\operatorname {R} (n)=\bigcup _{d\,|\,n}\operatorname {P} (d),$ where the notation means that Template:Mvar goes through all the divisors of Template:Mvar, including 1 and Template:Mvar.

Since the cardinality of R(n) is Template:Mvar, and that of P(n) is φ(n), this demonstrates the classical formula

$\sum _{d\,|\,n}\phi (d)=n.$ ## Examples

De Moivre's formula, which is valid for all real Template:Mvar and integers Template:Mvar, is

$(\cos x+i\sin x)^{n}=\cos nx+i\sin nx.$ Setting x = 2π/n gives a primitive Template:Mvarth root of unity:

$\left(\cos {\tfrac {2\pi }{n}}+i\sin {\tfrac {2\pi }{n}}\right)^{n}=\cos 2\pi +i\sin 2\pi =1,$ but for k = 1, 2, ⋯ , n − 1,

$\left(\cos {\tfrac {2\pi }{n}}+i\sin {\tfrac {2\pi }{n}}\right)^{k}=\cos {\tfrac {2k\pi }{n}}+i\sin {\tfrac {2k\pi }{n}}\neq 1$ This formula shows that on the complex plane the Template:Mvarth roots of unity are at the vertices of a [[regular polygon|regular Template:Mvar-sided polygon]] inscribed in the unit circle, with one vertex at 1. (See the plots for n = 3 and n = 5 on the right.) This geometric fact accounts for the term "cyclotomic" in such phrases as cyclotomic field and cyclotomic polynomial; it is from the Greek roots "cyclo" (circle) plus "tomos" (cut, divide).

$e^{ix}=\cos x+i\sin x,$ which is valid for all real Template:Mvar, can be used to put the formula for the Template:Mvarth roots of unity into the form

$e^{2\pi i{\frac {k}{n}}}\qquad 0\leq k It follows from the discussion in the previous section that this is a primitive Template:Mvarth-root if and only if the fraction k/n is in lowest terms, i.e. that Template:Mvar and Template:Mvar are coprime.

The roots of unity are, by definition, the roots of a polynomial equation and are thus algebraic numbers. In fact, Galois theory can be used to show that they may be expressed as expressions involving integers and the operations of addition, subtraction, multiplication, division, and the extraction of roots. (There are more details later in this article at Cyclotomic fields.)

The equation z1 = 1 obviously has only one solution, +1, which is therefore the only primitive first root of unity. It is a nonprimitive 2nd, 3rd, 4th, ... root of unity.

The equation z2 = 1 has two solutions, +1 and −1. +1 is the primitive first root of unity, leaving −1 as the only primitive second (square) root of unity. It is a nonprimitive 4th, 6th, 8th, ...root of unity.

The only real roots of unity are ±1; all the others are non-real complex numbers, as can be seen from de Moivre's formula or the figures.

The third (cube) roots satisfy the equation z3 − 1 = 0; the non-principal root +1 may be factored out, giving (z − 1)(z2 + z + 1) = 0. Therefore, the primitive cube roots of unity are the roots of a quadratic equation. (See Cyclotomic polynomial, below.)

$\left\{e^{\frac {2\pi i}{3}},e^{-{\frac {2\pi i}{3}}}\right\}=\left\{{\frac {-1+i{\sqrt {3}}}{2}},{\frac {-1-i{\sqrt {3}}}{2}}\right\}$ The two primitive fourth roots of unity are the two square roots of the primitive square root of unity, −1

$\left\{e^{\frac {2\pi i}{4}},e^{-{\frac {2\pi i}{4}}}\right\}=\left\{\pm {\sqrt {-1}}\right\}=\left\{+i,-i\right\}.$ The four primitive fifth roots of unity are

$\left\{\left.e^{\frac {2\pi ik}{5}}\right|1\leq k\leq 4\right\}=\left\{\left.{\frac {u{\sqrt {5}}-1}{4}}+v\,i\,{\sqrt {\frac {5+u{\sqrt {5}}}{8}}}\;\right|u,v\in \{-1,1\}\right\}.$ The two primitive sixth roots of unity are the negatives (and also the square roots) of the two primitive cube roots:

$\left\{e^{\frac {2\pi i}{6}},e^{-{\frac {2\pi i}{6}}}\right\}=\left\{{\frac {1+i{\sqrt {3}}}{2}},{\frac {1-i{\sqrt {3}}}{2}}\right\}.$ Gauss observed that if a primitive Template:Mvarth root of unity can be expressed using only square roots, then it is possible to construct the regular Template:Mvar-gon using only ruler and compass, and that if the root of unity requires third or fourth or higher radicals the regular polygon cannot be constructed. The 7th roots of unity are the first that require cube roots. Note that the real part and imaginary part are both real numbers, but complex numbers are buried in the expressions. They cannot be removed. See casus irreducibilis for details.

One of the primitive seventh roots of unity is{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }} $e^{\frac {2\pi i}{7}}={\frac {-1+{\sqrt[{3}]{\frac {7+21{\sqrt {-3}}}{2}}}+{\sqrt[{3}]{\frac {7-21{\sqrt {-3}}}{2}}}}{6}}+{\frac {i}{2}}{\sqrt {\frac {7-\omega ^{2}{\sqrt[{3}]{\frac {7+21{\sqrt {-3}}}{2}}}-\omega {\sqrt[{3}]{\frac {7-21{\sqrt {-3}}}{2}}}}{3}}}$ where Template:Mvar and ω2 are the primitive cube roots of unity exp(2πi/3) and exp(4πi/3). The four primitive eighth roots of unity are ± the square roots of the primitive fourth roots, ±i. One of them is: $e^{\frac {2\pi i}{8}}={\sqrt {i}}={\frac {\sqrt {2}}{2}}+i{\frac {\sqrt {2}}{2}}.$ See heptadecagon for the real part of a 17th root of unity. ## Periodicity If Template:Mvar is a primitive Template:Mvarth root of unity, then the sequence of powers … , z−1, z0, z1, … is Template:Mvar-periodic (because z j + n = z jz n = z j⋅1 = z j for all values of Template:Mvar), and the Template:Mvar sequences of powers sk: … , z k⋅(−1), z k⋅0, z k⋅1, … for k = 1, … , n are all Template:Mvar-periodic (because z k⋅(j + n) = z kj). Furthermore, the set {s1, … , sn} of these sequences is a basis of the linear space of all Template:Mvar-periodic sequences. This means that any Template:Mvar-periodic sequence of complex numbers … , x−1 , x0 , x1, … can be expressed as a linear combination of powers of a primitive Template:Mvarth root of unity: $x_{j}=\sum _{k}X_{k}\cdot z^{k\cdot j}=X_{1}z^{1\cdot j}+\cdots +X_{n}\cdot z^{n\cdot j}$ for some complex numbers X1, … , Xn and every integer Template:Mvar. This is a form of Fourier analysis. If Template:Mvar is a (discrete) time variable, then Template:Mvar is a frequency and Xk is a complex amplitude. Choosing for the primitive Template:Mvarth root of unity z = e2πi/n = cos(2π/n) + i⋅sin(2π/n) allows xj to be expressed as a linear combination of cos and sin: xj = ∑k Ak⋅cos(2π⋅jk/n) + ∑k Bk⋅sin(2π⋅jk/n). This is a discrete Fourier transform. ## Summation Let SR(n) be the sum of all the Template:Mvarth roots of unity, primitive or not. Then $\operatorname {SR} (n)={\begin{cases}1,&n=1\\0,&n>1.\end{cases}}$ For n = 1 there is nothing to prove. For n > 1, it is "intuitively obvious" from the symmetry of the roots in the complex plane. For a rigorous proof, let Template:Mvar be a primitive Template:Mvarth root of unity. Then the set of all roots is given by zk, k = 0, 1, … , n − 1, and their sum is given by the formula for a geometric series: $\sum _{k=0}^{n-1}z^{k}={\frac {z^{n}-1}{z-1}}=0.$ Let SP(n) be the sum of all the primitive Template:Mvarth roots of unity. Then $\operatorname {SP} (n)=\mu (n),$ where μ(n) is the Möbius function. In the section Elementary facts, it was shown that if R(n) is the set of all Template:Mvarth roots of unity and P(n) is the set of primitive ones, R(n) is a disjoint union of the P(n): $\operatorname {R} (n)=\bigcup _{d\,|\,n}\operatorname {P} (d),$ This implies $\operatorname {SR} (n)=\sum _{d\,|\,n}\operatorname {SP} (d).$ Applying the Möbius inversion formula gives $\operatorname {SP} (n)=\sum _{d\,|\,n}\mu (d)\operatorname {SR} \left({\frac {n}{d}}\right).$ In this formula, if d < n, then SR(n/d) = 0, and for d = n: SR(n/d) = 1. Therefore, SP(n) = μ(n). This is the special case cn(1) of Ramanujan's sum cn(s), defined as the sum of the Template:Mvarth powers of the primitive Template:Mvarth roots of unity: $c_{n}(s)=\sum _{a=1 \atop \gcd(a,n)=1}^{n}e^{2\pi i{\tfrac {a}{n}}s}.$ ## Orthogonality From the summation formula follows an orthogonality relationship: for j = 1, … , n and j′ = 1, … , n $\sum _{k=1}^{n}{\overline {z^{j\cdot k}}}\cdot z^{j'\cdot k}=n\cdot \delta _{j,j'}$ where Template:Mvar is the Kronecker delta and Template:Mvar is any primitive Template:Mvarth root of unity. The n × n matrix Template:Mvar whose (j, k)th entry is $U_{j,k}=n^{-{\frac {1}{2}}}\cdot z^{j\cdot k}$ defines a discrete Fourier transform. Computing the inverse transformation using gaussian elimination requires O(n3) operations. However, it follows from the orthogonality that Template:Mvar is unitary. That is, $\sum _{k=1}^{n}{\overline {U_{j,k}}}\cdot U_{k,j'}=\delta _{j,j'},$ and thus the inverse of Template:Mvar is simply the complex conjugate. (This fact was first noted by Gauss when solving the problem of trigonometric interpolation). The straightforward application of Template:Mvar or its inverse to a given vector requires O(n2) operations. The fast Fourier transform algorithms reduces the number of operations further to O(n log n). ## Cyclotomic polynomials {{#invoke:main|main}} The zeroes of the polynomial $p(z)=z^{n}-1$ are precisely the Template:Mvarth roots of unity, each with multiplicity 1. The Template:Mvarth cyclotomic polynomial is defined by the fact that its zeros are precisely the primitive Template:Mvarth roots of unity, each with multiplicity 1. $\Phi _{n}(z)=\prod _{k=1}^{\varphi (n)}(z-z_{k})$ where z1, z2, z3, … ,zφ(n) are the primitive Template:Mvarth roots of unity, and φ(n) is Euler's totient function. The polynomial Φn(z) has integer coefficients and is an irreducible polynomial over the rational numbers (i.e., it cannot be written as the product of two positive-degree polynomials with rational coefficients). The case of prime Template:Mvar, which is easier than the general assertion, follows by applying Eisenstein's criterion to the polynomial ${\frac {(z+1)^{n}-1}{((z+1)-1)}},$ and expanding via the binomial theorem. Every Template:Mvarth root of unity is a primitive Template:Mvarth root of unity for exactly one positive divisor Template:Mvar of Template:Mvar. This implies that $z^{n}-1=\prod _{d\,\mid \,n}\Phi _{d}(z).$ This formula represents the factorization of the polynomial zn − 1 into irreducible factors. z1 − 1 = z − 1 z2 − 1 = (z − 1)⋅(z + 1) z3 − 1 = (z − 1)⋅(z2 + z + 1) z4 − 1 = (z − 1)⋅(z + 1)⋅(z2 + 1) z5 − 1 = (z − 1)⋅(z4 + z3 + z2 + z + 1) z6 − 1 = (z − 1)⋅(z + 1)⋅(z2 + z + 1)⋅(z2z + 1) z7 − 1 = (z − 1)⋅(z6 + z5 + z4 + z3 + z2 +z + 1) Applying Möbius inversion to the formula gives $\Phi _{n}(z)=\prod _{d\,\mid n}(z^{n/d}-1)^{\mu (d)}=\prod _{d\,\mid n}(z^{d}-1)^{\mu (n/d)},$ where μ is the Möbius function. So the first few cyclotomic polynomials are Φ1(z) = z − 1 Φ2(z) = (z2 − 1)⋅(z − 1)−1 = z + 1 Φ3(z) = (z3 − 1)⋅(z − 1)−1 = z2 + z + 1 Φ4(z) = (z4 − 1)⋅(z2 − 1)−1 = z2 + 1 Φ5(z) = (z5 − 1)⋅(z − 1)−1 = z4 + z3 + z2 + z + 1 Φ6(z) = (z6 − 1)⋅(z3 − 1)−1⋅(z2 − 1)−1⋅(z − 1) = z2z + 1 Φ7(z) = (z7 − 1)⋅(z − 1)−1 = z6 + z5 + z4 + z3 + z2 +z + 1. If Template:Mvar is a prime number, then all the Template:Mvarth roots of unity except 1 are primitive Template:Mvarth roots, and we have $\Phi _{p}(z)={\frac {z^{p}-1}{z-1}}=\sum _{k=0}^{p-1}z^{k}.$ Substituting any positive integer ≥ 2 for Template:Mvar, this sum becomes a [[radix|base Template:Mvar]] repunit. Thus a necessary (but not sufficient) condition for a repunit to be prime is that its length be prime. Note that, contrary to first appearances, not all coefficients of all cyclotomic polynomials are 0, 1, or −1. The first exception is Φ105. It is not a surprise it takes this long to get an example, because the behavior of the coefficients depends not so much on Template:Mvar as on how many odd prime factors appear in Template:Mvar. More precisely, it can be shown that if Template:Mvar has 1 or 2 odd prime factors (e.g., n = 150) then the Template:Mvarth cyclotomic polynomial only has coefficients 0, 1 or −1. Thus the first conceivable Template:Mvar for which there could be a coefficient besides 0, 1, or −1 is a product of the three smallest odd primes, and that is 3⋅5⋅7 = 105. This by itself doesn't prove the 105th polynomial has another coefficient, but does show it is the first one which even has a chance of working (and then a computation of the coefficients shows it does). A theorem of Schur says that there are cyclotomic polynomials with coefficients arbitrarily large in absolute value. In particular, if n = p1p2⋅ ⋯ ⋅pt, where p1 < p2 < ⋯ < pt are odd primes, p1 + p2 > pt, and t is odd, then 1 − t occurs as a coefficient in the Template:Mvarth cyclotomic polynomial. Many restrictions are known about the values that cyclotomic polynomials can assume at integer values. For example, if Template:Mvar is prime and d ∣ Φp(d), then either d ≡ 1 (mod p), or d ≡ 0 (mod p). Cyclotomic polynomials are solvable in radicals, as roots of unity are themselves radicals. Moreover, there exist more informative radical expressions for Template:Mvarth roots of unity with the additional property that every value of the expression obtained by choosing values of the radicals (for example, signs of square roots) is a primitive Template:Mvarth root of unity. This was already shown by Gauss in 1797. Efficient algorithms exist for calculating such expressions. ## Cyclic groups The Template:Mvarth roots of unity form under multiplication a cyclic group of order Template:Mvar, and in fact these groups comprise all of the finite subgroups of the multiplicative group of the complex number field. A generator for this cyclic group is a primitive Template:Mvarth root of unity. The Template:Mvarth roots of unity form an irreducible representation of any cyclic group of order Template:Mvar. The orthogonality relationship also follows from group-theoretic principles as described in character group. The roots of unity appear as entries of the eigenvectors of any circulant matrix, i.e. matrices that are invariant under cyclic shifts, a fact that also follows from group representation theory as a variant of Bloch's theorem. In particular, if a circulant Hermitian matrix is considered (for example, a discretized one-dimensional Laplacian with periodic boundaries), the orthogonality property immediately follows from the usual orthogonality of eigenvectors of Hermitian matrices. ## Cyclotomic fields {{#invoke:main|main}} By adjoining a primitive Template:Mvarth root of unity to Q, one obtains the Template:Mvarth cyclotomic field Q(exp(2πi/n)). This field contains all Template:Mvarth roots of unity and is the splitting field of the Template:Mvarth cyclotomic polynomial over Q. The field extension Q(exp(2πi/n))/Q has degree φ(n) and its Galois group is naturally isomorphic to the multiplicative group of units of the ring Z/nZ. As the Galois group of Q(exp(2πi/n))/Q is abelian, this is an abelian extension. Every subfield of a cyclotomic field is an abelian extension of the rationals. It follows that every nth root of unity may be expressed in term of k-roots, with various k not exceeding φ(n). In these cases Galois theory can be written out explicitly in terms of Gaussian periods: this theory from the Disquisitiones Arithmeticae of Gauss was published many years before Galois. Conversely, every abelian extension of the rationals is such a subfield of a cyclotomic field – this is the content of a theorem of Kronecker, usually called the Kronecker–Weber theorem on the grounds that Weber completed the proof. ## Relation to integer rings For n = 2, both roots of unity 1 and −1 belong to Z. For certain Template:Mvar corresponding roots of unity are quadratic integers: For n = 5, 10, neither of non-real roots of unity (which satisfy a quartic equation) is a quadratic integer, but the sum z + Template:Overline = 2 Rez of each root with its complex conjugate (also a 5th root of unity) is an element of the ring [[quadratic integer|Z[{{ safesubst:#invoke:Unsubst||$B=/2}}]]] (D = 5). For two pairs of non-real 5th roots of unity these sums are inverse golden ratio and minus golden ratio.

For n = 8, for any root: equals to either ±2, 0, or ±[[square root of 2|Template:Sqrt]] (D = 2).