<s>[INST] Integrating $\int\sin^{-2}xdx$ I am trying to prove that
$$
\int\frac{1}{\sin^2(x)}dx = -\cot(x) + C
$$
but I have difficulties, I don't know where to start, I can't substitute anything with $sin(x)$ because I don't have a $cos(x)$ to make it up for, I also know that:
$$
\sin^2x = \frac{1 - \cos(2x)}{2}
$$
so I basically have:
$$
\int\frac{2}{1 - \cos(2x)}dx
$$
and there I am stuck, how do I proceed?
 [/INST] You can use the tangent half angle substitution $t = \tan \frac{x}{2}$ which yields $\sin(x)  = \frac{2 t}{1+t^2}$ and ${\rm d}x = \frac{2}{1+t^2}{\rm d} t$.
$$ \int \frac{1}{\sin^2 x}\,{\rm d}x = \int \frac{1}{\left(\frac{2 t}{1+t^2}\right)^2} \left(
\frac{2}{1+t^2} \right)\,{\rm d}t =\int \frac{1+t^2}{2 t^2}  {\rm d}t = -\frac{1-t^2}{2 t}+C$$
Since $\sin x = \frac{2 t}{1+t^2}$ and $\cos x = \frac{1-t^2}{1+t^2}$ then $\tan x = \frac{2 t}{1-t^2}$. 
So $$\frac{1-t^2}{2 t} = \frac{\cos x}{\sin x} = \cot x$$
and 
$$ \int \frac{1}{\sin^2 x}\,{\rm d}x = -\cot x + C $$
</s>