A problem with non-exact ODE

$$xy^3dx=(x^2y+2)dy$$ After switching everything to one side $$xy^3dx-(x^2y+2)dy=0$$ $$\frac{\partial P}{\partial y}=3xy^2$$$$\frac{\partial Q}{\partial x}=-2xy$$ $\frac1P(\frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y})=\frac{(-3y-2)}{y^2}$ is only dependant on y, so the integrating factor will be $$e^{\int \frac{(-3y-2)}{y^2}}$$ But thats where my problem starts. After evaluating this and multiplying both sides of the equation by it partial derivatives sre not equal so I must have made a mistake somewhere, but Im unable to find it.

• Your integrating factor $e^{\int \frac{(-3y-2)}{y^2}dy}$ is correct. Note that it is equal to $\frac{e^{2/y}}{y^3}$ . You will find the same result than with the other method shown in my answer. – JJacquelin Jul 6 '14 at 22:20
• Hi Lugi ! You wrote : <<After evaluating this and multiplying both sides of the equation by it partial derivatives are not equal so I must have made a mistake somewhere, but Im unable to find it.>>. The partial derivatives are equal. Your mistake is certainly in calculing them. Without having the details of your calculus, it is not possible to see where is the mistake. – JJacquelin Jul 7 '14 at 7:49

$xy^3dx=(x^2y+2)dy$

Hint :

Let $X=x^2$

$y^3=2(Xy+2)\frac{dy}{dX}$

Let $y=-\frac{2}{Y}$

$\frac{dX}{dY}=-X+Y$

This linear ODE leads to $X(Y)$. The inverse function $Y(X)$ involves the Lambert W function.