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.

$\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. 
