<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] A way to obtain an explicit factorisation using Chebyshev polynomials:
Using the recurrence relation:
$$P_{n+1}(t)=2tP_n(t)-P_{n-1}(t),\qquad P_0(t)=1,\;P_1(t)=t,$$
we readily obtain 
$$P_5(t)=2t\, P_4(t)-P_3(t)=16t^5-20t^3+5t,$$
so that, for $t=\cos\frac\pi{10}$, we obtain the equation
$$\cos5\Bigl(\frac{\pi}{10}\Bigr)=0=16t^5-20t^3+5t,$$
and as $\cos\frac{\pi}{10}>0$, it is a root of the biquadratic equation $\;16t^4-20t^2+5=0$. So $\cos^2\frac\pi{10}$ is a root of the quadratic equation
$$ f(u)=16u^2 -20 u+5=0. $$
To determine which root it is, we need to find a number which separates the roots $u_1$ and $u_2$. 
Now $\;\cos^2\dfrac\pi 6=\dfrac34 <\cos^2\dfrac\pi{10}$, and it happens that $
f(3/4)=-1<0$, so $u_1<\dfrac 34<u_2$, and finally the standard formulæ for the solutions of a quadratic equation yield
$$\cos^2\frac\pi{10}=u_2=\frac{5+\sqrt 5}8\quad\text{whence }\;\cos\frac\pi5=2\cos^2\frac\pi{10}-1=\frac{1+\sqrt 5}4$$
Last step, with the same duplication formula
\begin{align}
\cos\frac{2\pi}5&=2\biggl(\frac{1+\sqrt 5}4\biggr)^2-1=\frac{-1+\sqrt 5}4 \\
\cos\frac{4\pi}5&=2\biggl(\frac{-1+\sqrt 5}4\biggr)^2-1=\frac{-1-\sqrt 5}4,  
\end{align}
we obtain the factorisation:
$$X^5-1=(X-1)\Bigl(X^2+\frac{1-\sqrt 5}2 X+1\Bigr)\Bigl(X^2+\frac{1+\sqrt 5}2 X+1\Bigr).$$
</s>