<s>[INST] How to factorize $X^5-1$ into irreductible factors? I have to factorize the polynomial $P(X)=X^5-1$ into irreducible factors in $\mathbb{C}$ and in $\mathbb{R}$, this factorisation happens with the $5$th roots of the unity. 
In $\mathbb{C}[X]$ we have $P(X)=\prod_{k=0}^4 (X-e^\tfrac{2ki\pi}{5})$.
In $\mathbb{R}[X]$ the solution states that by gathering all complex conjugate roots we find that $P(X)=(X-1)(X^2-2\cos(\frac{2\pi}{5})+1)(X^2-2\cos(\frac{4\pi}{5})+1)$, but I can't figure out how. Another problem I ran into was trying to figure out where the $2\cos(\frac{2\pi}{5})$ and $2\cos(\frac{4\pi}{5})$ come from so I tried these two methods:
The sum of the roots of unity is zero so we have: 
$1+e^\tfrac{2i\pi}{5}+e^\tfrac{4i\pi}{5}+e^\tfrac{6i\pi}{5}+e^\tfrac{8i\pi}{5}=0$
In the $5$th roots of unity circle P3 and P4 are images according to the x-axis the same goes to P2 and P5, therefore $e^\tfrac{6i\pi}{5}=e^\tfrac{-4i\pi}{5}$ and $e^\tfrac{8i\pi}{5}=e^\tfrac{-2i\pi}{5}$ afterwards by using Euler's formula we find $1+2\cos(\frac{2\pi}{5})+2\cos(\frac{4\pi}{5})=0$.
Another method is that $\cos(6\pi/5) = \cos(-6\pi/5) = \cos(-6\pi/5 + 2\pi) = \cos(4\pi/5)$ $\cos(8\pi/5) = \cos(-8\pi/5) = \cos(-8\pi/5 + 2\pi) = \cos(2\pi/5)$ 
therefore $1 + \cos(2\pi/5) + \cos(4\pi/5) + \cos(4\pi/5) + \cos(2\pi/5) = 0$ and we find $1+2\cos(\frac{2\pi}{5})+2\cos(\frac{4\pi}{5})=0$
I don't know if both of these methods are correct on their own and I don't know if they will help in the factorisation since I don't know how to go from there and find $P(X)=(X-1)(X^2-2\cos(\frac{2\pi}{5})+1)(X^2-2\cos(\frac{4\pi}{5})+1)$
 [/INST] There are various ways to render separate values of $\cos(2\pi/5)$ and $\cos(4\pi/5)$ given the equation
$1+2\cos(2\pi/5)+2\cos(4\pi/5)=0$
I demonstrate one approach.  Separate out the factor of $2$ from the last two terms and apply the trigonometric sum-product relations:
$0=1+2(\cos(2\pi/5)+\cos(4\pi/5))=1+4\cos(2\pi/5)\cos(6\pi/5)$
Then $\cos(6\pi/5)=\cos(4\pi/5)$ because the arguments sum to $2\pi$.  So now we have a sum and a product for $\cos(2\pi/5)$ and $\cos(4\pi/5)$:
$(\cos(2\pi/5))+(\cos(4\pi/5))=(-1/2)$
$(\cos(2\pi/5))\cdot(\cos(4\pi/5))=(-1/4)$
By Vieta's formulas for sums and products of roots these two quantities must then he roots of a quadratic equation
$4x^2+2x-1=0$
which can be solved by the usual methods, and out pop the individual cosine values you need to complete the factorization.
Incidentally, an iterated version of this technique gives radical expressions for $\cos(2\pi/p)$ for any Fermat prime $p$.  The existence of this splitting process is what guarantees the constructibility of regular Fermat-prime sided polygons (but you might need a planet bigger than Earth to distinguish a regular $65537$-gon from a circle with standard drafting equipment).
</s>