Minimal polynomial of 2cos(2pi/n)

In number theory, the real parts of the roots of unity are related to one-another by means of the minimal polynomial of $$2\cos(2\pi/n).$$ The roots of the minimal polynomial are twice the real part of the roots of unity, where the real part of a root of unity is just $$\cos\left(2k\pi/n\right)$$ with $$k$$ coprime with $$n.$$

Formal definition
For an integer $$n \geq 1$$, the minimal polynomial $$\Psi_n(x)$$ of $$2\cos(2\pi/n)$$ is the non-zero monic polynomial of smallest degree for which $$\Psi_n\!\left(2\cos(2\pi/n)\right) = 0$$.

For every $n$, the polynomial $$\Psi_n(x)$$ is monic, has integer coefficients, and is irreducible over the integers and the rational numbers. All its roots are real; they are the real numbers $$2\cos\left(2k\pi/n\right)$$ with $$k$$ coprime with $$n$$ and either $$1 \le k < n$$ or $$k=n=1.$$ These roots are twice the real parts of the primitive $n$th roots of unity. The number of integers $$k$$ relatively prime to $$n$$ is given by Euler's totient function $$\varphi(n);$$ it follows that the degree of $$\Psi_n(x)$$ is $$1$$ for $$n=1,2$$ and $$\varphi(n)/2$$ for $$n\geq 3.$$

The first two polynomials are $$\Psi_1(x) = x - 2$$ and $$\Psi_2(x) = x + 2.$$

The polynomials $$\Psi_n(x)$$ are typical examples of irreducible polynomials whose roots are all real and which have a cyclic Galois group.

Examples
The first few polynomials $$\Psi_n(x)$$ are


 * $$ \begin{align}

\Psi_1(x) &= x - 2 \\ \Psi_2(x) &= x + 2 \\ \Psi_3(x) &= x + 1 \\ \Psi_4(x) &= x \\ \Psi_5(x) &= x^2 + x - 1 \\ \Psi_6(x) &= x - 1 \\ \Psi_7(x) &= x^3 + x^2 - 2x - 1 \\ \Psi_8(x) &= x^2 - 2 \\ \Psi_9(x) &= x^3 - 3x + 1 \\ \Psi_{10}(x) &= x^2 - x - 1 \\ \Psi_{11}(x) &= x^5 + x^4 - 4x^3 - 3x^2 +3x + 1 \\ \Psi_{12}(x) &= x^2 - 3\\ \Psi_{13}(x) &= x^6 + x^5 - 5 x^4 - 4 x^3 + 6 x^2 + 3 x - 1\\ \Psi_{14}(x) &= x^3 - x^2 - 2 x + 1 \\ \Psi_{15}(x) &= x^4 - x^3 - 4 x^2 + 4 x + 1 \\ \Psi_{16}(x) &= x^4 - 4 x^2 + 2 \\ \Psi_{17}(x) &= x^8 + x^7 - 7 x^6 - 6 x^5 + 15 x^4 + 10 x^3 - 10 x^2 - 4 x + 1 \\ \Psi_{18}(x) &= x^3 - 3 x - 1 \\ \Psi_{19}(x) &= x^9 + x^8 - 8 x^7 - 7 x^6 + 21 x^5 + 15 x^4 - 20 x^3 - 10 x^2 + 5 x + 1 \\ \Psi_{20}(x) &= x^4 - 5 x^2 + 5 \end{align}$$

Explicit form if n is odd
If $$n$$ is an odd prime, the polynomial $$\Psi_{n}(x)$$ can be written in terms of binomial coefficients following a "zigzag path" through Pascal's triangle:

Putting $$n=2m+1$$ and
 * $$\begin{align}

\chi_{n}(x):&= \binom {m}{0}x^{m}+\binom {m-1}{0}x^{m-1}-\binom {m-1}{1}x^{m-2}-\binom {m-2}{1}x^{m-3}+\binom {m-2}{2}x^{m-4}+\binom {m-3}{2}x^{m-5}--++\cdots\\ &= \sum_{k=0}^m (-1)^{\lfloor k/2\rfloor}\binom {m-\lfloor (k+1)/2\rfloor}{\lfloor k/2\rfloor} x^{m-k}\\ &= \binom {m}{m}x^{m}+\binom {m-1}{m-1}x^{m-1}-\binom {m-1}{m-2}x^{m-2}-\binom {m-2}{m-3}x^{m-3}+\binom {m-2}{m-4}x^{m-4}+\binom {m-3}{m-5}x^{m-5}--++\cdots\\ &= \sum_{k=0}^m (-1)^{\lfloor (m-k)/2\rfloor}\binom {\lfloor (m+k)/2\rfloor}{k} x^{k}, \end{align}$$ then we have $$\Psi_{p}(x)=\chi_{p}(x)$$ for primes $$p$$.

If $$n$$ is odd but not a prime, the same polynomial $$\chi_{n}(x)$$, as can be expected, is reducible and, corresponding to the structure of the cyclotomic polynomials $$\Phi_{d}(x)$$ reflected by the formula $$\prod_{d\mid n}\Phi_d(x) = x^n - 1$$, turns out to be just the product of all $$\Psi_{d}(x)$$ for the divisors $$d>1$$ of $$n$$, including $$n$$ itself:


 * $$\prod _{d\mid n\atop d>1}\Psi_{d}( x)=\chi_{n}( x).$$

This means that the $$\Psi_{d}(x)$$ are exactly the irreducible factors of $$\chi_{n}(x)$$, which allows to easily obtain $$\Psi_{d}(x)$$ for any odd $$d$$, knowing its degree $$\frac{1}{2}\varphi(d)$$. For example,
 * $$\begin{align}

