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?

When you asked how to "derive" the fact that $\int \frac{1}{\sin^2 x} dx = -\cot x$, I thought maybe someone had suggested that this fact might be true, and asked if you could prove it. If that were so, then you would merely need to differentiate $-\cot x$.
In fact I would not be at all surprised to learn that the first person to discover how to
integrate $\frac{1}{\sin^2 x}$ was not actually trying to solve that problem specifically, but rather was simply interested in finding the derivative of $f(x) = \cot x$. Once they had done that, they knew the integral of $f'(x)$, which means they also knew how to integrate $-f'(x) = \frac{1}{\sin^2 x}$.
Most of the other methods described here are useful things to know about. But it all comes down to remembering a formula. I remember hating this part of first-year calculus, because it seemed like too much rote memorization of facts, especially the ones that said "the integral of ... is ...". I didn't want to have to remember all that. I probably would have been happier if I had just decided to make the best of it and had made myself a set of flash cards.
What you might do is to remember that $\int \sec^2 x dx = \tan x$ and that
$\sec^2 x = \frac{1}{\cos^2 x}$, and you might ask yourself whether the integral of $\frac{1}{\cos^2 x}$ might not be closely related to the integral of $\frac{1}{\sin^2 x}$.
In fact the derivatives and integrals of trigonometric functions are closely related to those of their cofunctions, since $\sin x = \cos\left(\frac{\pi}{2} - x\right)$ and so forth.  Well, then, given that $\tan x$ is the answer to $\int\frac{1}{\cos^2 x} dx$,
will $\cot x$ solve the new problem? Almost; it turns out that
$$\frac{d}{dx} \cot x = -\frac{1}{\sin^2 x},$$
so the solution to your problem is $-\cot x$.
Another method that seems slightly less like guesswork: 
knowing that $\sin x = \cos\left(\frac{\pi}{2} - x\right)$ and that we can integrate
$\frac{1}{\cos^2 x} = \sec^2 x$,
substitute $u = \frac{\pi}{2} - x$.
Then $x = \frac{\pi}{2} - u$ and $dx = -du$, so
$$
\begin{eqnarray*}
\int \frac{1}{\sin^2 x} dx &=& \int -\frac{1}{\sin^2 \left(\frac{\pi}{2} - u\right)} du \\
&=& -\int \frac{1}{\cos^2 u} du \\
&=& -\tan u \\
&=& -\tan \left(\frac{\pi}{2} - x\right) \\
&=& -\cot x.
\end{eqnarray*}
$$
Or you might use the tangent substitution method explained by @Felix Marin, especially if it's on an exam and you think of that method first.
I was happier in second-year calculus and much happier in third-year real analysis, by the way, because it became more about "big ideas" and not so much about the details of how to compute this or that function. (And along the way, a lot of the techniques I had to memorize in high school came to make a lot more sense in light of other patterns I was learning.)
