I try to solve the following task:
Show with Euler's formula (from complex analysis) that for $z\neq 2k\pi$ where $k\in\mathbb{Z}$ the following is true: $$\sum\limits_{v=0}^n \cos(vz) = \frac{1}{2}+\frac{1}{2}\frac{\sin(nz+\frac{z}{2})}{\sin \frac{z}{2}}$$
My attempt: $$2\sum\limits_{v=0}^n \cos(vz) = 1+\frac{\sin(nz+\frac{z}{2})}{\sin \frac{z}{2}}$$
$$\sum\limits_{v=0}^n 2\cos(vz)-\sum\limits_{v=0}^n\frac{1}{n} = \frac{\sin(nz+\frac{z}{2})}{\sin \frac{z}{2}}$$
$$\sum\limits_{v=0}^n 2\cos(vz)\sin \frac{z}{2}-\frac{\sin \frac{z}{2}}{n} = \sin(nz+\frac{z}{2})$$
Now I tried using the sinus identity $$\sin ( x \pm y ) = \sin x \cos y \pm \cos x \sin y $$ on the term $\cos(vz)\sin \frac{z}{2}$ but It doesn't seem to make it easier nor help.
My second thought to write cosinus as a series doesn't look like it will help either: $$2\sum\limits_{v=0}^n \sum_{m=0}^\infty (-1)^m\frac{(vz)^{2m}}{(2m)!} = 1+\frac{\sin(nz+\frac{z}{2})}{\sin \frac{z}{2}}$$
I also don't see where I can apply the Euler formula.
Thanks for help