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