<s>[INST] Prove using De Moivre's formula,that $\sum\limits_{k=0}^{n}\sin(kx)=\frac{1}{2}\cot(x/2)-\frac{\cos(nx+(x/2))}{2\sin(x/2)}$ I've been asked to prove that:
$$
\sum\limits_{k=0}^{n}\sin(kx)=\frac{1}{2}\cot(x/2)-\frac{\cos(nx+(x/2))}{2\sin(x/2)}
$$
When $0<x<2\pi$.
I know there are many similar posts on this site, but using $\cos(kx)$ instead, that's why I created this post, I can't get to the $1/2\cot$ in this one.
Thanks!
$$\begin{align}\sum\limits_{k=0}^{n}\sin(kx) &= \Im\left(\frac{e^{i(n+1)x}-1}{e^{ix}-1}\right)\\ &= \Im\left(\frac{e^{\frac{i(n+1)x}2}}{e^{\frac{ix}2}}\frac{\left(e^{\frac{i(n+1)x}2}-e^{-\frac{i(n+1)x}2}\right)}{\left( e^{\frac{ix}2}-e^{-\frac{ix}2}\right)}\right)\\&= \Im\left(e^{\frac{inx}2}\frac{2i\sin\frac{(n+1)x}2}{2i\sin{\frac{x}2}}\right)\end{align}$$ Applying $e^{iy}-e^{-iy}=2i\sin y,$
$$\begin{align}\sum\limits_{k=0}^{n}\sin(kx) &= \Im\left(\left(\cos\frac{nx}2+i\sin\frac{nx}2\right)\frac{\sin\frac{(n+1)x}2}{\sin{\frac{x}2}}\right)\\ &= \sin\frac{nx}2 \frac{\sin\frac{(n+1)x}2}{\sin{\frac{x}2}},\end{align}$$ then I don't know what to do.
 [/INST] You asked to prove this by DeMovire's formula, which states $$e^{ikx} = (\cos x + \sin x)^k = \cos kx + \sin kx.$$
Everything you did until the final line is correct. 
The final move is to do the following, $$\sin \left ( \frac{nx}{2} \right ) \frac{\sin\frac{(n+1)x}2}{\sin{\frac{x}2}} = \frac{\cos(x/2) - \cos(n + 1/2)x}{2\sin \left ( x/2 \right )} = \frac{1}{2}\cot x/2 - \frac{\cos(n + 1/2)x}{2\sin \left ( x/2 \right)}.$$
where we have used the fact that $$\sin u \sin v = \frac{1}{2} \left ( \cos(u - v) - \cos(u + v) \right )$$
</s>