Example 7. Solve the Bernoulli equation $y^{\prime}-x y=-x y^{3}$.
Solution. Divide both sides of the equation by $y^{3}$:

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

Make the substitution $\frac{1}{y^{2}}=z,-\frac{2 y^{\prime}}{y^{3}}=z^{\prime}$, from which $\frac{y^{\prime}}{y^{3}}=-\frac{1}{2} z^{\prime}$. After substitution, the last equation will turn into a linear equation

$$
-\frac{1}{2} z^{\prime}-x z=-x \quad \text { or } \quad z^{\prime}+2 x z=2 x
$$

the general solution of which is

$$
z=1+C e^{-x^{2}}
$$

From this, we obtain the general integral of the given equation

$$
\frac{1}{y^{2}}=1+C e^{-x^{2}} \text { or } \quad y^{2}\left(1+C e^{-x^{2}}\right)=1
$$

Remark. The Bernoulli equation can also be integrated by the method of variation of constants, as with a linear equation, and using the substitution $y(x)=u(x) v(x)$.