Hello Ewaz,
We are given to solve:
$$\frac{dy}{dx}+xy=y^2$$
Dividing through by $$y^2$$ (observing we are losing the trivial solution $y\equiv0$) we obtain:
$$y^{-2}\frac{dy}{dx}+xy^{-1}=1$$
We want to use the substitution:
$$v=y^{-1}$$
Differentiating with respect to $x$, we then obtain:
$$\frac{dv}{dx}=-y^{-2}\frac{dy}{dx}$$
And so our ODE becomes:
$$\frac{dv}{dx}-xv=-1$$
This is a linear ODE, and thus computing our integrating factor, we obtain:
$$\mu(x)=e^{-\int x\,dx}=e^{-\frac{x^2}{2}}$$
Multiplying the ODE by this factor, we obtain:
$$e^{-\frac{x^2}{2}}\frac{dv}{dx}-xe^{-\frac{x^2}{2}}v=-e^{-\frac{x^2}{2}}$$
Observing that the left side is not the differentiation of a product, we obtain:
$$\frac{d}{dx}\left(e^{-\frac{x^2}{2}}v \right)=-e^{-\frac{x^2}{2}}$$
Integrating with respect to $x$, there results:
$$\int\,d\left(e^{-\frac{x^2}{2}}v \right)=-\int e^{-\frac{x^2}{2}}\,dx$$
$$e^{-\frac{x^2}{2}}v=-\int e^{-\frac{x^2}{2}}\,dx$$
Multiplying through by $$e^{\frac{x^2}{2}}$$, we obtain:
$$v=-e^{\frac{x^2}{2}}\int e^{-\frac{x^2}{2}}\,dx$$
Back-substituting for $v$, we have:
$$\frac{1}{y}=-e^{\frac{x^2}{2}}\int e^{-\frac{x^2}{2}}\,dx$$
Inverting both sides, we the find:
$$y(x)=\frac{1}{-e^{\frac{x^2}{2}}\int e^{-\frac{x^2}{2}}\,dx}$$