\[ \boxed { {x}^{2}{\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) +a{x}^{2}{\frac {\rm d}{{\rm d}x}}y \left ( x \right ) +f \left ( x \right ) y \left ( x \right ) =0} \]
Mathematica: cpu = 0.212527 (sec), leaf count = 29 \[ \text {DSolve}\left [a x^2 y'(x)+f(x) y(x)+x^2 y''(x)=0,y(x),x\right ] \]
Maple: cpu = 0.0 (sec), leaf count = 30 \[ \left \{ y \left ( x \right ) ={\it DESol} \left ( \left \{ {\frac {f \left ( x \right ) {\it \_Y} \left ( x \right ) }{{x}^{2}}}+a{\frac {\rm d}{{\rm d}x}}{\it \_Y} \left ( x \right ) +{\frac {{\rm d}^{2}}{ {\rm d}{x}^{2}}}{\it \_Y} \left ( x \right ) \right \} , \left \{ {\it \_Y} \left ( x \right ) \right \} \right ) \right \} \]