\[ \int \frac {(A+B x) \left (a+c x^2\right )^2}{(d+e x)^6} \, dx \]
Optimal antiderivative \[ \frac {\left (-A e +B d \right ) \left (a \,e^{2}+c \,d^{2}\right )^{2}}{5 e^{6} \left (e x +d \right )^{5}}-\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 )}{4 e^{6} \left (e x +d \right )^{4}}+\frac {2 c \left (-a A \,e^{3}-3 A c \,d^{2} e +3 a B d \,e^{2}+5 B c \,d^{3}\right )}{3 e^{6} \left (e x +d \right )^{3}}-\frac {c \left (-2 A c d e +a B \,e^{2}+5 B c \,d^{2}\right )}{e^{6} \left (e x +d \right )^{2}}+\frac {c^{2} \left (-A e +5 B d \right )}{e^{6} \left (e x +d \right )}+\frac {B \,c^{2} \ln \! \left (e x +d \right )}{e^{6}} \]
command
integrate((B*x+A)*(c*x**2+a)**2/(e*x+d)**6,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} \log {\left (d + e x \right )}}{e^{6}} + \frac {- 12 A a^{2} e^{5} - 4 A a c d^{2} e^{3} - 12 A c^{2} d^{4} e - 3 B a^{2} d e^{4} - 6 B a c d^{3} e^{2} + 137 B c^{2} d^{5} + x^{4} \left (- 60 A c^{2} e^{5} + 300 B c^{2} d e^{4}\right ) + x^{3} \left (- 120 A c^{2} d e^{4} - 60 B a c e^{5} + 900 B c^{2} d^{2} e^{3}\right ) + x^{2} \left (- 40 A a c e^{5} - 120 A c^{2} d^{2} e^{3} - 60 B a c d e^{4} + 1100 B c^{2} d^{3} e^{2}\right ) + x \left (- 20 A a c d e^{4} - 60 A c^{2} d^{3} e^{2} - 15 B a^{2} e^{5} - 30 B a c d^{2} e^{3} + 625 B c^{2} d^{4} e\right )}{60 d^{5} e^{6} + 300 d^{4} e^{7} x + 600 d^{3} e^{8} x^{2} + 600 d^{2} e^{9} x^{3} + 300 d e^{10} x^{4} + 60 e^{11} x^{5}} \]