18.3 Problem number 1123

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

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

command

integrate((B*x+A)*(c*x**2+b*x)**2/(e*x+d)**5,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 c^{2} x}{e^{5}} + \frac {c \left (A c e + 2 B b e - 5 B c d\right ) \log {\left (d + e x \right )}}{e^{6}} + \frac {- A b^{2} d^{2} e^{3} - 6 A b c d^{3} e^{2} + 25 A c^{2} d^{4} e - 3 B b^{2} d^{3} e^{2} + 50 B b c d^{4} e - 77 B c^{2} d^{5} + x^{3} \left (- 24 A b c e^{5} + 48 A c^{2} d e^{4} - 12 B b^{2} e^{5} + 96 B b c d e^{4} - 120 B c^{2} d^{2} e^{3}\right ) + x^{2} \left (- 6 A b^{2} e^{5} - 36 A b c d e^{4} + 108 A c^{2} d^{2} e^{3} - 18 B b^{2} d e^{4} + 216 B b c d^{2} e^{3} - 300 B c^{2} d^{3} e^{2}\right ) + x \left (- 4 A b^{2} d e^{4} - 24 A b c d^{2} e^{3} + 88 A c^{2} d^{3} e^{2} - 12 B b^{2} d^{2} e^{3} + 176 B b c d^{3} e^{2} - 260 B c^{2} d^{4} e\right )}{12 d^{4} e^{6} + 48 d^{3} e^{7} x + 72 d^{2} e^{8} x^{2} + 48 d e^{9} x^{3} + 12 e^{10} x^{4}} \]