\[ y''(x)=-\frac {a x y'(x)}{x^2+1}-\frac {b y(x)}{\left (x^2+1\right )^2} \] ✓ Mathematica : cpu = 0.0186901 (sec), leaf count = 106
DSolve[Derivative[2][y][x] == -((b*y[x])/(1 + x^2)^2) - (a*x*Derivative[1][y][x])/(1 + x^2),y[x],x]
\[\left \{\left \{y(x)\to c_1 \left (x^2+1\right )^{\frac {2-a}{4}} P_{\frac {a-2}{2}}^{\frac {1}{2} \sqrt {a^2-4 a+4 b+4}}(i x)+c_2 \left (x^2+1\right )^{\frac {2-a}{4}} Q_{\frac {a-2}{2}}^{\frac {1}{2} \sqrt {a^2-4 a+4 b+4}}(i x)\right \}\right \}\] ✓ Maple : cpu = 0.068 (sec), leaf count = 71
dsolve(diff(diff(y(x),x),x) = -a*x/(x^2+1)*diff(y(x),x)-b/(x^2+1)^2*y(x),y(x))
\[y \left (x \right ) = \left (x^{2}+1\right )^{\frac {1}{2}-\frac {a}{4}} \left (\LegendreQ \left (\frac {a}{2}-1, \frac {\sqrt {a^{2}-4 a +4 b +4}}{2}, i x \right ) c_{2}+\LegendreP \left (\frac {a}{2}-1, \frac {\sqrt {a^{2}-4 a +4 b +4}}{2}, i x \right ) c_{1}\right )\]