\chi_{15}( x)&= x^7 + x^6 - 6x^5 - 5x^4 + 10x^3 + 6x^2 - 4x - 1\\ &=                      (x + 1)(x^2 + x - 1)(x^4 - x^3 - 4x^2 + 4x + 1)\\ &=\Psi_{3}(x)\cdot\Psi_{5}(x)\cdot\Psi_{15}(x). \end{align}$$

Explicit form if n is even
From the below formula in terms of Chebyshev polynomials and the product formula for odd $$n$$ above, we can derive for even $$n$$


 * $$\prod _{d\mid n\atop d>1}\Psi_{d}( x)= \Big(\chi_{n+1}(x)+\chi_{n-1}(x)\Big).$$

Independently of this, if $$n=2^k$$ is an even prime power, we have for $$k\ge 2$$ the recursion (see )
 * $$\Psi_{2^{k+1}}( x)=(\Psi_{2^k}( x))^2-2$$,

starting with $$\Psi_{4}( x)=x$$.

Roots
The roots of $$\Psi_n(x)$$ are given by $$2\cos\left(\frac{2\pi k}{n}\right)$$, where $$1 \leq k < \frac{n}{2}$$ and $$\gcd(k, n) = 1$$. Since $$\Psi_n(x)$$ is monic, we have


 * $$\Psi_n(x) = \displaystyle\prod_{\begin{array}{c} 1 \leq k < \frac{n}{2}\\ \gcd(k, n) = 1 \end{array} } \left(x - 2\cos\left(\frac{2\pi k}{n}\right)\right).$$

Combining this result with the fact that the function $$\cos(x)$$ is even, we find that $$2\cos\left(\frac{2\pi k}{n}\right)$$ is an algebraic integer for any positive integer $$n$$ and any integer $$k$$.

Relation to the cyclotomic polynomials
For a positive integer $$n$$, let $$\zeta_n = \exp\left(\frac{2\pi i}{n}\right) = \cos\left(\frac{2\pi}{n}\right) + \sin\left(\frac{2\pi}{n}\right)i$$, a primitive $$n$$-th root of unity. Then the minimal polynomial of $$\zeta_n$$ is given by the $$n$$-th cyclotomic polynomial $$\Phi_n(x)$$. Since $$\zeta_n^{-1} = \cos\left(\frac{2\pi}{n}\right) - \sin\left(\frac{2\pi}{n}\right)i$$, the relation between $$2\cos\left(\frac{2\pi}{n}\right)$$ and $$\zeta_n$$ is given by $$2\cos\left(\frac{2\pi}{n}\right) = \zeta_n + \zeta_n^{-1}$$. This relation can be exhibited in the following identity proved by Lehmer, which holds for any non-zero complex number $$z$$:


 * $$\Psi_n\left(z + z^{-1}\right) = z^{-\frac{\varphi(n)}{2}}\Phi_n(z)$$

Relation to Chebyshev polynomials
In 1993, Watkins and Zeitlin established the following relation between $$\Psi_n(x)$$ and Chebyshev polynomials of the first kind.

If $$n = 2s + 1$$ is odd, then


 * $$\prod_{d \mid n}\Psi_d(2x) = 2(T_{s + 1}(x) - T_s(x)),$$

and if $$n = 2s$$ is even, then


 * $$\prod_{d \mid n}\Psi_d(2x) = 2(T_{s + 1}(x) - T_{s - 1}(x)).$$

If $$n $$ is a power of $$2$$, we have moreover directly


 * $$ \Psi_{2^{k+1}}(2x) = 2T_{2^{k-1}}(x) .$$

Absolute value of the constant coefficient
The absolute value of the constant coefficient of $$\Psi_n(x)$$ can be determined as follows:


 * $$|\Psi_n(0)| = \begin{cases}0 & \text{if}\ n = 4,\\2 & \text{if}\ n = 2^k, k \geq 0, k \neq 2,\\ p & \text{if}\ n = 4p^k, k \geq 1, p > 2\ \text{prime,}\\1 & \text{otherwise.}\end{cases}$$

Generated algebraic number field
The algebraic number field $$K_n = \mathbb{Q}\left(\zeta_n + \zeta_n^{-1}\right)$$ is the maximal real subfield of a cyclotomic field $$\mathbb Q(\zeta_n)$$. If $$\mathcal O_{K_n}$$ denotes the ring of integers of $$K_n$$, then $$\mathcal O_{K_n} = \mathbb Z\left[\zeta_n + \zeta_n^{-1}\right]$$. In other words, the set $$\left\{1, \zeta_n + \zeta_n^{-1}, \ldots, \left(\zeta_n + \zeta_n^{-1}\right)^{\frac{\varphi(n)}{2} - 1}\right\}$$ is an integral basis of $$\mathcal O_{K_n}$$. In view of this, the discriminant of the algebraic number field $$K_n$$ is equal to the discriminant of the polynomial $$\Psi_n(x)$$, that is
 * $$D_{K_n} = \begin{cases}2^{(m - 1)2^{m - 2} - 1} & \text{if}\ n = 2^m, m > 2,\\p^{(mp^m - (m + 1)p^{m - 1} - 1)/2} & \text{if}\ n = p^m\ \text{or}\ 2p^m, p > 2\ \text{prime},\\ \left(\prod_{i = 1}^{\omega(n)}p_i^{e_i - 1/(p_i - 1)}\right)^{\frac{\varphi(n)}{2}} & \text{if}\ \omega(n) > 1, k \neq 2p^m.\end{cases}$$