Suppose $\sin \frac{\theta}{2} \neq 0$ . Prove that
$$\frac{1}{2}+ \sum_{k=1}^n \cos (k\theta) = \frac{\sin[(n+ \frac{1}{2})\theta]}{2\sin\frac{\theta}{2}}$$
The question also give the hint, $$z=\cos\theta + i\sin\theta = e^{i\theta}$$ $$\sum_{k=1}^n z^k = z + z^2 + \cdots + z^n = \frac{z(z^n-1)}{z-1}$$
What I did was to change z into polar form and applied double angle formula to remove $\cos\theta$, but I have no idea what to do after that and it is still $\sum_{k=1}^n z^k = \sum_{k=1}^n \cos(k\theta)+i\sin(k\theta)$, not exactly $\sum_{k=1}^n \cos(k\theta)$ that I am supposed to prove