23.1 Problem number 259

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

Optimal antiderivative \[ \frac {c^{2} x}{e^{4}}+\frac {\left (a \,e^{2}-b d e +c \,d^{2}\right )^{2} x}{6 d \,e^{4} \left (e \,x^{2}+d \right )^{3}}-\frac {\left (-5 a \,e^{2}-7 b d e +19 c \,d^{2}\right ) \left (a \,e^{2}-b d e +c \,d^{2}\right ) x}{24 d^{2} e^{4} \left (e \,x^{2}+d \right )^{2}}+\frac {\left (29 c^{2} d^{4}-2 c \,d^{2} e \left (-a e +11 b d \right )+e^{2} \left (5 a^{2} e^{2}+2 a b d e +b^{2} d^{2}\right )\right ) x}{16 d^{3} e^{4} \left (e \,x^{2}+d \right )}-\frac {\left (35 c^{2} d^{4}-2 c \,d^{2} e \left (a e +5 b d \right )-e^{2} \left (5 a^{2} e^{2}+2 a b d e +b^{2} d^{2}\right )\right ) \arctan \! \left (\frac {x \sqrt {e}}{\sqrt {d}}\right )}{16 d^{\frac {7}{2}} e^{\frac {9}{2}}} \]

command

integrate((c*x**4+b*x**2+a)**2/(e*x**2+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 {c^{2} x}{e^{4}} - \frac {\sqrt {- \frac {1}{d^{7} e^{9}}} \left (5 a^{2} e^{4} + 2 a b d e^{3} + 2 a c d^{2} e^{2} + b^{2} d^{2} e^{2} + 10 b c d^{3} e - 35 c^{2} d^{4}\right ) \log {\left (- d^{4} e^{4} \sqrt {- \frac {1}{d^{7} e^{9}}} + x \right )}}{32} + \frac {\sqrt {- \frac {1}{d^{7} e^{9}}} \left (5 a^{2} e^{4} + 2 a b d e^{3} + 2 a c d^{2} e^{2} + b^{2} d^{2} e^{2} + 10 b c d^{3} e - 35 c^{2} d^{4}\right ) \log {\left (d^{4} e^{4} \sqrt {- \frac {1}{d^{7} e^{9}}} + x \right )}}{32} + \frac {x^{5} \left (15 a^{2} e^{6} + 6 a b d e^{5} + 6 a c d^{2} e^{4} + 3 b^{2} d^{2} e^{4} - 66 b c d^{3} e^{3} + 87 c^{2} d^{4} e^{2}\right ) + x^{3} \left (40 a^{2} d e^{5} + 16 a b d^{2} e^{4} - 16 a c d^{3} e^{3} - 8 b^{2} d^{3} e^{3} - 80 b c d^{4} e^{2} + 136 c^{2} d^{5} e\right ) + x \left (33 a^{2} d^{2} e^{4} - 6 a b d^{3} e^{3} - 6 a c d^{4} e^{2} - 3 b^{2} d^{4} e^{2} - 30 b c d^{5} e + 57 c^{2} d^{6}\right )}{48 d^{6} e^{4} + 144 d^{5} e^{5} x^{2} + 144 d^{4} e^{6} x^{4} + 48 d^{3} e^{7} x^{6}} \]