\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) - \left ( 3\,y \left ( x \right ) +f \left ( x \right ) \right ) {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) + \left ( y \left ( x \right ) \right ) ^{3}+f \left ( x \right ) \left ( y \left ( x \right ) \right ) ^{2}=0} \]
Mathematica: cpu = 0.032004 (sec), leaf count = 35 \[ \text {DSolve}\left [-(f(x)+3 y(x)) y'(x)+f(x) y(x)^2+y''(x)+y(x)^3=0,y(x),x\right ] \]
Maple: cpu = 0.031 (sec), leaf count = 38 \[ \left \{ y \left ( x \right ) ={\frac {-\int \!{\it \_C1}\,{{\rm e}^{ \int \!f \left ( x \right ) \,{\rm d}x}}\,{\rm d}x-{\it \_C2}}{\int \!\! \!\int \!{\it \_C1}\,{{\rm e}^{\int \!f \left ( x \right ) \,{\rm d}x}} \,{\rm d}x\,{\rm d}x+{\it \_C2}\,x+1}} \right \} \]