$\int( [\cot^2 x (1+\cot^2 x)] -\cot^2 x) dx = \int \cot x \dfrac{1}{\sin^2 x}dx - \int \cot^2 x dx$
$-\int \cot x d(\cot x) - \int \dfrac{\cos^2 x }{\sin^2 x}dx = -\dfrac{1}{2}\cot^2 x + \int \dfrac{1-\cos^2 x}{\sin^2 x} dx -\int \dfrac{1}{\sin^2 x}dx$
$= -\dfrac{1}{2}\cot^2 x + x +\cot x + C$