Solution (source code)

= Solution

The <Bernoulli differential equation> becomes linear after $z=1/y$: multiplying by $-y^{-2}$ gives $z'-2z=-x^2$. A quadratic <particular solution> is $z_p=x^2/2+x/2+1/4$, while the <homogeneous solution> is $Ce^{2x}$. The <initial condition> gives $z(0)=1$ and $C=3/4$. Hence
$$
\boxed{y(x)=\frac4{3e^{2x}+2x^2+2x+1}.}
$$
The denominator is positive for all real $x$, since $2x^2+2x+1=2(x+1/2)^2+1/2$. Thus this <initial value problem> has the displayed solution on the entire real line. The separate solution $y=0$ does not satisfy its <initial condition>.