Hello, I am new to the forum here and am not sure if I am posting this in the correct section. I didnt see any section for complex variables and this seemed the closest to complex analysis

I need help establishing the following identity

$\displaystyle 1 + \cos \theta + \cos 2\theta +.....+ \cos n\theta$ = $\displaystyle \frac{1}{2}$ + $\displaystyle {\sin (n + \frac{1}{2}) \theta}$ / $\displaystyle {{2 sin \frac{\theta}{2}}$

That is $\displaystyle {\sin (n + \frac{1}{2}) \theta}$ divided by $\displaystyle {{2 sin \frac{\theta}{2}}$. (I didnt know how to write that out in tex)

I need help establishing the above identity using DDe Moivre's formula and

$\displaystyle 1 + z + z^2+...+z^n = \frac{z^{n+1} - 1}{z - 1}$