<s>[INST] Evaluating $(1+\cos\frac{\pi}{8})(1+\cos\frac{3\pi}{8}) (1+\cos\frac{5\pi}{8})(1+\cos\frac{7\pi}{8})$ 
How to find the value of $$\left(1+\cos\frac{\pi}{8}\right)\left(1+\cos\frac{3\pi}{8}\right) \left(1+\cos\frac{5\pi}{8}\right)\left(1+\cos\frac{7\pi}{8}\right)$$


I used: $ 1+ \cos \theta=2\sin^2(\theta/2)$ to get $$2^4 \cdot\prod_{n=0}^3 \sin\left(\frac{(2n+1)\pi}{16}\right)$$
After that I tried using the formula: 
$$\sin\left(1 \frac{\pi}n\right)\sin\left(2 \frac{\pi}n\right) \cdots \sin\left((n-1) \frac{\pi}n\right)= \frac n {2^{n-1}}$$
to find the value of the expression in the parenthesis in the first equation, but currently I'm stuck. I don't think this method will lead me to the correct answer.
Any help would be appreciated!
 [/INST] Here is a solution using complex numbers: Let $\omega = \exp(i\pi/2n)$. Then
\begin{align*}
\prod_{k=1}^{n} \left(1 + \cos \left( \tfrac{2k-1}{2n}\pi \right) \right)
&= \frac{1}{2^{n}} \prod_{k=1}^{n} \left(1 + 2\Re(\omega^{2k-1})+ 1 \right) \\
&= \frac{1}{2^{n}} \prod_{k=1}^{n} (1 + \omega^{2k-1})(1 + \omega^{-(2k-1)}).
\end{align*}
But notice that $\omega^{-(2n-1)}, \cdots, \omega^{2n-1}$ are $2n$ distinct zeros of the polynomial $ z^{2n} + 1$. Consequently we have
\begin{align*}
\prod_{k=1}^{n} \left(1 + \cos \left( \tfrac{2k-1}{2n}\pi \right) \right)
&= \frac{1}{2^{n}} \prod_{k=1}^{n} (-1 - \omega^{2k-1})(-1 - \omega^{-(2k-1)}) \\
&= \frac{1}{2^{n}} (z^{2n}+1)|_{z=-1} \\
&= \frac{1}{2^{n-1}}.
\end{align*}
</s>