Derivation of the gcd formula for the $n$th cyclotomic polynomial Hello I was wondering if anyone knows how the following was derived:
$$\Phi_{{n}} \left( x \right) =\prod _{k=1}^{n} \left( {x}^{{\it \gcd}
 \left( k,n \right) }-1 \right) ^{\cos \left( {\frac {2\pi \,k}{n}}
 \right) }$$
I know that there are a lot of other related expressions like the Euler totient function, the gcd itself, the Mobius function, the modulo function that all have expressions that contain the real part of ${{\rm e}^{{\frac {2\pi \,ik}{n}}}}$ or ${{\rm e}^{{\frac {-2\pi \,ik}{n}}}}$ in a finite summation or product with another arithmetic function being a part of its summand formula, and I can see this is related to the roots of unity, but each of these formulas have unique characteristics and I have not been able to find what I can only assume to be a generalized method for finding them.
For the totient we have 
$$\varphi  \left( n \right) =\sum _{k=1}^{n}\gcd \left( k,n \right) {
{\rm e}^{-{\frac {2\pi \,ik}{n}}}}.
$$
And I am aware that this is a discrete Fourier transform, but as you can see from comparison of the two, this is not the generalized method that I am assuming to exist.
 A: The Wikipedia article on cyclotomic polynomials states:

The Möbius inversion formula allows the expression of $\;\Phi_n(x)\;$ as an explicit rational fraction: $\;\Phi_n(x) = \prod_{d|n} (x^d-1)^{\mu(n/d)},\;$
  where $\mu$ is the Möbius function. The Fourier transform of functions of the greatest common divisor together with the Möbius inversion formula gives: $\;\Phi_n(x) = \prod_{k=1}^n \left(x^{\gcd(k,n)}-1\right)^{\cos(2\pi k/n)}.$

The inversion formula means that the cyclotomic polynomials are uniquely determined by $\;x^n-1 = \prod_{d|n}\Phi_d(x).\;$ That is, if for all $n$ $\;x^n-1 = \prod_{d|n}c_d(x)\;$ for some sequence $\;\{c_n(x)\}\;$ of polynomials, then for all $n$ $\;c_n(x)=\Phi_n(x)\;$ follows. Now define 
$$\;c_d(x) := \prod_{k=1}^d \left(x^{\gcd(k,d)}-1\right)^{\cos(2\pi k/d)}.$$ We can partition the product as
$$c_d(x) = \prod_{t|d} \left( \prod_{m=1\; \land\; t=\gcd(m,d)}^d (x^t-1)^{\cos(2\pi mt/d)} \right) = \prod_{t|d} (x^t-1)^{a(d,t)}
= \prod_{t|d} (x^t-1)^{\mu(d/t)} $$
where $\;a(n,t):=\sum_{m=1\; \land\; t=\gcd(m,n)}^n\cos(\frac{2\pi m}n) = \mu(n/t)$ if $n$ is divisible by $t$ and $0$ otherwise.
Now $\;x^n-1 = \prod_{d|n}c_d(x)\;$ by a property of the Möbius function and we are done.
