I want to find the solution $U(x,y,z)=K$ for the equation
$$(x^2z-y^3)dx+3xy^2dy+x^3dz=0.$$
It's easy to check that $\vec{F}\cdot \vec{\nabla}\times\vec{F}=0$, where $\vec{F}=(x^2z-y^3,3xy^2,x^3)$.
To solve it, I proceed by Pfaff method. First, I taking one variable (for example, $x$) as a constant, so
$$3xy^2dy+x^3dz=0,$$
and then
$$C(x)=\frac{y^3}{x^2}+z.$$
Differentiating this expression I got
$$-C'(x)-\frac{2y^3}{x^3}dx+\frac{3y^2}{x^2}dy+dz=0$$
and comparing it with the equation I want to solve:
$$-C'(x)=\frac{2y^3}{x^3}+x^2z-y^3=y^3+x^2z \Rightarrow -\frac{C'(x)}{x^2}=C(x) \Rightarrow C(x)=Ke^{-x^3/3}.$$
Finally, I substitute that value and I get
$$K=e^{x^3/3}\left(\frac{y^3}{x^2}+z\right).$$
However, this have to obey that $\nabla K=\mu \vec{F}$ where $\mu$ is an integrating factor, and it isn't.
When did I make a mistake?