the form this is in makes it obvious that it is supposed to be an exact differential equation

$du=M(x,y) dx + N(x,y) dy=0$

$M(x,y)=\dfrac {du}{dx}=y^2 \cos(x)-3x^2 y-2x$

$N(x,y)=\dfrac {du}{dy}=2y\sin(x)-x^3+\ln(y)$

integrating M over x for example

$u(x,y)=y^2\cos(x)-x^3 y-x^2+f(y)$

where $f(y)$ is some function of $y$ we don't know yet that disappears when taking the x derivative

You can do the same thing with $N(x,y)$ over $y$ and eventual derive a solution for $u(x,y)$

Your solution is then in implicit form

$u(x,y)=C$ where $C$ is a constant of integration. Maybe this can be solved for y in terms of x, maybe not.