Prove $\frac{1}{2} + \cos(x) + \cos(2x) + \dots+ \cos(nx) = \frac{\sin(n+\frac{1}{2})x}{2\sin(\frac{1}{2}x)}$ for $x \neq 0, \pm 2\pi, \pm 4\pi,\dots$

I know that this can be proven inductively. However, I can't get passed the trig. I am pretty sure trig identities can show that the expression above is true for $n=0$, and that if the expression holds for $n=k$ it holds for $n=k+1$. But alas, I am getting lost in a sea of trig. Hopefully someone can shed some light on this.


Solution 1:

Hint: $$\frac{1}{2} + \sum_{k=1}^n \cos(kx) = \frac{1}{2}\sum_{k=-n}^n e^{ikx}$$

Solution 2:

Hint: $$ 2\cos(kx)\,\sin(\frac{x}{2})=\sin\left(kx+\frac{x}{2}\right)- \sin\left(kx-\frac{x}{2}\right) $$