TITLE: Is there a usual method for finding the minimal polynomial of trigonometric values?
QUESTION [7 upvotes]: I've been thinking a bit about finding the minimal polynomials of side lengths of regular $n$-gons inscribed in the unit circle. For example, I recently wanted to find the minimal polynomial of the side length of an inscribed regular nonagon. Using the law of cosines, I was able to find that the side length is $a=\sqrt{2-2\cos(\frac{2\pi}{9})}$.
So $\displaystyle \frac{2-a^2}{2}=\cos \left(\frac{2\pi}{9} \right)$, but since I can't express $\displaystyle\cos \left(\frac{2\pi}{9} \right)$ in terms of rational numbers or their square roots, I'm unsure of how to proceed exactly. Is there a usual method to attack values like this? Possibly for say $\displaystyle \cos \left(\frac{m\pi}{n} \right)$? 
Thanks.

REPLY [5 votes]: EDIT : Following Marty Green's approach, I managed to actually find the minimal polynomial explicitly. I think both of you (Marty and Dom) will appreciate. Write 
$$
2 \cos \left( \frac{2\pi}9 \right) = \zeta_2 + \zeta_7
$$
where $\zeta_2$ and $\zeta_7$ are the second and seventh rooth of unity, respectively. Now we try to find the minimal polynomial for $\zeta_2 + \zeta_7$ (if we found it then substituting $\zeta_2 + \zeta_7 = x = 2y$ in the polynomial gives us our wished polynomial). Notice that
$$
x^9 -1 = \prod_{d \mid n} \Phi_d(x) = (x-1)(x^2+x+1)(x^6 + x^3 + 1)
$$
where $\Phi_d(x)$ is the cyclotomic polynomial of the $d^{\text{th}}$ roots of unity. Now since 
$$
\phi_9(x) = x^6 + x^3 + 1 = \prod_{(i,9)=1}(x-\zeta_i) 
$$
and developping this product to obtain the symmetric polynomials in the $\zeta_i$ as coefficients of $\phi_9(x)$, we obtain the two useful identities :
$$
\sum_{(i,9)=1} \zeta_i = 0, \quad \underset{i \neq j}{\sum_{(i,9)=(j,9)=1}} \zeta_i \zeta_j = 0.
$$
Now we also have the identity $\zeta_6 + \zeta_3 + 1 = 0$ since $\zeta_3$ is a root of $x^2 + x + 1$. Hence we have
$$
(x-(\zeta_1 + \zeta_8))(x-(\zeta_2 + \zeta_7))(x-(\zeta_4 + \zeta_5)) = 
$$
$$
x^3 - ((\zeta_1 + \zeta_8) + (\zeta_2 + \zeta_7) + (\zeta_4 + \zeta_5))x^2 + 
$$
$$
((\zeta_1 + \zeta_8)(\zeta_2 + \zeta_7) + (\zeta_1 + \zeta_8)(\zeta_4 + \zeta_5) + (\zeta_2 + \zeta_7)(\zeta_4 + \zeta_5))x 
$$
$$
 - (\zeta_1 + \zeta_8)(\zeta_2 + \zeta_7)(\zeta_4 + \zeta_5).
$$
Since the sum of the roots of $\Phi_9$ is $0$, the quadratic term vanishes. For the linear term, notice that all pairs of roots appear as products of two roots beside the ones that are together in the sum, i.e. $\zeta_1 \zeta_8$, $\zeta_2 \zeta_7$ and $\zeta_4 \zeta_5$. Hence if we call the linear term $\alpha$, 
$$
\alpha = \left( \underset{i \neq j}{\sum_{(i,9)=(j,9)=1}} \zeta_i \zeta_j \right) - \zeta_1\zeta_8 - \zeta_2 \zeta_7 - \zeta_4 \zeta_5 = 0 - \zeta_9 - \zeta_9 - \zeta_9 = -3.
$$
Now for the constant in the end, develop it manually to have something like this :
$$
 - (\zeta_1 + \zeta_8)(\zeta_2 + \zeta_7)(\zeta_4 + \zeta_5) =
$$
$$
 - (\zeta_1 \zeta_2 \zeta_4 + \zeta_1 \zeta_2 \zeta_5 + \zeta_1 \zeta_7 \zeta_4 + \zeta_1 \zeta_7 \zeta_5 + 
$$
$$
\zeta_8 \zeta_2 \zeta_4 + \zeta_8 \zeta_2 \zeta_5 + \zeta_8 \zeta_7 \zeta_4 + \zeta_8 \zeta_7 \zeta_5) = 
$$
$$
- (\zeta_7 + \zeta_8 + \zeta_3 + \zeta_4 + \zeta_5 + \zeta_6 + \zeta_1 + \zeta_2) = -(\zeta_3 + \zeta_6) = 1
$$
The last line is because the sum of the roots is $0$. Hence a polynomial for which $\zeta_2 + \zeta_7$ is a root is $x^3 - 3x + 1$. Making the variable change to get the polynomial for $\cos(2\pi / 9)$ gives us $8x^3 - 6x + 1 = 0$, which is irreducible (there are many possible answer to this irreducibility question non-rationality of the roots, rational root theorem, etc.) which I leave up to you.
P.S. I will never do that again, it's so painful... but it was fun. XD Hope you liked it.