5.8 Problem number 293

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

Optimal antiderivative \[ -\frac {a^{4}}{b^{2} \left (-a d +b c \right )^{3} \left (b x +a \right )}-\frac {c^{4}}{2 d^{3} \left (-a d +b c \right )^{2} \left (d x +c \right )^{2}}+\frac {2 c^{3} \left (-2 a d +b c \right )}{d^{3} \left (-a d +b c \right )^{3} \left (d x +c \right )}-\frac {a^{3} \left (-a d +4 b c \right ) \ln \! \left (b x +a \right )}{b^{2} \left (-a d +b c \right )^{4}}+\frac {c^{2} \left (6 a^{2} d^{2}-4 a b c d +b^{2} c^{2}\right ) \ln \! \left (d x +c \right )}{d^{3} \left (-a d +b c \right )^{4}} \]

command

integrate(x**4/(b*x+a)**2/(d*x+c)**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 {a^{3} \left (a d - 4 b c\right ) \log {\left (x + \frac {\frac {a^{8} d^{7} \left (a d - 4 b c\right )}{b \left (a d - b c\right )^{4}} - \frac {5 a^{7} c d^{6} \left (a d - 4 b c\right )}{\left (a d - b c\right )^{4}} + \frac {10 a^{6} b c^{2} d^{5} \left (a d - 4 b c\right )}{\left (a d - b c\right )^{4}} - \frac {10 a^{5} b^{2} c^{3} d^{4} \left (a d - 4 b c\right )}{\left (a d - b c\right )^{4}} + \frac {5 a^{4} b^{3} c^{4} d^{3} \left (a d - 4 b c\right )}{\left (a d - b c\right )^{4}} + a^{4} c d^{3} - \frac {a^{3} b^{4} c^{5} d^{2} \left (a d - 4 b c\right )}{\left (a d - b c\right )^{4}} - 10 a^{3} b c^{2} d^{2} + 4 a^{2} b^{2} c^{3} d - a b^{3} c^{4}}{a^{4} d^{4} - 4 a^{3} b c d^{3} - 6 a^{2} b^{2} c^{2} d^{2} + 4 a b^{3} c^{3} d - b^{4} c^{4}} \right )}}{b^{2} \left (a d - b c\right )^{4}} + \frac {c^{2} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right ) \log {\left (x + \frac {\frac {a^{5} b c^{2} d^{4} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{\left (a d - b c\right )^{4}} - \frac {5 a^{4} b^{2} c^{3} d^{3} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{\left (a d - b c\right )^{4}} + a^{4} c d^{3} + \frac {10 a^{3} b^{3} c^{4} d^{2} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{\left (a d - b c\right )^{4}} - 10 a^{3} b c^{2} d^{2} - \frac {10 a^{2} b^{4} c^{5} d \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{\left (a d - b c\right )^{4}} + 4 a^{2} b^{2} c^{3} d + \frac {5 a b^{5} c^{6} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{\left (a d - b c\right )^{4}} - a b^{3} c^{4} - \frac {b^{6} c^{7} \left (6 a^{2} d^{2} - 4 a b c d + b^{2} c^{2}\right )}{d \left (a d - b c\right )^{4}}}{a^{4} d^{4} - 4 a^{3} b c d^{3} - 6 a^{2} b^{2} c^{2} d^{2} + 4 a b^{3} c^{3} d - b^{4} c^{4}} \right )}}{d^{3} \left (a d - b c\right )^{4}} + \frac {2 a^{4} c^{2} d^{3} + 7 a^{2} b^{2} c^{4} d - 3 a b^{3} c^{5} + x^{2} \left (2 a^{4} d^{5} + 8 a b^{3} c^{3} d^{2} - 4 b^{4} c^{4} d\right ) + x \left (4 a^{4} c d^{4} + 8 a^{2} b^{2} c^{3} d^{2} + 3 a b^{3} c^{4} d - 3 b^{4} c^{5}\right )}{2 a^{4} b^{2} c^{2} d^{6} - 6 a^{3} b^{3} c^{3} d^{5} + 6 a^{2} b^{4} c^{4} d^{4} - 2 a b^{5} c^{5} d^{3} + x^{3} \left (2 a^{3} b^{3} d^{8} - 6 a^{2} b^{4} c d^{7} + 6 a b^{5} c^{2} d^{6} - 2 b^{6} c^{3} d^{5}\right ) + x^{2} \left (2 a^{4} b^{2} d^{8} - 2 a^{3} b^{3} c d^{7} - 6 a^{2} b^{4} c^{2} d^{6} + 10 a b^{5} c^{3} d^{5} - 4 b^{6} c^{4} d^{4}\right ) + x \left (4 a^{4} b^{2} c d^{7} - 10 a^{3} b^{3} c^{2} d^{6} + 6 a^{2} b^{4} c^{3} d^{5} + 2 a b^{5} c^{4} d^{4} - 2 b^{6} c^{5} d^{3}\right )} \]