\[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{\left (a+c x^2\right )^3} \, dx \]
Optimal antiderivative \[ -\frac {\left (a B -\left (A c -a C \right ) x \right ) \left (e x +d \right )^{2}}{4 a c \left (c \,x^{2}+a \right )^{2}}-\frac {\left (e x +d \right ) \left (a \left (A c +3 a C \right ) e -c \left (3 A c d +2 B a e +a C d \right ) x \right )}{8 a^{2} c^{2} \left (c \,x^{2}+a \right )}+\frac {\left (a \left (A c +3 a C \right ) e^{2}+c d \left (3 A c d +2 B a e +a C d \right )\right ) \arctan \! \left (\frac {x \sqrt {c}}{\sqrt {a}}\right )}{8 a^{\frac {5}{2}} c^{\frac {5}{2}}} \]
command
integrate((e*x+d)**2*(C*x**2+B*x+A)/(c*x**2+a)**3,x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Timed out} \]
Sympy 1.8 under Python 3.8.8 output
\[ - \frac {\sqrt {- \frac {1}{a^{5} c^{5}}} \left (A a c e^{2} + 3 A c^{2} d^{2} + 2 B a c d e + 3 C a^{2} e^{2} + C a c d^{2}\right ) \log {\left (- a^{3} c^{2} \sqrt {- \frac {1}{a^{5} c^{5}}} + x \right )}}{16} + \frac {\sqrt {- \frac {1}{a^{5} c^{5}}} \left (A a c e^{2} + 3 A c^{2} d^{2} + 2 B a c d e + 3 C a^{2} e^{2} + C a c d^{2}\right ) \log {\left (a^{3} c^{2} \sqrt {- \frac {1}{a^{5} c^{5}}} + x \right )}}{16} + \frac {- 4 A a^{2} c d e - 2 B a^{3} e^{2} - 2 B a^{2} c d^{2} - 4 C a^{3} d e + x^{3} \left (A a c^{2} e^{2} + 3 A c^{3} d^{2} + 2 B a c^{2} d e - 5 C a^{2} c e^{2} + C a c^{2} d^{2}\right ) + x^{2} \left (- 4 B a^{2} c e^{2} - 8 C a^{2} c d e\right ) + x \left (- A a^{2} c e^{2} + 5 A a c^{2} d^{2} - 2 B a^{2} c d e - 3 C a^{3} e^{2} - C a^{2} c d^{2}\right )}{8 a^{4} c^{2} + 16 a^{3} c^{3} x^{2} + 8 a^{2} c^{4} x^{4}} \]