Question in title, my progress:
let $z = \cos(x) + i\sin(x)$
then $1 + \cos(x) + \cos(2x) +\dots + \cos(nx) = Re(1 + z + z^2 +\dots + z^n) = Re\left (\dfrac{1-z^{n+1}}{1-z} \right)$
by geometric series;
multiplying $\dfrac{1-z^{n+1}}{1-z}$ by $\overline{1-z}$ we get $1 + \cos(x) + \cos(2x) +\dots + \cos(nx) = Re \left ( \dfrac{(1-z^{n+1})(\overline{1-z})}{|1-z|^2} \right )$
but I am not sure how to proceed from here.
edit: this is for a complex analysis course, so i'd appreciate a hint using complex analysis without using the exponential function
$\implies Re \left(\dfrac{(1-z^{n+1})(1-\bar z)}{{\lvert 1-z \rvert}^2}\right)=Re \left(\dfrac{(1-e^{i(n+1)\theta})(1-e^{-\theta})}{{\lvert 1-e^{i\theta} \rvert}^2}\right)$.
– Sep 30 '14 at 16:44