20.1 Problem number 3

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^3}{d+f x^2} \, dx \]

Optimal antiderivative \[ -\frac {\left (b^{3} B d f +3 A \,b^{2} f \left (-a f +c d \right )-3 b B \left (-a f +c d \right )^{2}-A c \left (3 a^{2} f^{2}-3 a c d f +c^{2} d^{2}\right )\right ) x}{f^{3}}-\frac {\left (A b f \left (-6 a c f -b^{2} f +3 c^{2} d \right )-B \left (c^{3} d^{2}-3 a \,c^{2} d f +3 a \,b^{2} f^{2}-3 c f \left (-a^{2} f +b^{2} d \right )\right )\right ) x^{2}}{2 f^{3}}+\frac {\left (b^{3} B f +3 A \,b^{2} c f -A \,c^{2} \left (-3 a f +c d \right )-3 b B c \left (-2 a f +c d \right )\right ) x^{3}}{3 f^{2}}+\frac {c \left (3 A b c f -B \left (-3 a c f -3 b^{2} f +c^{2} d \right )\right ) x^{4}}{4 f^{2}}+\frac {c^{2} \left (A c +3 b B \right ) x^{5}}{5 f}+\frac {B \,c^{3} x^{6}}{6 f}+\frac {\left (A b f \left (3 c^{2} d^{2}-6 a c d f -f \left (-3 a^{2} f +b^{2} d \right )\right )-B \left (-a f +c d \right ) \left (c^{2} d^{2}-2 a c d f -f \left (-a^{2} f +3 b^{2} d \right )\right )\right ) \ln \! \left (f \,x^{2}+d \right )}{2 f^{4}}+\frac {\left (b^{3} B \,d^{2} f +3 A \,b^{2} d f \left (-a f +c d \right )-3 b B d \left (-a f +c d \right )^{2}-A \left (-a f +c d \right )^{3}\right ) \arctan \! \left (\frac {x \sqrt {f}}{\sqrt {d}}\right )}{f^{\frac {7}{2}} \sqrt {d}} \]

command

integrate((B*x+A)*(c*x**2+b*x+a)**3/(f*x**2+d),x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \text {Timed out} \]

Sympy 1.8 under Python 3.8.8 output

\[ \text {output too large to display} \]