10.6 Problem number 53

\[ \int \frac {\left (a+b x^2\right )^5 \left (A+B x^2\right )}{x^{21}} \, dx \]

Optimal antiderivative \[ -\frac {a^{5} A}{20 x^{20}}-\frac {a^{4} \left (5 A b +a B \right )}{18 x^{18}}-\frac {5 a^{3} b \left (2 A b +a B \right )}{16 x^{16}}-\frac {5 a^{2} b^{2} \left (A b +a B \right )}{7 x^{14}}-\frac {5 a \,b^{3} \left (A b +2 a B \right )}{12 x^{12}}-\frac {b^{4} \left (A b +5 a B \right )}{10 x^{10}}-\frac {b^{5} B}{8 x^{8}} \]

command

integrate((b*x**2+a)**5*(B*x**2+A)/x**21,x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \text {Timed out} \]

Sympy 1.8 under Python 3.8.8 output

\[ \frac {- 252 A a^{5} - 630 B b^{5} x^{12} + x^{10} \left (- 504 A b^{5} - 2520 B a b^{4}\right ) + x^{8} \left (- 2100 A a b^{4} - 4200 B a^{2} b^{3}\right ) + x^{6} \left (- 3600 A a^{2} b^{3} - 3600 B a^{3} b^{2}\right ) + x^{4} \left (- 3150 A a^{3} b^{2} - 1575 B a^{4} b\right ) + x^{2} \left (- 1400 A a^{4} b - 280 B a^{5}\right )}{5040 x^{20}} \]