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?

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.
