\[ \int \frac {x \left (c+d x+e x^2+f x^3+g x^4+h x^5\right )}{a+b x^3} \, dx \]
Optimal antiderivative \[ \frac {\left (-a h +b e \right ) x}{b^{2}}+\frac {f \,x^{2}}{2 b}+\frac {g \,x^{3}}{3 b}+\frac {h \,x^{4}}{4 b}-\frac {\left (b^{\frac {2}{3}} \left (-a f +b c \right )+a^{\frac {2}{3}} \left (-a h +b e \right )\right ) \ln \! \left (a^{\frac {1}{3}}+b^{\frac {1}{3}} x \right )}{3 a^{\frac {1}{3}} b^{\frac {7}{3}}}+\frac {\left (b^{\frac {2}{3}} \left (-a f +b c \right )+a^{\frac {2}{3}} \left (-a h +b e \right )\right ) \ln \! \left (a^{\frac {2}{3}}-a^{\frac {1}{3}} b^{\frac {1}{3}} x +b^{\frac {2}{3}} x^{2}\right )}{6 a^{\frac {1}{3}} b^{\frac {7}{3}}}+\frac {\left (-a g +b d \right ) \ln \! \left (b \,x^{3}+a \right )}{3 b^{2}}-\frac {\left (b^{\frac {5}{3}} c -a^{\frac {2}{3}} b e -a \,b^{\frac {2}{3}} f +a^{\frac {5}{3}} h \right ) \arctan \! \left (\frac {\left (a^{\frac {1}{3}}-2 b^{\frac {1}{3}} x \right ) \sqrt {3}}{3 a^{\frac {1}{3}}}\right ) \sqrt {3}}{3 a^{\frac {1}{3}} b^{\frac {7}{3}}} \]
command
integrate(x*(h*x**5+g*x**4+f*x**3+e*x**2+d*x+c)/(b*x**3+a),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \text {Timed out} \]
Sympy 1.8 under Python 3.8.8 output
\[ x \left (- \frac {a h}{b^{2}} + \frac {e}{b}\right ) + \operatorname {RootSum} {\left (27 t^{3} a b^{7} + t^{2} \left (27 a^{2} b^{5} g - 27 a b^{6} d\right ) + t \left (- 9 a^{3} b^{3} f h + 9 a^{3} b^{3} g^{2} + 9 a^{2} b^{4} c h - 18 a^{2} b^{4} d g + 9 a^{2} b^{4} e f - 9 a b^{5} c e + 9 a b^{5} d^{2}\right ) - a^{5} h^{3} + 3 a^{4} b e h^{2} - 3 a^{4} b f g h + a^{4} b g^{3} + 3 a^{3} b^{2} c g h + 3 a^{3} b^{2} d f h - 3 a^{3} b^{2} d g^{2} - 3 a^{3} b^{2} e^{2} h + 3 a^{3} b^{2} e f g - a^{3} b^{2} f^{3} - 3 a^{2} b^{3} c d h - 3 a^{2} b^{3} c e g + 3 a^{2} b^{3} c f^{2} + 3 a^{2} b^{3} d^{2} g - 3 a^{2} b^{3} d e f + a^{2} b^{3} e^{3} - 3 a b^{4} c^{2} f + 3 a b^{4} c d e - a b^{4} d^{3} + b^{5} c^{3}, \left ( t \mapsto t \log {\left (x + \frac {- 9 t^{2} a^{2} b^{5} f + 9 t^{2} a b^{6} c + 3 t a^{4} b^{2} h^{2} - 6 t a^{3} b^{3} e h - 6 t a^{3} b^{3} f g + 6 t a^{2} b^{4} c g + 6 t a^{2} b^{4} d f + 3 t a^{2} b^{4} e^{2} - 6 t a b^{5} c d + a^{5} g h^{2} - a^{4} b d h^{2} - 2 a^{4} b e g h + 2 a^{4} b f^{2} h - a^{4} b f g^{2} - 4 a^{3} b^{2} c f h + a^{3} b^{2} c g^{2} + 2 a^{3} b^{2} d e h + 2 a^{3} b^{2} d f g + a^{3} b^{2} e^{2} g - 2 a^{3} b^{2} e f^{2} + 2 a^{2} b^{3} c^{2} h - 2 a^{2} b^{3} c d g + 4 a^{2} b^{3} c e f - a^{2} b^{3} d^{2} f - a^{2} b^{3} d e^{2} - 2 a b^{4} c^{2} e + a b^{4} c d^{2}}{a^{5} h^{3} - 3 a^{4} b e h^{2} + 3 a^{3} b^{2} e^{2} h - a^{3} b^{2} f^{3} + 3 a^{2} b^{3} c f^{2} - a^{2} b^{3} e^{3} - 3 a b^{4} c^{2} f + b^{5} c^{3}} \right )} \right )\right )} + \frac {f x^{2}}{2 b} + \frac {g x^{3}}{3 b} + \frac {h x^{4}}{4 b} \]