\[ \int \frac {x^5}{\left (a+b x^2\right ) \left (c+d x^2\right )} \, dx \]
Optimal antiderivative \[ \frac {x^{2}}{2 b d}+\frac {a^{2} \ln \! \left (b \,x^{2}+a \right )}{2 b^{2} \left (-a d +b c \right )}-\frac {c^{2} \ln \! \left (d \,x^{2}+c \right )}{2 d^{2} \left (-a d +b c \right )} \]
command
integrate(x**5/(b*x**2+a)/(d*x**2+c),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Timed out} \]
Sympy 1.8 under Python 3.8.8 output
\[ - \frac {a^{2} \log {\left (x^{2} + \frac {\frac {a^{4} d^{3}}{b \left (a d - b c\right )} - \frac {2 a^{3} c d^{2}}{a d - b c} + \frac {a^{2} b c^{2} d}{a d - b c} + a^{2} c d + a b c^{2}}{a^{2} d^{2} + b^{2} c^{2}} \right )}}{2 b^{2} \left (a d - b c\right )} + \frac {c^{2} \log {\left (x^{2} + \frac {- \frac {a^{2} b c^{2} d}{a d - b c} + a^{2} c d + \frac {2 a b^{2} c^{3}}{a d - b c} + a b c^{2} - \frac {b^{3} c^{4}}{d \left (a d - b c\right )}}{a^{2} d^{2} + b^{2} c^{2}} \right )}}{2 d^{2} \left (a d - b c\right )} + \frac {x^{2}}{2 b d} \]