<s>[INST] How to solve the following differential equation $(y^3-2yx^2)dx+(2xy^2-x^3)dy=0.$ I'd love your help with solving this following differential equation: $$(y^3-2yx^2)dx+(2xy^2-x^3)dy=0.$$
I am trying to use the method of finding integrating factor, that is $\frac{1}{Mx+Ny}$. But it is not coming.
Any suggestions?
 [/INST] The integrating factor $\mu = xy$ turns the ODE into the exact one
$$(xy^4 - 2y^2x^3)\mathrm d x + (2x^2 y^3 - x^4y) \mathrm d y = 0.$$
You can derive this the following way: If the expression
$$\frac{h_x - g_y}{xg - yh} $$
is a function of $xy$ alone (say $f(xy)$), where $g(x, y) = y^3 - 2yx^2$ and $h(x,y) = 2xy^2 - x^3$, then $\mu = \mathrm e^{\int f(u) \mathrm du}$ with $u = xy$. Here,
$$\frac{h_x - g_y}{xg - yh} = \frac{2y^2 - 3x^2 - 3y^2 + 2x^2}{xy^3-2yx^3 -2xy^3+x^3y} = - \frac{x^2 + y^2}{ -(x^3y + xy^3)} = \frac{x^2 + y^2}{ xy(x^2 + y^2)} = \frac{1}{xy}, $$
so when $\frac{1}{xy} = \frac{1}{u}$, one has the integrating factor
$$\mu = \mathrm e^{\int \frac{\mathrm d u}{u} } = \mathrm{e}^{\ln(u)} = xy.$$
</s>