A class of nonlinear first order equations of the form $y'+p(x)y=q(x)y^n$ are called Bernoulli equations.

A technique for solving such equations is to use $u=y^{1-n}$ and to then find the equation for $u$.

The general solution to $y'+y=-e^xy^2$ can be written as $y^{-1}=f(x)+Ce^x$.

Find the particular $f(x)$ such that $f(0)=0$.