How to solve this differential equation: $x^2dy-y^2dx+xy^2(x-y)dy=0$ 
$$x^2dy-y^2dx+xy^2(x-y)dy=0$$


What I tried:
$$\frac{x^2}{y^2} \frac{dy}{dx}+x(x-y)\frac{dy}{dx}=1\\$$
Let $h=-1/x, \; k=-1/y,\; dh=1/x^2 \,  dx, \; dk=1/y^2 \,dy$
$$\frac{dk}{dh}+\frac{(k-h)}{k^2} \frac{dk}{dh}=1\\
\frac{dk}{dh}+\frac hk=1+\frac1k\\
he^{\int-1/k^2\; dk}=\int\left(1+\frac1k\right)e^{\int-1/k^2\; dk}dk\\
he^{-y}=\int\frac{1-y}{y^2}e^{-y}dy=\int\left(\frac 1{y^2}-\frac1y\right)e^{-y}dy$$
Which probably is unsolvable?I tried using IBP on RHS.Dont use Ricatti Eqn(Not in my course)
Answer is:

 $$\large\ln\left|\frac{x-y}{xy}\right|=\frac{y^2}2+\mathcal C$$

 A: It seems that the solution $y(x)$ cannot be expressed on a closed form. But a closed form can be found for the inverse function $x(y)$ :
$$x^2 - y^2\frac{\mathrm dx}{\mathrm dy} + xy^2(x-y) = 0 \implies \frac{dx}{dy} = \frac{y^2 + 1}{y^2}x^2 - yx$$
Considering the function inverse function $x(y)$, this is a Riccati ODE which can be solved thanks to the classical method to solve this kind of ODEs.
But, in this case, it is easier to proceed with a convenient change of function:
$$\text{Let: } x(y) = e^{-y^2/2}F(y) \implies \frac{dx}{dy} = e^{-y^2/2}F' - ye^{-y^2/2}F = \frac{y^2 + 1}{y^2}e^{-y^2}F^2 - ye^{-y^2/2}F\\
\,\\
\text{Now, } \int{\frac{F'}{F^2}}\mathrm dy = \int{\frac{y^2 + 1}{y^2}e^{-y^2/2}}\mathrm dy \implies -\frac{1}{F} = -\frac{1}{y}e^{-y^2/2} + C\\
\implies F = \frac{y}{e^{-y^2/2} + Cy}\\ 
\implies x(y) = \frac{ye^{-y^2/2}}{e^{-y^2/2} + Cy}= \frac{y}{1 + Cye^{y^2/2}}
$$
:: Source :: 
A: $\left(\dfrac{x^2}{y^2} +x(x-y)\right)=\dfrac{dx}{dy}$
$x=vy\implies \dfrac{dx}{dy}=v+y\dfrac{dv}{dy}$
$\therefore \left(\dfrac{x^2}{y^2} +x(x-y)\right)=\dfrac{dx}{dy} \\\implies v+y\dfrac{dv}{dy}=v^2+v^2y^2-vy^2 \\ \implies y\dfrac{dv}{dy}=v^2+v^2y^2-vy^2-v\\ \implies y\dfrac{dv}{dy}=(1+y^2)v(v-1) \\\implies \displaystyle \int\dfrac{dv}{v(v-1)}=\displaystyle \int\left(y+\dfrac{1}{y}\right)dy \\ \implies \displaystyle \int\dfrac{v-(v-1)}{v(v-1)} dv=\displaystyle \int\left(y+\dfrac{1}{y}\right)dy\\\implies \displaystyle\int\dfrac{dv}{v-1}-\displaystyle\int\dfrac{dv}{v}=\displaystyle\int y\ dy + \displaystyle\int\dfrac{dy}{y} \\\implies \ln \left(1-\dfrac{1}{v}\right)=\dfrac{y^2}{2}+\ln y+ c \\\implies \ln \left(\dfrac{x-y}{xy}\right)= \dfrac{y^2}{2}+c$ 
A: The equation is $\displaystyle \frac{dy(x)}{dx}\cdot{\frac{x^2}{y(x)^2}}+\frac{dy(x)}
{dx}\cdot{x(x-y(x))}=1$.
Multiplying by $y(x)^2$ we get $$\displaystyle \frac{dy(x)}{dx}\left[x^2+x(x-y(x))y(x)^2\right]=y(x)^2 \rightarrow \frac{dy(x)}{dx}=\frac{y(x)^2}{x^2+x^2y(x)^2-xy(x)^3}$$
Now, $\displaystyle \frac{dy(x)}{dx}=\large \frac{1}{\frac{dx(y)}{dy}}$, so $$\displaystyle \frac{1}{\frac{dx(y)}{dy}}=\frac{y^2}{x(y)^2+x(y)^2y^2-x(y)y^3} \Rightarrow \frac{dx(y)}{dy}=x(y)^2-yx(y)+\frac{x(y)^2}{y^2}$$
Adding $yx(y)$ and dividing by $-x(y)^2$ we get $\displaystyle -\frac{\frac{dx(y)}{dy}}{x(y)^2}-\frac{y}{x(y)}=-\left(\frac{1}{y^2}+1\right)$.
Let $\displaystyle v(y)=\frac{1}{x(y)} \rightarrow \frac{dv(y)}{dy}=-\frac{\frac{dx(y)}{dy}}{x(y)^2}$.
Multiplying both sides by $\displaystyle e^{\Large \frac{-y^2}{2}}$ we get$$\displaystyle e^{\large -\frac{y^2}{2}}\frac{dv(y)}{dy}-\left(e^{\large-\frac{y^2}{2}}y\right)v(y)=-e^{\large-\frac{y^2}{2}}\left(\frac{1}{y^2}+1\right)$$
Using the reverse product rule to get $$\displaystyle \frac{d}{dy}\left(e^{\large -\frac{y^2}{2}}v(y)\right)=-e^{\large-\frac{y^2}{2}}\left(\frac{1}{y^2}+1\right)$$
Integrate both sides to get $$\displaystyle e^{\large -\frac{y^2}{2}}v(y)=-\int e^{\large -\frac{y^2}{2}}\left(\frac{1}{y^2}+1\right)dy$$
Using the result shown in the link Integrate $e^{-\frac{y^2}{2}}\left(\frac{1}{y^2}+1\right)$ we get $$\displaystyle e^{\large -\frac{y^2}{2}}v(y)=\frac{e^{\large -\frac{y^2}{2}}}{y}+\mathcal{C_1}$$
We get that $\displaystyle v(y)=\frac{1}{y}+\mathcal{C_1}e^{\large \frac{y^2}{2}}$.
Now we can write that $\displaystyle v(y)-\frac{1}{y}=\mathcal{C_1}e^{\large \frac{y^2}{2}}$.
Taking logarithm from both sides we get $\displaystyle \ln\left|v(y)-\frac{1}{y}\right|=\frac{y^2}{2}+\ln(\mathcal{C_1})$.
Substitute $\displaystyle v(y)=\frac{1}{x(y)}$ we find that the final answer is $\displaystyle \ln\left|\frac{1}{x}-\frac{1}{y}\right|=\frac{y^2}{2}+C_2$.
