Example 5. Integrate the equation

$$
\left(x y^{2}-y^{3}\right) d x+\left(1-x y^{2}\right) d y=0 .
$$
Solution. This equation is not an equation of total differentials, since

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

$$
\frac{\partial Q}{\partial x}=\frac{\partial}{\partial x}\left(1-x y^{2}\right)=-y^{2} \text { and } \frac{\partial P}{\partial y} \neq \frac{\partial Q}{\partial x}
$$

We seek the integrating factor in the form of a function of $y$ only:

$$
\mu(x, y) \equiv \mu(y)
$$

since in this case condition (9.37) is satisfied, namely:

$$
\frac{1}{P}\left(\frac{\partial P}{\partial y}-\frac{\partial Q}{\partial x}\right)=\frac{2}{y}
$$

For this factor, we have:

$$
\frac{\partial \mu(y)}{\partial x}=0 ; \frac{\partial \mu(y)}{\partial y}=\frac{d \mu}{d y}
$$

Condition (9.35), which can be written in more detail as

$$
\frac{\partial \mu}{\partial y} P-\frac{\partial \mu}{\partial x} Q=\mu\left(\frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}\right)
$$

takes the form

$$
\frac{d \mu}{d y}\left(x y^{2}-y^{3}\right)=\mu\left[-y^{2}-\left(2 x y-3 y^{2}\right)\right]
$$

or

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

from which

$$
\frac{d \mu}{\mu}=\frac{2 y(y-x)}{y^{2}(x-y)} d y, \frac{d \mu}{\mu}=-\frac{2}{y} d y .
$$

Integrating the last equation, we find

$$
\ln \mu=-2 \ln y=\ln \frac{1}{y^{2}}, \mu(y)=\frac{1}{y^{2}}
$$

Multiplying the original equation by the integrating factor $\mu(y)=$ $=\frac{1}{y^{2}}$, we obtain an equation in total differentials:

$$
(x-y) d x+\left(\frac{1}{y^{2}}-x\right) d y=0
$$

Indeed,

$$
\frac{\partial(x-y)}{\partial y}=-1, \frac{\partial}{\partial x}\left(\frac{1}{y^{2}}-x\right)=-1, \frac{\partial P_{1}}{\partial y}=\frac{\partial Q_{1}}{\partial x}
$$

where

$$
P_{1}=\frac{\partial u}{\partial x}=x-y, Q_{1}=\frac{\partial u}{\partial y}=\frac{1}{y^{2}}-x
$$

Since

$$
P_{1}=\frac{\partial u}{\partial x}=x-y
$$

To

$$
\begin{gathered}
u(x, y)=\frac{x^{2}}{2}-y x+\varphi(y), \frac{\partial u}{\partial y}=-x+\varphi^{\prime}(y) \\
-x+\varphi^{\prime}(y)=\frac{1}{y^{2}}-x, \varphi^{\prime}(y)=\frac{1}{y^{2}}
\end{gathered}
$$

Integrating the last equation, we get

$$
\varphi(y)=-\frac{1}{y}+C_{1}
$$

Substituting the function $\varphi(y)$ into the expression for $u(x, y)$, we find

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

Since

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

then

$$
\frac{x^{2}}{2}-y x-\frac{1}{y}+C_{1}=C_{2}
$$

$$
\frac{x^{2}}{2}-y x-\frac{1}{y}=C
$$

Transforming the last equality, we obtain the general integral in the form

$$
x^{2} y-2 x y^{2}-2-2 C y=0
$$

## Problems

Find the general integrals of differential equations, transforming their left sides in advance:

1. $x d y+y d x=0$
2. $y^{2} d x+2 x y d y=0$.
3. $\frac{x d y-y d x}{x^{2}}=0$.
4. $x d x+y d y=0$.

Show that these equations are equations in total differentials, and find their general integrals:
5. $\left(x^{2}+2 x y+a^{2}\right) d x+\left(x^{2}+y^{2}-a^{2}\right) d y=0$.
6. $\left(\cos x+x \cos y+e^{y}\right) d y+(\sin y-y \sin