Lately a friend of mine asked me above question.
After reaching this
$$-\cos(12)+\cos(24)-\cos(36)+\cos(48)-\cos(60)+\cos(72)-\cos(84)+ 1, $$
I could not simply it any further but later I noticed that there is a general pattern here
$L=\sin^2(x)- \sin^2(2x)+ \sin^2 (3x)-\cdots\pm\sin^2 (kx)$,
where $kx=90^\circ$ and $k \in \mathbb{R} $
$L = \cfrac{1}{2} \text{ for $k$ odd}$
$L= -\cfrac{1}{2} \text{ for $k$ even}$
And $M=\cos^2(x)- \cos^2(2x)+ \cos^2 (3x) - \cdots \pm \cos^2 (kx)$
$M= \dfrac{1}{2}$ for $k=1,2,3,\ldots$
Can anyone explain it to me?
Hint: You can rewrite the first equation because ${sin}^2(kx)=\dfrac{1}{2}(1-cos(2kx))$: $$\sum_{k=0}^n{(-1)^n\sin^2(kx)}=\sum_{k=0}^n(-1)^n{\dfrac{1}{2}}(1-cos(2kx))$$ $$\sum_{k=0}^n(-1)^n{\dfrac{1}{2}}(1-cos(2kx))=\sum_{k=0}^n(-1)^n{\dfrac{1}{2}}-\dfrac{1}{2}\sum_{k=0}^n(-1)^ncos(2kx)$$