Expressing $1 + \cos(x) + \cos(2x) +... + \cos(nx)$ as a sum of two terms 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
 A: Use $\sin(a) \cos(b) = \frac{1}{2} \sin(b+a) - \frac{1}{2} \sin(b-a)$ and multiply your sum with $\sin\left(x/2\right)$.
$$
 \sum_{m=0}^{n} \sin\left(\frac{x}{2}\right) \cos(m x) = \frac{1}{2} \sum_{m=0}^n  \left\{\sin \left(\left(m+1-\frac{1}{2}\right)x \right) - \sin\left( \left(m-\frac{1}{2}\right)x \right) \right\}
$$
The sum telescopes, i.e. $\sum_{m=0}^n \left(f(m+1)-f(m)\right) = f(n+1)-f(0)$, hence
$$
  \sum_{m=0}^{n} \sin\left(\frac{x}{2}\right) \cos(m x) = \sin \left(\left(n+\frac{1}{2}\right)x \right) - \sin\left(\frac{x}{2} \right)
$$
now divide by $\sin\left(\frac{x}{2}\right)$.
A: $\textbf{Hint:}$Use De Moivre's formula to compute $z^{n+1}$.
$\textbf{Edit:}$ The other way to compute this sum is writing $\cos x$ as:
$$\displaystyle \cos x=\frac{e^{ix}+e^{-ix}}{2}$$
In my opinion it's the easiest way. You simply get two geometric series:
$$\sum_{k=0}^{n}\cos kx=\sum_{k=0}^{n} \frac{e^{ikx}+e^{-ikx}}{2}=\frac{1}{2}\left(\sum_{k=0}^{n}e^{ikx}+\sum_{k=0}^{n}e^{-ikx}\right)= \\ = \frac{1}{2}\left(\frac{1-e^{i(n+1)x}}{1-e^{ix}}+\frac{1-e^{-i(n+1)x}}{1-e^{-ix}}\right)$$
It's equal:
$$\frac{1}{2}\left(\frac{1-e^{i(n+1)x}}{1-e^{ix}}+\frac{1-e^{-i(n+1)x}}{1-e^{-ix}}\right)=\frac{1}{2}\frac{(1-e^{i(n+1)x})(1-e^{-ix})+(1-e^{-i(n+1)x})(1-e^{ix})}{1+1-e^{ix}-e^{-ix}}=\frac{2+(e^{inx}+e^{-inx})-(e^{ix}+e^{-ix})-(e^{-inx}+e^{-inx})}{2-(e^{ix}+e^{-ix})}$$
Using again formula for $\cos$ you get:
$$\frac{1}{2}\frac{2+2\cos nx -2\cos x -2\cos (n+1)x}{2-2\cos x}$$
