Example 3. Integrate the differential equation

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

Find a particular solution that satisfies the condition: $y=1$ when $x=0$. Solution. The given equation is a separable equation (the coefficient of $d y$ is a function of $x$ only, and the coefficient of $d x$ is a product of functions, one depending only on $x$ and the other only on $y$). Dividing both sides of the equation by the product $y\left(1+x^{2}\right)$, we obtain an equation with separated variables

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

Integrating this equation, we find

$$
\ln |y|-\ln \left(1+x^{2}\right)=\ln |C|
$$

or

$$
\ln \left(\frac{|y|}{1+x^{2}}\right)=\ln |C|
$$

from which we obtain the general solution

$$
y=C\left(1+x^{2}\right)
$$

To find the required particular solution, it is sufficient to determine the value of $C$ using the initial conditions:

$$
1=C(1+0), C=1
$$

Thus, the particular solution is

$$
y=1+x^{2}
$$

Remark. When dividing by $y\left(1+x^{2}\right)$, it was assumed that $y(1+x^{2}) \neq 0$, i.e., $y \neq 0, 1+x^{2} \neq 0$. However, $y=0$ is a solution of the equation, which can be verified directly. This solution is obtained from the general solution when $C=0$.

Example 4. Find the general integral of the differential equation

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