<s>[INST] How to solve a differential equation $(x^2y+y^5)dx+(x^3-xy^4)dy=0$? 
Solve the following differential equation:
  $$(x^2y+y^5)dx+(x^3-xy^4)dy=0$$

I noticed that it is not exact, since:
$$
(x^2y+y^5)'_y=x^2+5y^4\ne3x^2-y^4=(x^3-xy^4)'_x
$$
Then I tried to express $y'$:
$$
y'=\frac{x^2y+y^5}{xy^4-x^3}
$$
And now I don't understand what type of differential equation it is and how to solve it.
Could someone help me?
 [/INST] Try the Ansatz $df=0$ with $f_x=x^ay^b(x^2y+y^5),\,f_y=x^ay^b(x^3-xy^4)$ so
$$\begin{align}0&=\frac{(f_x)_y-(f_y)_x}{x^ay^b}\\&=(b-a-2)x^2+(a+b+6)y^4\\\implies(a,\,b)&=(-4,\,-2).\end{align}$$The equations $f_x=\frac{1}{x^2y}+\frac{y^3}{x^4},\,f_y=\frac{1}{xy^2}-\frac{y^2}{x^3}$ are consistent with $f=-\frac{1}{xy}-\frac{y^3}{3x^3}$.The solution is that $f$ is constant.
</s>