Summation of $\sum_{r=1}^{n} \frac{\cos (2rx)}{\sin((2r+1)x \sin((2r-1)x}$ Summation of $$S=\sum_{r=1}^{n} \frac{\cos (2rx)}{\sin((2r+1)x) \sin((2r-1)x)}$$
My Try:
$$S=\sum_{r=1}^{n} \frac{\cos (2rx) \sin((2r+1)x-(2r-1)x)}{\sin 2x \:\sin((2r+1)x \sin((2r-1)x}$$
$$S=\sum_{r=1}^{n} \frac{\cos (2rx) \left(\sin((2r+1)x \cos (2r-1)x-\cos(2r-1)x)\sin(2r+1)x\right)}{\sin 2x \:\sin((2r+1)x \sin((2r-1)x)}$$
$$S=\sum_{r=1}^n \frac{\cos(2rx)}{\sin 2x}\left(\cot(2r-1)x-\cot(2r+1)x\right)$$
Any clue here?
 A: Good question! Here is one possible approach. First we rewrite the numerator as
$$
\cos(2rx) = \cos[(r+\frac{1}{2})x+(r-\frac{1}{2})x] = \cos\frac{2r+1}{2}x\cos\frac{2r-1}{2}x - \sin\frac{2r+1}{2}x\sin\frac{2r-1}{2}x
$$
and the denominator as
$$
4\sin\frac{2r+1}{2}x\cos\frac{2r+1}{2}x\cdot \sin\frac{2r-1}{2}x\cos\frac{2r-1}{2}x.
$$
Therefore the original summation can be written as
$$
S_n = \frac{1}{4}\sum_{r=1}^n \frac{1}{\sin\frac{2r+1}{2}x\sin\frac{2r-1}{2}x} -\frac{1}{4}\sum_{r=1}^n \frac{1}{\cos\frac{2r+1}{2}x\cos\frac{2r-1}{2}x}.
$$
Now we can use the trick that multiply a factor $\frac{\sin x}{\sin x}$ and use $$\sin x = \sin\frac{2r+1}{2}x\cos\frac{2r-1}{2}x - \sin\frac{2r-1}{2}x\cos\frac{2r+1}{2}x.$$ For the first sum,
$$
\frac{\sin x}{\sin\frac{2r+1}{2}x\sin\frac{2r-1}{2}x} = \cot \frac{2r-1}{2}x-\cot \frac{2r+1}{2}x.
$$
For the second sum,
$$
\frac{\sin x}{\cos\frac{2r+1}{2}x\cos\frac{2r-1}{2}x} = \tan \frac{2r+1}{2}x-\tan \frac{2r-1}{2}x.
$$
Thus the original sum is
$$
S_n = \frac{1}{4\sin x}(\cot \frac{1}{2}x-\cot \frac{2n+1}{2}x-\tan \frac{2n+1}{2}x+\tan \frac{1}{2}x).
$$
