34.5 Problem number 120

\[ \int (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx \]

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

command

integrate((d*i*x+c*i)**2*(A+B*ln(e*((b*x+a)/(d*x+c))**n)),x)

Sympy 1.10.1 under Python 3.10.4 output

\[ \text {Timed out} \]

Sympy 1.8 under Python 3.8.8 output

\[ \begin {cases} c^{2} i^{2} x \left (A + B \log {\left (e \left (\frac {a}{c}\right )^{n} \right )}\right ) & \text {for}\: b = 0 \wedge d = 0 \\A c^{2} i^{2} x + A c d i^{2} x^{2} + \frac {A d^{2} i^{2} x^{3}}{3} - \frac {B c^{3} i^{2} n \log {\left (c + d x \right )}}{3 d} + B c^{2} i^{2} n x \log {\left (a \right )} - B c^{2} i^{2} n x \log {\left (c + d x \right )} + \frac {B c^{2} i^{2} n x}{3} + B c^{2} i^{2} x \log {\left (e \right )} + B c d i^{2} n x^{2} \log {\left (a \right )} - B c d i^{2} n x^{2} \log {\left (c + d x \right )} + \frac {B c d i^{2} n x^{2}}{3} + B c d i^{2} x^{2} \log {\left (e \right )} + \frac {B d^{2} i^{2} n x^{3} \log {\left (a \right )}}{3} - \frac {B d^{2} i^{2} n x^{3} \log {\left (c + d x \right )}}{3} + \frac {B d^{2} i^{2} n x^{3}}{9} + \frac {B d^{2} i^{2} x^{3} \log {\left (e \right )}}{3} & \text {for}\: b = 0 \\c^{2} i^{2} \left (A x + \frac {B a n \log {\left (\frac {a}{c} + \frac {b x}{c} \right )}}{b} + B n x \log {\left (\frac {a}{c} + \frac {b x}{c} \right )} - B n x + B x \log {\left (e \right )}\right ) & \text {for}\: d = 0 \\A c^{2} i^{2} x + A c d i^{2} x^{2} + \frac {A d^{2} i^{2} x^{3}}{3} + \frac {B a^{3} d^{2} i^{2} n \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )}}{3 b^{3}} + \frac {B a^{3} d^{2} i^{2} n \log {\left (\frac {c}{d} + x \right )}}{3 b^{3}} - \frac {B a^{2} c d i^{2} n \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )}}{b^{2}} - \frac {B a^{2} c d i^{2} n \log {\left (\frac {c}{d} + x \right )}}{b^{2}} - \frac {B a^{2} d^{2} i^{2} n x}{3 b^{2}} + \frac {B a c^{2} i^{2} n \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )}}{b} + \frac {B a c^{2} i^{2} n \log {\left (\frac {c}{d} + x \right )}}{b} + \frac {B a c d i^{2} n x}{b} + \frac {B a d^{2} i^{2} n x^{2}}{6 b} - \frac {B c^{3} i^{2} n \log {\left (\frac {c}{d} + x \right )}}{3 d} + B c^{2} i^{2} n x \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )} - \frac {2 B c^{2} i^{2} n x}{3} + B c^{2} i^{2} x \log {\left (e \right )} + B c d i^{2} n x^{2} \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )} - \frac {B c d i^{2} n x^{2}}{6} + B c d i^{2} x^{2} \log {\left (e \right )} + \frac {B d^{2} i^{2} n x^{3} \log {\left (\frac {a}{c + d x} + \frac {b x}{c + d x} \right )}}{3} + \frac {B d^{2} i^{2} x^{3} \log {\left (e \right )}}{3} & \text {otherwise} \end {cases} \]