Integrate $\int {{{\left( {\cot x - \tan x} \right)}^2}dx} $ $\eqalign{
  & \int {{{\left( {\cot x - \tan x} \right)}^2}dx}   \cr 
  &  = {\int {\left( {{{\cos x} \over {\sin x}} - {{\sin x} \over {\cos x}}} \right)} ^2}dx  \cr 
  &  = {\int {\left( {{{{{\cos }^2}x - {{\sin }^2}x} \over {\sin x\cos x}}} \right)} ^2}dx  \cr 
  &  = \int {{{\left( {{{\cos 2x} \over {{1 \over 2}\sin 2x}}} \right)}^2}dx}   \cr 
  &  = \int {{{\left( {2\cot 2x} \right)}^2}}   \cr 
  &  = \int {4{{\cot }^2}2xdx}   \cr 
  &  = \int {4\left( {{{\csc }^2}2x - 1} \right)dx}   \cr 
  &  = \int {\left(4{{\csc }^2}2x - 4\right)dx}   \cr 
  &  = 4 \times {{ - 1} \over 2}\cot 2x - 4x + C  \cr 
  &  =  - 2\cot 2x - 4x + C \cr} $

Where have I gone wrong? I've tried to spot an error so many times yet I can't find it, I need another pair of eyes.. Thanks.
 A: Why do you think that you've gone wrong? Your answer is correct.

Edit. To show why the solution is the same as the one in your answers, we just need to show that $\tan x-\cot x=-2\cot 2x$. 
$$
\begin{align*}
&\tan x-\cot x+2\cot 2x \\
&=\frac{\sin x}{\cos x}-\frac{\cos x}{\sin x}+2\frac{\cos 2x}{\sin 2x} \\
&=\frac{2\cos x\cos 2x\sin x-\cos^2 x\sin 2x+\sin^2 x\sin 2x}{\cos x\sin x\sin 2x} \\
&=\frac{2\cos x(\cos^2 x-\sin^2 x)\sin x-\cos^2 x(2\sin x\cos x)+\sin^2 x(2\sin x\cos x)}{\cos x\sin x\sin 2x} \\
&=\frac{2\cos^3 x\sin x-2\cos x\sin^3 x-2\sin x\cos^3 x+2\cos x\sin^3 x}{\cos x\sin x\sin 2x} \\
&=0
\end{align*}
$$
A: A cleaner way could be
$$\int (\cot x-\tan x)^2dx=\int(\cot^2x+\tan^2x-2\cot x\tan x)dx$$
$$=\int (\csc^2x-1+\sec^2x-1-2)dx$$
$$=\int \csc^2x dx+\int \sec^2x dx-4\int dx$$
$$=-(\cot x-\tan x)-4x+C$$
From another answer $\cot x-\tan x=2\cot2x$
A: $\tan x- \cot x = \frac{\sin x}{\cos x}-\frac{\cos x}{\sin x} = \frac{\sin^2 x - \cos^2 x}{\sin x \cos x} = \frac{-\cos 2x}{\sin x \cos x} = \frac{-2 \cos2x}{\sin 2x} = -2 \cot2x$
Therefore you answer $-\cot x -4x + \tan x +c$ is correct. 
