How to prove $\small 2\sin{(2m+1)x} -\sin{(2m-1)x}=\sin{x}\left(1+2\cos{(2mx)}+2\sum\limits_{k=1}^{m}\cos{(2kx)}\right)$? By chance I found:
$$
2\sin(2m+1)x - \sin(2m-1)x=\sin(x)\left(1+2\cos(2mx)+2\sum_{k=1}^{m}\cos(2kx)\right)
$$
Any idea how to prove it?
 A: You may write, for any real number $x$, $x \notin \mathbb{Z}\pi$,
$$
\begin{align}
\sum_{k=1}^{m} \cos (2kx)&=\Re \sum_{k=1}^{m} e^{2ikx}\\
&=\Re\left( e^{2ix}\frac{e^{2imx}-1}{e^{2ix}-1}\right)\\
&=\Re\left( e^{2ix}\frac{e^{imx}\left(e^{imx}-e^{-imx}\right)}{e^{ix}\left(e^{ix}-e^{-ix}\right)}\right)\\
&=\Re\left( e^{i(m+1)x}\frac{\sin(mx)}{\sin(x)}\right)\\
&=\Re\left( \left(\cos ((m+1)x)+i\sin ((m+1)x)\right)\frac{\sin(mx)}{\sin(x)}\right)\\
&=\frac{\cos ((m+1)x)}{\sin(x)}\sin(mx).
\end{align}
$$ Thus
$$
\begin{align}
&\sin(x)\left(1+2\cos(2mx)+2\sum_{k=1}^{m}\cos(2kx)\right)
\\&=\sin(x)+2\sin(x)\cos(2mx)+2\cos ((m+1)x)\sin(mx)
\end{align}
$$ and, using $\color{blue}{2\sin a\cos b=\sin(a+b)+\sin(a-b)}$, we get
$$
\begin{align}
&\sin(x)\left(1+2\cos(2mx)+2\sum_{k=1}^{m}\cos(2kx)\right)
\\&=\sin(x)+\sin((2m+1)x)-\sin((2m-1)x)+\sin ((2m+1)x)-\sin(x)
\\&=2\sin((2m+1)x)-\sin ((2m-1)x)
\end{align}
$$ as announced.
A: it's simple if u know this identity:
$$\sum_{i=0}^n cos(nb) = \frac{sin(\frac{(n+1)b}{2}) \times cos(\frac{nb}{2})}{sin(\frac{b}{2})}$$
I'll proof this identity if u want but first we use this to solve the above problem:
substituting $b = 2x$ and $n=m$ we get:
$$1+2\sum_{k=1}^{m}\cos(2kx) =-1+ 2 \sum_{k=0}^{m}\cos(2kx) = -1+\frac{sin((m+1)x) \times cos(mx)}{sin(x)}$$
then we have:
$$\sin(x)\left(1+2\cos(2mx)+2\sum_{k=1}^{m}\cos(2kx)\right) = -sin(x)+2sin((m+1)x)cos(mx)+2sin(x)cos(2mx)$$
which is the left side and proof is done.
now we change product to summation using $sinAcosB = 1/2(sin(A+B)+sin(A-B))$
then we get:
$$-sin(x) + sin((2m+1)x) +six(x) + sin((1+2m)x)+sin((1-2m)x)= 
2sin((2m+1)x)-sin((2m-1)x)$$
and now proving the identity:
$$S = \sum_{i=0}^{n}\cos(a+nb)$$
multiply and divide S by $2sin(\frac{b}{2})$  then use product to sum identity $sinAcosB = \frac{1}{2}(sin(A+B)+sin(A-B))$ and u see this:
$$2sin(\frac{b}{2}) \times S = [sin(\frac{b}{2}+a)+sin(\frac{b}{2}-a)]+[sin(\frac{3b}{2}+a)+sin(-\frac{b}{2}-a)] + [sin(\frac{5b}{2}+a)+sin(-\frac{3b}{2}-a)]+ ... +[sin(\frac{(2n+1)b}{2}+a)+sin(-\frac{(2n-1)b}{2}-a)]$$
after simplifying negative and positive terms we get:
$$2sin(\frac{b}{2}) \times S = sin(\frac{b}{2}+a)+sin(\frac{(2n+1)b}{2}+a)$$
and using sum to product Identity $sinA + sinB = 2sin(\frac{A+B}{2})cos(\frac{A-B}{2})$ yields the result.
