How to solve this differential equation: $x^2dy-y^2dx+xy^2(x-y)dy=0$
Solution 1:
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 ::
Solution 2:
$\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$