\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) - \left ( \left ( f \left ( x \right ) \right ) ^{2}+{\frac {\rm d}{{\rm d}x}}f \left ( x \right ) \right ) y \left ( x \right ) =0} \]
Mathematica: cpu = 0.177022 (sec), leaf count = 24 \[ \text {DSolve}\left [y''(x)-y(x) \left (f'(x)+f(x)^2\right )=0,y(x),x\right ] \]
Maple: cpu = 0.125 (sec), leaf count = 22 \[ \left \{ y \left ( x \right ) = \left ( \int \!{{\rm e}^{\int \!-2\,f \left ( x \right ) \,{\rm d}x}}\,{\rm d}x+{\it \_C1} \right ) {{\rm e}^{ \int \!f \left ( x \right ) \,{\rm d}x}}{\it \_C2} \right \} \]