Show factorization $ x^{2n}-1=(x^2-1) \prod_{k=1}^{n-1}(x^2-2x \cos \frac{\pi k}{n} + 1) $ I'm interested in how to show that
$$
x^{2n}-1=(x^2-1) \prod_{k=1}^{n-1}(x^2-2x \cos \frac{\pi k}{n} + 1)
$$
I've seen this equality too often, but have no idea how to derive it. I've tried the following:
$$
x^{2n}-1=(x^n-1)(x^n+1)
$$
We all know that $x^n-1=(x-\xi^0)(x-\xi^1) \dots (x-\xi^{n-1})$,  where $\xi=\exp(i \cdot \frac{2 \pi}{n})$.
Here $x-\xi^0$ gives us the desired $x-1$(for $x^2-1$ in RHS).
But the problem is, we can not do the same with $x^n+1$, because as I understand, there is no such general factorization of $x^n+1$. Firstly, it depends whether $n$ is even or not. Secondly, if for the sake for simplicity $n$ is odd, then we can decompose the polynomial such a way:
$$x^n+1=(x+1)(1-x+x^2-x^3 \dots -x^{n-2}+x^{n-1})$$
I don't see here anything to continue with. Any suggestions?
 A: Note
\begin{align}
x^{2n}-1
&=\prod_{k=0}^{2n-1} (x-e^{i\frac{\pi k}n})
=\prod_{k=0}^{n-1} (x-e^{i\frac{\pi k}n})\cdot 
\underset{k=2n-j}{ \prod_{k=n}^{2n-1} (x-e^{i\frac{\pi k}n})}\\
&=(x-1)\prod_{k=1}^{n-1} (x-e^{i\frac{\pi k}n})
\cdot \prod_{j=1}^{n-1} (x-e^{-i\frac{\pi j}n}) (x-e^{-i \pi})\\
 &=(x-1)(x+1)\prod_{k=1}^{n-1} (x-e^{i\frac{\pi k}n})
(x-e^{-i\frac{\pi k}n})\\
 &=(x^2-1)\prod_{k=1}^{n-1} (x^2 - 2x\cos\frac{\pi k}n+1)
\\
\end{align}
A: Thanks to @CalvinLin for this post. The idea was to apply direct substitution
$$
x^{2n}-1=\prod_{k=0}^{2n-1} (x-\xi^k)
$$
where $\xi$ is a base root of the equation $x^{2n}-1=0$, e.g. $\xi=\exp({i \cdot \frac{\pi}{n}})$.
It gives us the following:
$$
\prod_{k=0}^{2n-1} (x-\xi^k)=(x-\xi^0)(x-\xi^n) \prod_{k=1}^{n-1} (x-\xi^k)(x-\xi^{2n-k})
$$
$(x-\xi^0)(x-\xi^n)=(x-1)(x+1)=(x^2-1)$ since $\xi^n=\exp(i \cdot \pi)=-1$
Now let's take a deeper look at multiplier inside the product notation.
$$
(x-\xi^k)(x-\xi^{2n-k})=x^2-(\xi^k+\xi^{2n-k})x+\xi^k \cdot \xi^{2n-k}
$$
Obviously, $\xi^k \cdot \xi^{2n-k}=\xi^{2n}=1$. Consider the coefficient at $x$:
$$
\xi^k+\xi^{2n-k} \\
=\cos(k\cdot \frac{\pi}{n})+i\sin(k\cdot\frac{\pi}{n})+\cos((2n-k)\cdot \frac{\pi}{n})+i\sin((2n-k)\cdot \frac{\pi}{n})\\
=\cos(k\cdot \frac{\pi}{n})+i\sin(k\cdot\frac{\pi}{n})+\cos(2\pi - k\cdot \frac{\pi}{n})+i\sin(2\pi - k\cdot \frac{\pi}{n}) \\
=2\cos(k\cdot \frac{\pi}{n})
$$
The last equality comes from the periodicity and evenness/oddness of $\cos$/$\sin$.
So, for now we have:
$$
=(x^2-1)\prod_{k=1}^{n-1}(x^2-2x\cos(k \cdot \frac{\pi}{n})+1)
$$
And we are done!
A: Hint
You can use the same idea in the factorization of $x^n-1$.
Think of
$$x^n=-1=e^{i(2k+1)\pi}$$
