Prove that $\frac{\cos2\theta}{\sin6\theta}+\frac{\cos6\theta}{\sin18\theta}+\frac{\cos18\theta}{\sin54\theta}=\frac12(\cot2\theta-\cot54\theta)$ 
Prove that $\frac{\cos2\theta}{\sin6\theta}+\frac{\cos6\theta}{\sin18\theta}+\frac{\cos18\theta}{\sin54\theta}=\frac12(\cot2\theta-\cot54\theta)$

I tried formulas for $\sin3\theta, \cos3\theta$ but couldn't conclude.
I tried taking LCM on LHS and using formula for $2\sin A\cos B$ but couldn't conclude.
I tried converting $\cot$ into $\sin, \cos$, taking LCM, using $2\sin A\cos B$ but couldn't conclude.
 A: The triplication formulas for $\;\sin\;$ and $\;\cos\;$ are
$$ \sin(3x) \!=\! \sin(x)(3\cos(x)^2 \!-\! \sin(x)^2), \;
\cos(3x) \!=\! \cos(x)(\cos(x)^2 \!-\! 3\sin(x)^2). $$
Uisng these and $\;\cos(x)^2 + \sin(x)^2 = 1\;$ implies that
$$ 1 \!-\! \frac{\cot(3x)}{\cot(x)}  \!=\!
 1 \!-\! \frac{  \cos(x)^2 \!-\! 3\sin(x)^2}
{3\cos(x)^2 \!-\! \sin(x)^2}  \!=\!
 \frac{2(\cos(x)^2 + \sin(x)^2)} {3\cos(x)^2 \!-\! \sin(x)^2}  \!=\! \frac{2\sin(x)}{\sin(3x)}. $$
Now this implies that
$$ \frac{\cos(x)}{\sin(3x)} = \cot(x)\frac{\sin(x)}{\sin(3x)} =
\frac{\cot(x)}2 \left(1 \!-\! \frac{\cot(3x)}{\cot(x)}\right) = 
\frac{\cot(x)\!-\!\cot(3x)}2. $$
Define their common value as a function
$$ f(x) := \frac{\cos(x)}{\sin(3x)} = 
\frac{\cot(x)\!-\!\cot(3x)}2. $$
Your telescoping sum is now
$$ f(2x) + f(6x) + f(18x) = \\
\frac{\cot(2x)-\cot(6x)}2 +
\frac{\cot(6x)-\cot(18x)}2 + \frac{\cot(18x)-\cot(54x)}2 =\\
\frac{\cot(2x) - \cot(54x)}2. $$
A: Hint:
For $\sin x\ne0,$
$$\dfrac{\cos x}{\sin3x}=\dfrac{\sin(3x-x)}{2\sin x\sin3x}=\cdots=\dfrac{\cot x}2-\dfrac{\cot3x}2$$
