<s>[INST] Compute $\cos\frac{\pi}{7}-\cos\frac{2\pi}{7}+\cos\frac{3\pi}{7}$ 
Compute $\cos\frac{\pi}{7}-\cos\frac{2\pi}{7}+\cos\frac{3\pi}{7}$

This question came after an exercise involving finding the $7$th roots of $-1$. The roots were $\operatorname{cis}\frac{\pi}{7},\operatorname{cis}\frac{3\pi}{7},\dots$
This made me wonder if I could somehow use those roots, along with the geometry of complex numbers, to compute the expression. Any insight would be helpful. Thanks!
 [/INST] As $\cos(\pi-x)=-\cos(x)$ this is the same as to compute:
$$\cos \left( \frac{\pi}{7} \right)+\cos \left( \frac{3 \pi}{7} \right)+\cos \left(5 \frac{\pi}{7} \right)$$
But denoting by $\omega_i$ $i\in{0,\ldots 6}$ the $7$th roots of $-1$.
You have:
$$\sum_{i} \omega_i=0$$
and by taking the real part:
$$-1+2\left( \cos \left( \frac{\pi}{7} \right)+\cos \left( \frac{3 \pi}{7}\right)+ \cos \left(5 \frac{\pi}{7} \right) \right)=0$$

The geometric interpretation is that the center of mass of a regular heptagon (the $7$th roots of $-1$) is $0$ so it must be the same for the center of mass of the projections on the $x$-axis of it vertices.
</s>