5.18 Problem number 1063

\[ \int \frac {(a+b x)^6 (A+B x)}{(d+e x)^4} \, dx \]

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

command

integrate((b*x+a)**6*(B*x+A)/(e*x+d)**4,x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \text {Timed out} \]

Sympy 1.8 under Python 3.8.8 output

\[ \frac {B b^{6} x^{4}}{4 e^{4}} + \frac {5 b^{2} \left (a e - b d\right )^{3} \left (4 A b e + 3 B a e - 7 B b d\right ) \log {\left (d + e x \right )}}{e^{8}} + x^{3} \left (\frac {A b^{6}}{3 e^{4}} + \frac {2 B a b^{5}}{e^{4}} - \frac {4 B b^{6} d}{3 e^{5}}\right ) + x^{2} \left (\frac {3 A a b^{5}}{e^{4}} - \frac {2 A b^{6} d}{e^{5}} + \frac {15 B a^{2} b^{4}}{2 e^{4}} - \frac {12 B a b^{5} d}{e^{5}} + \frac {5 B b^{6} d^{2}}{e^{6}}\right ) + x \left (\frac {15 A a^{2} b^{4}}{e^{4}} - \frac {24 A a b^{5} d}{e^{5}} + \frac {10 A b^{6} d^{2}}{e^{6}} + \frac {20 B a^{3} b^{3}}{e^{4}} - \frac {60 B a^{2} b^{4} d}{e^{5}} + \frac {60 B a b^{5} d^{2}}{e^{6}} - \frac {20 B b^{6} d^{3}}{e^{7}}\right ) + \frac {- 2 A a^{6} e^{7} - 6 A a^{5} b d e^{6} - 30 A a^{4} b^{2} d^{2} e^{5} + 220 A a^{3} b^{3} d^{3} e^{4} - 390 A a^{2} b^{4} d^{4} e^{3} + 282 A a b^{5} d^{5} e^{2} - 74 A b^{6} d^{6} e - B a^{6} d e^{6} - 12 B a^{5} b d^{2} e^{5} + 165 B a^{4} b^{2} d^{3} e^{4} - 520 B a^{3} b^{3} d^{4} e^{3} + 705 B a^{2} b^{4} d^{5} e^{2} - 444 B a b^{5} d^{6} e + 107 B b^{6} d^{7} + x^{2} \left (- 90 A a^{4} b^{2} e^{7} + 360 A a^{3} b^{3} d e^{6} - 540 A a^{2} b^{4} d^{2} e^{5} + 360 A a b^{5} d^{3} e^{4} - 90 A b^{6} d^{4} e^{3} - 36 B a^{5} b e^{7} + 270 B a^{4} b^{2} d e^{6} - 720 B a^{3} b^{3} d^{2} e^{5} + 900 B a^{2} b^{4} d^{3} e^{4} - 540 B a b^{5} d^{4} e^{3} + 126 B b^{6} d^{5} e^{2}\right ) + x \left (- 18 A a^{5} b e^{7} - 90 A a^{4} b^{2} d e^{6} + 540 A a^{3} b^{3} d^{2} e^{5} - 900 A a^{2} b^{4} d^{3} e^{4} + 630 A a b^{5} d^{4} e^{3} - 162 A b^{6} d^{5} e^{2} - 3 B a^{6} e^{7} - 36 B a^{5} b d e^{6} + 405 B a^{4} b^{2} d^{2} e^{5} - 1200 B a^{3} b^{3} d^{3} e^{4} + 1575 B a^{2} b^{4} d^{4} e^{3} - 972 B a b^{5} d^{5} e^{2} + 231 B b^{6} d^{6} e\right )}{6 d^{3} e^{8} + 18 d^{2} e^{9} x + 18 d e^{10} x^{2} + 6 e^{11} x^{3}} \]