[Math] Help simplifying $\sum_{k=0}^n\cos(k\theta)=\frac{1}{2}+\frac{\sin[(n+\frac{1}{2})\theta]}{2\sin(\theta/2)}$

trigonometry

In a proof of $\sum_{k=0}^n\cos(k\theta)=\frac{1}{2}+\frac{\sin[(n+\frac{1}{2})\theta]}{2\sin(\theta/2)}$

I need help figuring out the identity used to simplify from red $ \color{red}{1}$ to $\color{red}{2}$ in this proof: enter image description here Also where did the negative sign between red 1 and i come from? Please note that I do not want a proof of the formula as this has already many answers on stackexchange and I don't want the question to be marked as duplicate and closed before my question gets answered. The sum here for instance starts w/ $\cos(1\theta)$ so using Olivier's final answer and the identity $\sin(\theta)\cos(\phi)=\frac{\sin(\theta+\phi)+\sin(\theta-\phi)}{2}$ + 1 is one way.

Best Answer

I need help figuring out the identity used to simplify this expression from line red $\color{red}{1}$ (the real and imaginary parts) to $\color{red}{2}$.

One may recall that $$ 1-\cos \theta=2\sin^2(\theta/2) $$ and from the identity $$ \cos p - \cos q = -2\sin\frac{p+q}2\sin\frac{p-q}2 $$ one has$$ \cos(n\theta)-\cos((n+1)\theta)=2\sin((n+1/2)\theta)\sin(\theta/2) $$ thus $$ \begin{align} \frac{\cos(n\theta)-\cos((n+1)\theta)+1-\cos \theta}{2(1-\cos \theta)}&=\frac{2\sin((n+1/2)\theta)\sin(\theta/2)+2\sin^2(\theta/2)}{4\sin^2(\theta/2)} \\\\&=\frac{\sin((n+1/2)\theta)+\sin(\theta/2)}{2\sin(\theta/2)} \end{align} $$ as announced, then proceed similarly for the imaginary part using the identity $$ \sin p - \sin q = 2\cos\frac{p+q}2\sin\frac{p-q}2. $$

Related Question