Finding the sum of $\cos\frac{\pi}{7}$, $\cos\frac{3\pi}{7}$, $\cos\frac{5π}{7}$ by first finding a polynomial with those roots 
Without using tables, find the value of $$\cos\frac{\pi}{7}+\cos\frac{3\pi}{7}+\cos\frac{5\pi}{7}$$

This is a very common high school trigonometric problem, and the usual way to solve this is by repeated application of trigonometric identities. But I thought of a bit different approach.

Somehow, if we can find a polynomial whose roots are the three terms of the above expression, then we can apply Vieta's formula to find the value. 

So please help me with it. (Any hint will be appreciated.)

$\text{Using Complex Number}$
Let $z=e^{\frac{\pi i}{7}},$ so $z^7=-1.$ Let $Q$ be the desired quantity. Then
$$2Q=z+\frac{1}{z}+z^3+\frac{1}{z^3}+z^5+\frac{1}{z^5} = \frac{z^{10}+z^8+z^6+z^4+z^2+1}{z^5} = \frac{z^{12}-1}{z^5(z^2-1)}$$
$$=\frac{-z^5-1}{z^7-z^5} = \frac{-z^5-1}{-1-z^5} = 1$$ $$\therefore Q=\frac{1}{2}\ \ \square$$
