how to derive the fact that the integral of $1/\sin^2(x) = -\cot (x)$ I know how that the integral of  $\dfrac{1}{\sin^2(x)} = -\cot (x)$, but how does derive this fact? Can you use half-angle formula to do this integral?

We can use the tangent half-angle substitution to get rid of any trigonometric expression during the integration.
Let $\sin x=\dfrac{2t}{1+t^2}$. Then $\cos x=\dfrac{1-t^2}{1+t^2}$ and $dx=\dfrac{2dt}{1+t^2}$, and we have
$$\int\frac{1}{\sin^2x}dx=\int\frac{(1+t^2)^2}{4t^2}\frac{2}{1+t^2}dt=\int\frac{1+t^2}{2t^2}dt=\int\frac{1}{2}+\frac{1}{2t^2}dt=\frac{t}{2}-\frac{1}{2t}.$$
Now 
$$\frac{t}{2}-\frac{1}{2t}=\frac{t^2-1}{2t}=\frac{-\frac{1-t^2}{1+t^2}}{\frac{2t}{1+t^2}}=\frac{-\cos x}{\sin x}=-\cot x.$$
