TITLE: Minimal polynomial of cos(π/n)
QUESTION [25 upvotes]: I know that $\cos(\pi/n)$ is a root of the Chebyshev polynomial $(T_n + 1)$, in fact it is the largest root of that polynomial, but often that polynomial factors. For example, if $n = 2 k$ then $\cos(\pi/n)$ is the largest root of $T_k$, which is a polynomial of lower degree, and if $n = 3$ then $\cos(\pi/n)$ is a root of $2 x - 1$, again lower degree than $T_3 + 1$.
How can I compute, for a given $n$, a polynomial in $\mathbb{Q}[x]$ of minimal degree that $\cos(\pi/n)$ is a root of?

REPLY [3 votes]: There is a Wikipedia entry dedicated to this, which contains an alternative method to compute the minimal polynomial of $2\cos(\pi/n)$, which is essentially the same as for $\cos(π/n)$. In fact, denoting the minimal polynomial of $2\cos(π/n)$ by $\Psi_n(x)$, we have by the quoted AMM article in Vladimir Dotsenko's answer  for odd $n=2k+1$ $$\prod_{d \mid n}\Psi_d(x) = 2\Big(T_{k + 1}(\frac x2) - T_k(\frac x2)\Big)$$ and for even $n=2k$ $$\prod_{d \mid n}\Psi_d(x) = 2\Big(T_{k + 1}(\frac x2) - T_{k-1}(\frac x2)\Big).$$
But there is in fact no need to calculate the Chebyshev polynomials. Defining for odd $n=2k+1$
$$\chi_{n}(x):= \sum_{k=0}^m (-1)^{\lfloor k/2\rfloor}\binom {m-\lfloor (k+1)/2\rfloor}{\lfloor k/2\rfloor} x^{m-k},$$ we have directly
$$\prod _{d\mid n}\Psi_{d}( x)=(x-2)\chi_{n}(x),$$ noting that $\Psi_{1}( x)=x-2$.
For even $n=2k$, we just need to sum up two of those polynomials: $$\prod _{d\mid n}\Psi_{d}( x)=(x-2)\Big(\chi_{n+1}(x)+\chi_{n-1}(x)\Big).$$