<s>[INST] separable equation3 Is this solution correct?
Equation:
$x \sin y~dx+(x^2+1)\cos y~dy=0$
solve:
$$x \sin y\,dx=-(x^2+1)\cos y\,dy 
\\ \frac{x}{-(x^2+1)}dx=\frac{\cos y}{\sin y}\,dy
\\ \frac{x}{-(x^2+1)}dx=\cot y\,dy
\\ \implies -\frac{1}{2}\ln(|x^2+1|)=-\cot^{-1} y \,dy$$. 
 [/INST] You almost had it, but not quite.
From your second-to-last line:
$$\frac{-x}{(x^2+1}\,dx = \cot(y)\,dy$$
$$\int\frac{-x}{(x^2+1)}\,dx = \int\cot(y)\,dy$$
$$-\frac{1}{2}\ln(x^2+1) + C= \int\frac{\cos(y)}{\sin(y)}\,dy$$
For the left integral, let $u = \sin(y) \implies du=\cos(y) \,dy$.
$$-\frac{1}{2}\ln(x^2+1) + C= \int\frac{du}{u}\,dy$$
$$-\frac{1}{2}\ln(x^2+1) + C= \ln|\sin y|$$
This can be solved for $y$, but it's not pretty (and may introduce some domain error):
$$C\exp\left(-\frac{1}{2}\ln(x^2+1)\right)= \sin y$$
$$y = \arcsin\left(C\exp\left(-\frac{1}{2}\ln(x^2+1)\right)\right)$$
</s>