A question involving the use of complex numbers. 
Evaluate $2^{n-1}\left(\cos \theta -\cos(\frac{\pi}{n})\right)\left(\cos \theta -\cos(\frac{2\pi}{n})\right)...\left(\cos \theta -\cos(\frac{(n-1)\pi}{n})\right)$

In the above question the terms $\cos(\frac{\pi}{n}),\cos(\frac{2\pi}{n}),...$ are the real part of a complex number given by $$z=e^{i\frac{k\pi}{n}}$$
where $k = 1,2,...,n-1 $.
If we expand the above problem then we would have to compute $\Sigma_0^{n-1}\cos(\frac{k\pi}{n}),...$ and also the summation of other terms.It will obvious not work.
The author has given  a hint to solve the above question.
Hint: Use the expansion for $\frac{x^{2n}-1}{x^2-1}$ to solve the problem.
I literally have no idea how to proceed further and solve it. I don't know in what way we can use the hint to solve the question as I cannot see or establish any clear connection between them.
Any help will be appreciated.
 A: Let $z^{2n}=1$
$$\implies z^{2n}-1=(z-z_1)(z-z_2)(z-z_3)....(z-z_{2n})$$
where $z_1,z_2...z_{2n}$ are the roots of unity
Since $z_k^{2n}=e^{2k\pi i}$,
$$z_k=e^{i(\frac{k\pi}{n})}=\cos\bigg(\frac{k\pi}{n}\bigg)+i\sin\bigg(\frac{k\pi}{n}\bigg)$$

Notice that
$$z_{2n-k}=\cos\bigg(\frac{(2n-k)\pi}{n}\bigg)+i\sin\bigg(\frac{(2n-k)\pi}{n}\bigg)$$
$$=\cos\bigg(\frac{2n\pi-k\pi}{n}\bigg)+i\sin\bigg(\frac{2n\pi-k\pi}{n}\bigg)$$
$$=\cos\bigg(2\pi-\frac{k\pi}{n}\bigg)+i\sin\bigg(2\pi-\frac{k\pi}{n}\bigg)$$
$$\cos\bigg(\frac{k\pi}{n}\bigg)-i\sin\bigg(\frac{k\pi}{n}\bigg)=\bar{z_k}$$
Also,
$$z_n=\cos(\pi)+i\sin(\pi)=-1$$
and
$$z_{2n}=\cos(2\pi)+i\sin(2\pi)=1$$

Grouping all the conjugates together and then multiplying them,
$$z^{2n}-1=(z-z_1)(z-z_{2n-1})(z-z_2)(z-z_{2n-2})....(z_n)(z_{2n-n})$$
$$=(z-z_1)(z-\bar{z_1})(z-z_2)(z-\bar{z_2})....(z-1)(z+1)$$
$$=\big[z^2-z(z_1+\bar{z_1})+|z_1^2|\big]\big[z^2-z(z_2+\bar{z_2})+|z_2^2|\big]....(z^2-1)$$
Since $|z_k|^2=1$ and $(z_k+\bar{z_k})=2Re(z_k)=2\cos(\frac{k\pi}{n})$,
$$z^{2n}-1=\big[z^2+1-2z\cos\bigg(\frac{\pi}{n}\bigg)\big]\big[z^2+1-2z\cos\bigg(\frac{2\pi}{n}\bigg)\big]....(z^2-1)$$
$$\implies \frac{z^{2n}-1}{z^2-1}=\big[z^2+1-2z\cos\bigg(\frac{\pi}{n}\bigg)\big]\big[z^2+1-2z\cos\bigg(\frac{2\pi}{n}\bigg)\big]....$$

Dividing both sides by $z^{n-1}$,
$$\frac{z^n-\frac{1}{z^n}}{z-\frac{1}{z}}=\big[z+\frac{1}{z}-2\cos\bigg(\frac{\pi}{n}\bigg)\big]\big[z+\frac{1}{z}-2\cos\bigg(\frac{2\pi}{n}\bigg)\big]....$$
Substituting $z=\cos(\theta)+i\sin(\theta)$
$\implies \frac{1}{z}=\cos(\theta)-i\sin(\theta)$
Also, $z^n=\cos(n\theta)+i\sin(n\theta)$ $\implies\frac{1}{z^n}=\cos(n\theta)-i\sin(n\theta)$
$$\implies\frac{z^n-\frac{1}{z^n}}{z-\frac{1}{z}}= \frac{2i\sin(n\theta)}{2i\sin(\theta)}=\bigg[2\cos(\theta)-2\cos\bigg(\frac{\pi}{n}\bigg)\bigg]\bigg[2\cos(\theta)-2\cos\bigg(\frac{2\pi}{n}\bigg)\bigg].....$$
$$\implies 2^{n-1}\prod_{k=1}^{n-1}[\cos(\theta)-\cos\big(\frac{k\pi}{n}\big)]=\fbox{$\frac{\sin(n\theta)}{\sin(\theta)}$}$$
