\[ \int \frac {\left (a+b x^2\right )^5 \left (A+B x^2\right )}{x^{17}} \, dx \]
Optimal antiderivative \[ -\frac {A \left (b \,x^{2}+a \right )^{6}}{16 a \,x^{16}}+\frac {\left (A b -4 a B \right ) \left (b \,x^{2}+a \right )^{6}}{56 a^{2} x^{14}}-\frac {b \left (A b -4 a B \right ) \left (b \,x^{2}+a \right )^{6}}{336 a^{3} x^{12}} \]
command
integrate((b*x**2+a)**5*(B*x**2+A)/x**17,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Timed out} \]
Sympy 1.8 under Python 3.8.8 output
\[ \frac {- 21 A a^{5} - 84 B b^{5} x^{12} + x^{10} \left (- 56 A b^{5} - 280 B a b^{4}\right ) + x^{8} \left (- 210 A a b^{4} - 420 B a^{2} b^{3}\right ) + x^{6} \left (- 336 A a^{2} b^{3} - 336 B a^{3} b^{2}\right ) + x^{4} \left (- 280 A a^{3} b^{2} - 140 B a^{4} b\right ) + x^{2} \left (- 120 A a^{4} b - 24 B a^{5}\right )}{336 x^{16}} \]