ODE $y(1+2xy)dx+x(1-xy)dy=0$ 
$$y(1+2xy)dx+x(1-xy)dy=0$$

I have tried to isolate $\frac{dy}{dx}$ and got the following:
$$\frac{dy}{dx}=-\frac{y(1+2xy)}{x(1-xy)}$$
but I understand that the terms have to be in the same order and that is not the case. 
What should I do?
 A: Set $u=xy$. Hence $\frac{du}{dx}=x\frac{dy}{dx}+y.$ Hence your equation became $$\frac{x}{u}\frac{du}{dx}-1 = \frac{1+2u}{u-1}.$$ This can be rewritten $$x\frac{du}{dx} = u\frac{3u}{u-1}$$ or else $$\frac{u-1}{3u^2}du=\frac{1}{x}dx.$$ Now you can integrate both sides.
A: $$\frac{dy}{dx}=-\frac{y(1+2xy)}{x(1-xy)}$$
Let $v=yx$ so $\frac{dy}{dx}=x^{-1}\frac{dv}{dx}-x^{-2}v$
$$x^{-1}\frac{dv}{dx}-x^{-2}v=-\frac{v(1+2v)}{x^2(1-v)}$$
$$\frac{dv}{dx}=\frac{3v^2}{(v-1)x}$$
$$\frac{v-1}{3v^2}\frac{dv}{dx}=x^{-1}$$
You can then integrate both sides.
$$\frac13\left(v^{-1}+\log|v|\right)=\log|x|+\frac{c}{3}$$
$$\frac{1}{xy}+\log|y|+\log|x|=3\log|x|+c$$
$$\frac{1}{xy}+\log|y|-2\log|x|=c$$
To write this as a fuction of $y$ requires the Lambert W function.
A: \begin{align*}y(1+2xy)\ dx+x(1−xy)\ dy=0&\implies (y\ dx+x\ dy)+2xy^2\ dx-x^2y\ dy=0\\&\implies d(xy)=-xy(2y\ dx-x\ dy)\\&\implies \dfrac{d(xy)}{xy}=-2y\ dx+x\ dy\\&\implies\dfrac{d(xy)}{x^2y^2}=-2\dfrac{dx}{x}+\dfrac{dy}{y}\end{align*}I think you can take it from here.
A: Given equation can be written as, 
ydx +xdy+2xy²dx- x²ydy=0
Dividing both side by (xy)², we get
d(xy)/(xy)² + 2dx/x - dy/y=0
Now it can be integrated easily...
