Example 3. Integrate the equation

$$
\left(y^{3}-2 x y\right) d x+\left(3 x y^{2}-x^{2}\right) d y=0
$$
Solution. This is an equation of the form (9.30), for which

$$
P(x, y)=y^{3}-2 x y, Q(x, y)=3 x y^{2}-x^{2}
$$

Finding the corresponding partial derivatives, we get:

$$
\frac{\partial P(x, y)}{\partial y}=3 y^{2}-2 x ; \frac{\partial Q(x, y)}{\partial x}=3 y^{2}-2 x
$$

from which

$$
\frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}
$$

Therefore, the left-hand side of the equation is the total differential of some function $u(x, y)$:

$$
d u=\frac{\partial u}{\partial x} d x+\frac{\partial u}{\partial y} d y=\left(y^{3}-2 x y\right) d x+\left(3 x y^{2}-x^{2}\right) d y
$$

i.e.,

$$
\frac{\partial u}{\partial x}=y^{3}-2 x y, \frac{\partial u}{\partial y}=3 x y^{2}-x^{2}
$$

Integrating the first equation (A) with respect to $x$, treating $y$ as a constant, and replacing the constant of integration with $\varphi(y)$, an unknown function of $y$:

$$
u(x, y)=\int\left(y^{3}-2 x y\right) d x=y^{3} x-y x^{2}+\varphi(y)
$$

Differentiating the function $u(x, y)$ with respect to $y$, we get

$$
\frac{\partial u}{\partial y}=3 y^{2} x-x^{2}+\varphi^{\prime}(y)
$$

But

$$
\frac{\partial u}{\partial y}=Q(x, y)=3 x y^{2}-x^{2}
$$

therefore

$$
3 x y^{2}-x^{2}+\varphi^{\prime}(y)=3 x y^{2}-x^{2}
$$

from which $\varphi^{\prime}(y)=0$ and $\varphi(y)=C_{1}$.

Thus,

$$
u(x, y)=y^{3} x-y x^{2}+C_{1} .
$$

On the other hand, by formula (9.33)

$$
u(x, y)=C_{2},
$$

so the general integral has the form

$$
y^{3} x-x^{2} y=C, \text { where } C=C_{2}-C_{1} .
$$