24.3 Problem number 126

\[ \int \frac {x^7 \left (A+B x^2\right )}{\left (a+b x^2+c x^4\right )^3} \, dx \]

Optimal antiderivative \[ -\frac {x^{6} \left (A b -2 a B -\left (-2 A c +b B \right ) x^{2}\right )}{4 \left (-4 a c +b^{2}\right ) \left (c \,x^{4}+b \,x^{2}+a \right )^{2}}+\frac {3 \left (A b -2 a B \right ) x^{2} \left (b \,x^{2}+2 a \right )}{4 \left (-4 a c +b^{2}\right )^{2} \left (c \,x^{4}+b \,x^{2}+a \right )}+\frac {3 a \left (A b -2 a B \right ) \arctanh \! \left (\frac {2 c \,x^{2}+b}{\sqrt {-4 a c +b^{2}}}\right )}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}}} \]

command

integrate(x**7*(B*x**2+A)/(c*x**4+b*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 {3 a \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) \log {\left (x^{2} + \frac {- 3 A a b^{2} + 6 B a^{2} b - 192 a^{4} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) + 144 a^{3} b^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) - 36 a^{2} b^{4} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) + 3 a b^{6} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right )}{- 6 A a b c + 12 B a^{2} c} \right )}}{2} + \frac {3 a \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) \log {\left (x^{2} + \frac {- 3 A a b^{2} + 6 B a^{2} b + 192 a^{4} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) - 144 a^{3} b^{2} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) + 36 a^{2} b^{4} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right ) - 3 a b^{6} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (- A b + 2 B a\right )}{- 6 A a b c + 12 B a^{2} c} \right )}}{2} + \frac {- 8 A a^{3} c^{2} - A a^{2} b^{2} c + 10 B a^{3} b c - B a^{2} b^{3} + x^{6} \left (- 6 A a b c^{3} - 20 B a^{2} c^{3} + 16 B a b^{2} c^{2} - 2 B b^{4} c\right ) + x^{4} \left (- 16 A a^{2} c^{3} - A a b^{2} c^{2} - A b^{4} c + 2 B a^{2} b c^{2} + 8 B a b^{3} c - B b^{5}\right ) + x^{2} \left (- 10 A a^{2} b c^{2} - 2 A a b^{3} c - 12 B a^{3} c^{2} + 20 B a^{2} b^{2} c - 2 B a b^{4}\right )}{64 a^{4} c^{4} - 32 a^{3} b^{2} c^{3} + 4 a^{2} b^{4} c^{2} + x^{8} \left (64 a^{2} c^{6} - 32 a b^{2} c^{5} + 4 b^{4} c^{4}\right ) + x^{6} \left (128 a^{2} b c^{5} - 64 a b^{3} c^{4} + 8 b^{5} c^{3}\right ) + x^{4} \left (128 a^{3} c^{5} - 24 a b^{4} c^{3} + 4 b^{6} c^{2}\right ) + x^{2} \left (128 a^{3} b c^{4} - 64 a^{2} b^{3} c^{3} + 8 a b^{5} c^{2}\right )} \]