Hello,

I want to solve this bernoulli differential equation.But my answer is different.

$y'+2xy=xy^2$

Multiplying both sides of equation by $y^{-2}$ and -1, we get

$-y^{-2}y'-xy^{-1}=-x$ Let $z=y^{-1}$ Then,the equation became z'-xz=-x. Now the equation is linear in z.Using P(x)=-x produces $\int P(x)dx=\int -xdx=\frac{-x^2}{2}$ which implies that $e^{-x^2/2}$is an integrating factor.Multiplying the linear equation by this factor we get

$z'e^{-x^2/2}-xze^{-x^2/2}=-xe^{-x^2/2}$

$\frac{d[ze^{-x^2/2}]}{dx}=-xe^{-x^2/2}$

$ze^{-x^2/2}=\int -xe^{-x^2/2}dx$

$ze^{-x^2/2}=e^{-x^2/2}+c$

$y^{-1}=1+ce^{x^2/2}$

$y=\frac{1}{1+ce^{x^2/2}}$

But answer is $\frac{-2}{Ce^{x^2}-1}$ Where is i am wrong in my answer, would any forumite explain me?