18.7 Problem number 1309

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

Optimal antiderivative \[ \frac {\left (-A e +B d \right ) \left (a \,e^{2}+c \,d^{2}\right )^{2}}{6 e^{6} \left (e x +d \right )^{6}}-\frac {\left (a \,e^{2}+c \,d^{2}\right ) \left (-4 A c d e +a B \,e^{2}+5 B c \,d^{2}\right )}{5 e^{6} \left (e x +d \right )^{5}}+\frac {c \left (-a A \,e^{3}-3 A c \,d^{2} e +3 a B d \,e^{2}+5 B c \,d^{3}\right )}{2 e^{6} \left (e x +d \right )^{4}}-\frac {2 c \left (-2 A c d e +a B \,e^{2}+5 B c \,d^{2}\right )}{3 e^{6} \left (e x +d \right )^{3}}+\frac {c^{2} \left (-A e +5 B d \right )}{2 e^{6} \left (e x +d \right )^{2}}-\frac {B \,c^{2}}{e^{6} \left (e x +d \right )} \]

command

integrate((B*x+A)*(c*x**2+a)**2/(e*x+d)**7,x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \text {Timed out} \]

Sympy 1.8 under Python 3.8.8 output

\[ \frac {- 5 A a^{2} e^{5} - A a c d^{2} e^{3} - A c^{2} d^{4} e - B a^{2} d e^{4} - B a c d^{3} e^{2} - 5 B c^{2} d^{5} - 30 B c^{2} e^{5} x^{5} + x^{4} \left (- 15 A c^{2} e^{5} - 75 B c^{2} d e^{4}\right ) + x^{3} \left (- 20 A c^{2} d e^{4} - 20 B a c e^{5} - 100 B c^{2} d^{2} e^{3}\right ) + x^{2} \left (- 15 A a c e^{5} - 15 A c^{2} d^{2} e^{3} - 15 B a c d e^{4} - 75 B c^{2} d^{3} e^{2}\right ) + x \left (- 6 A a c d e^{4} - 6 A c^{2} d^{3} e^{2} - 6 B a^{2} e^{5} - 6 B a c d^{2} e^{3} - 30 B c^{2} d^{4} e\right )}{30 d^{6} e^{6} + 180 d^{5} e^{7} x + 450 d^{4} e^{8} x^{2} + 600 d^{3} e^{9} x^{3} + 450 d^{2} e^{10} x^{4} + 180 d e^{11} x^{5} + 30 e^{12} x^{6}} \]