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
$$
Solution. By factoring out the corresponding multipliers, the given equation can be written as:

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

from which it is clear that this is a separable equation. Dividing both sides of the last equation by the product $\left(y^{2}+1\right)\left(1-x^{2}\right) \neq 0$, we get

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

Integrating this equation, we find

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

or

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

from which we obtain the general integral:

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