\(\int (s+t x)^2 (a+b \log (c x^n)) (d+e \log (f (g+h x)^q)) \, dx\) [416]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [F]
Sympy [F(-1)]
Maxima [A] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 32, antiderivative size = 607 \[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=-\frac {1}{3} b d n s^2 x+\frac {4}{9} b e n q s^2 x+\frac {b e n q s (h s-g t) x}{3 h}-\frac {a e q (h s-g t)^2 x}{3 h^2}+\frac {4 b e n q (h s-g t)^2 x}{9 h^2}+\frac {5 b e n q s (s+t x)^2}{36 t}+\frac {5 b e n q (h s-g t) (s+t x)^2}{36 h t}+\frac {2 b e n q (s+t x)^3}{27 t}+\frac {b e n q s^3 \log (x)}{9 t}+\frac {b e n q s^2 (h s-g t) \log (x)}{6 h t}-\frac {b e q (h s-g t)^2 x \log \left (c x^n\right )}{3 h^2}-\frac {e q (h s-g t) (s+t x)^2 \left (a+b \log \left (c x^n\right )\right )}{6 h t}-\frac {e q (s+t x)^3 \left (a+b \log \left (c x^n\right )\right )}{9 t}+\frac {b e n q s (h s-g t)^2 \log (g+h x)}{6 h^2 t}+\frac {b e n q (h s-g t)^3 \log (g+h x)}{9 h^3 t}-\frac {b e n s^2 (g+h x) \log \left (f (g+h x)^q\right )}{3 h}-\frac {b n s (s+t x)^2 \left (d+e \log \left (f (g+h x)^q\right )\right )}{6 t}-\frac {b n (s+t x)^3 \left (d+e \log \left (f (g+h x)^q\right )\right )}{9 t}-\frac {b n s^3 \log \left (-\frac {h x}{g}\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )}{3 t}+\frac {(s+t x)^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )}{3 t}-\frac {e q (h s-g t)^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {h x}{g}\right )}{3 h^3 t}-\frac {b e n q (h s-g t)^3 \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )}{3 h^3 t}-\frac {b e n q s^3 \operatorname {PolyLog}\left (2,1+\frac {h x}{g}\right )}{3 t} \] Output:

-1/3*b*d*n*s^2*x+4/9*b*e*n*q*s^2*x+1/3*b*e*n*q*s*(-g*t+h*s)*x/h-1/3*a*e*q* 
(-g*t+h*s)^2*x/h^2+4/9*b*e*n*q*(-g*t+h*s)^2*x/h^2+5/36*b*e*n*q*s*(t*x+s)^2 
/t+5/36*b*e*n*q*(-g*t+h*s)*(t*x+s)^2/h/t+2/27*b*e*n*q*(t*x+s)^3/t+1/9*b*e* 
n*q*s^3*ln(x)/t+1/6*b*e*n*q*s^2*(-g*t+h*s)*ln(x)/h/t-1/3*b*e*q*(-g*t+h*s)^ 
2*x*ln(c*x^n)/h^2-1/6*e*q*(-g*t+h*s)*(t*x+s)^2*(a+b*ln(c*x^n))/h/t-1/9*e*q 
*(t*x+s)^3*(a+b*ln(c*x^n))/t+1/6*b*e*n*q*s*(-g*t+h*s)^2*ln(h*x+g)/h^2/t+1/ 
9*b*e*n*q*(-g*t+h*s)^3*ln(h*x+g)/h^3/t-1/3*b*e*n*s^2*(h*x+g)*ln(f*(h*x+g)^ 
q)/h-1/6*b*n*s*(t*x+s)^2*(d+e*ln(f*(h*x+g)^q))/t-1/9*b*n*(t*x+s)^3*(d+e*ln 
(f*(h*x+g)^q))/t-1/3*b*n*s^3*ln(-h*x/g)*(d+e*ln(f*(h*x+g)^q))/t+1/3*(t*x+s 
)^3*(a+b*ln(c*x^n))*(d+e*ln(f*(h*x+g)^q))/t-1/3*e*q*(-g*t+h*s)^3*(a+b*ln(c 
*x^n))*ln(1+h*x/g)/h^3/t-1/3*b*e*n*q*(-g*t+h*s)^3*polylog(2,-h*x/g)/h^3/t- 
1/3*b*e*n*q*s^3*polylog(2,1+h*x/g)/t
 

Mathematica [A] (verified)

Time = 1.02 (sec) , antiderivative size = 816, normalized size of antiderivative = 1.34 \[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=a d s^2 x-b d n s^2 x-a e q s^2 x+2 b e n q s^2 x+\frac {a e g q s t x}{h}-\frac {3 b e g n q s t x}{2 h}-\frac {a e g^2 q t^2 x}{3 h^2}+\frac {4 b e g^2 n q t^2 x}{9 h^2}+a d s t x^2-\frac {1}{2} b d n s t x^2-\frac {1}{2} a e q s t x^2+\frac {1}{2} b e n q s t x^2+\frac {a e g q t^2 x^2}{6 h}-\frac {5 b e g n q t^2 x^2}{36 h}+\frac {1}{3} a d t^2 x^3-\frac {1}{9} b d n t^2 x^3-\frac {1}{9} a e q t^2 x^3+\frac {2}{27} b e n q t^2 x^3+\frac {a e g q s^2 \log (g+h x)}{h}-\frac {b e g n q s^2 \log (g+h x)}{h}-\frac {a e g^2 q s t \log (g+h x)}{h^2}+\frac {b e g^2 n q s t \log (g+h x)}{2 h^2}+\frac {a e g^3 q t^2 \log (g+h x)}{3 h^3}-\frac {b e g^3 n q t^2 \log (g+h x)}{9 h^3}-\frac {b e g n q s^2 \log (x) \log (g+h x)}{h}+\frac {b e g^2 n q s t \log (x) \log (g+h x)}{h^2}-\frac {b e g^3 n q t^2 \log (x) \log (g+h x)}{3 h^3}+a e s^2 x \log \left (f (g+h x)^q\right )-b e n s^2 x \log \left (f (g+h x)^q\right )+a e s t x^2 \log \left (f (g+h x)^q\right )-\frac {1}{2} b e n s t x^2 \log \left (f (g+h x)^q\right )+\frac {1}{3} a e t^2 x^3 \log \left (f (g+h x)^q\right )-\frac {1}{9} b e n t^2 x^3 \log \left (f (g+h x)^q\right )+\frac {b \log \left (c x^n\right ) \left (6 e g q \left (3 h^2 s^2-3 g h s t+g^2 t^2\right ) \log (g+h x)+h x \left (6 d h^2 \left (3 s^2+3 s t x+t^2 x^2\right )-e q \left (6 g^2 t^2-3 g h t (6 s+t x)+h^2 \left (18 s^2+9 s t x+2 t^2 x^2\right )\right )+6 e h^2 \left (3 s^2+3 s t x+t^2 x^2\right ) \log \left (f (g+h x)^q\right )\right )\right )}{18 h^3}+\frac {b e g n q s^2 \log (x) \log \left (1+\frac {h x}{g}\right )}{h}-\frac {b e g^2 n q s t \log (x) \log \left (1+\frac {h x}{g}\right )}{h^2}+\frac {b e g^3 n q t^2 \log (x) \log \left (1+\frac {h x}{g}\right )}{3 h^3}+\frac {b e g n q \left (3 h^2 s^2-3 g h s t+g^2 t^2\right ) \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )}{3 h^3} \] Input:

Integrate[(s + t*x)^2*(a + b*Log[c*x^n])*(d + e*Log[f*(g + h*x)^q]),x]
 

Output:

a*d*s^2*x - b*d*n*s^2*x - a*e*q*s^2*x + 2*b*e*n*q*s^2*x + (a*e*g*q*s*t*x)/ 
h - (3*b*e*g*n*q*s*t*x)/(2*h) - (a*e*g^2*q*t^2*x)/(3*h^2) + (4*b*e*g^2*n*q 
*t^2*x)/(9*h^2) + a*d*s*t*x^2 - (b*d*n*s*t*x^2)/2 - (a*e*q*s*t*x^2)/2 + (b 
*e*n*q*s*t*x^2)/2 + (a*e*g*q*t^2*x^2)/(6*h) - (5*b*e*g*n*q*t^2*x^2)/(36*h) 
 + (a*d*t^2*x^3)/3 - (b*d*n*t^2*x^3)/9 - (a*e*q*t^2*x^3)/9 + (2*b*e*n*q*t^ 
2*x^3)/27 + (a*e*g*q*s^2*Log[g + h*x])/h - (b*e*g*n*q*s^2*Log[g + h*x])/h 
- (a*e*g^2*q*s*t*Log[g + h*x])/h^2 + (b*e*g^2*n*q*s*t*Log[g + h*x])/(2*h^2 
) + (a*e*g^3*q*t^2*Log[g + h*x])/(3*h^3) - (b*e*g^3*n*q*t^2*Log[g + h*x])/ 
(9*h^3) - (b*e*g*n*q*s^2*Log[x]*Log[g + h*x])/h + (b*e*g^2*n*q*s*t*Log[x]* 
Log[g + h*x])/h^2 - (b*e*g^3*n*q*t^2*Log[x]*Log[g + h*x])/(3*h^3) + a*e*s^ 
2*x*Log[f*(g + h*x)^q] - b*e*n*s^2*x*Log[f*(g + h*x)^q] + a*e*s*t*x^2*Log[ 
f*(g + h*x)^q] - (b*e*n*s*t*x^2*Log[f*(g + h*x)^q])/2 + (a*e*t^2*x^3*Log[f 
*(g + h*x)^q])/3 - (b*e*n*t^2*x^3*Log[f*(g + h*x)^q])/9 + (b*Log[c*x^n]*(6 
*e*g*q*(3*h^2*s^2 - 3*g*h*s*t + g^2*t^2)*Log[g + h*x] + h*x*(6*d*h^2*(3*s^ 
2 + 3*s*t*x + t^2*x^2) - e*q*(6*g^2*t^2 - 3*g*h*t*(6*s + t*x) + h^2*(18*s^ 
2 + 9*s*t*x + 2*t^2*x^2)) + 6*e*h^2*(3*s^2 + 3*s*t*x + t^2*x^2)*Log[f*(g + 
 h*x)^q])))/(18*h^3) + (b*e*g*n*q*s^2*Log[x]*Log[1 + (h*x)/g])/h - (b*e*g^ 
2*n*q*s*t*Log[x]*Log[1 + (h*x)/g])/h^2 + (b*e*g^3*n*q*t^2*Log[x]*Log[1 + ( 
h*x)/g])/(3*h^3) + (b*e*g*n*q*(3*h^2*s^2 - 3*g*h*s*t + g^2*t^2)*PolyLog[2, 
 -((h*x)/g)])/(3*h^3)
 

Rubi [A] (verified)

Time = 2.35 (sec) , antiderivative size = 830, normalized size of antiderivative = 1.37, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {2890, 2889, 25, 27, 25, 2863, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx\)

\(\Big \downarrow \) 2890

\(\displaystyle \frac {\int (s+t x)^2 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )d(s+t x)}{t}\)

\(\Big \downarrow \) 2889

\(\displaystyle \frac {-\frac {e h q \int \frac {t (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{\left (g-\frac {h s}{t}\right ) t+h (s+t x)}d(s+t x)}{3 t}-\frac {b n \int \frac {(s+t x)^3 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{x}d(s+t x)}{3 t}+\frac {1}{3} (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {-\frac {e h q \int \frac {t (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{\left (g-\frac {h s}{t}\right ) t+h (s+t x)}d(s+t x)}{3 t}+\frac {b n \int -\frac {(s+t x)^3 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{x}d(s+t x)}{3 t}+\frac {1}{3} (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {-\frac {1}{3} e h q \int -\frac {(s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{h s-g t-h (s+t x)}d(s+t x)+\frac {1}{3} b n \int -\frac {(s+t x)^3 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t x}d(s+t x)+\frac {1}{3} (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {1}{3} e h q \int \frac {(s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{h s-g t-h (s+t x)}d(s+t x)+\frac {1}{3} b n \int -\frac {(s+t x)^3 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t x}d(s+t x)+\frac {1}{3} (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t}\)

\(\Big \downarrow \) 2863

\(\displaystyle \frac {\frac {1}{3} e h q \int \left (\frac {\left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) (h s-g t)^3}{h^3 (h s-g t-h (s+t x))}-\frac {\left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) (h s-g t)^2}{h^3}-\frac {(s+t x)^2 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{h}+\frac {(g t-h s) (s+t x) \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{h^2}\right )d(s+t x)+\frac {1}{3} b n \int \left (-\frac {\left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) s^3}{t x}-\left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) s^2-(s+t x) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) s-(s+t x)^2 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )\right )d(s+t x)+\frac {1}{3} (s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )}{t}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{3} \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) (s+t x)^3+\frac {1}{3} e h q \left (\frac {b n \log (-t x) s^3}{3 h}+\frac {b n (s+t x) s^2}{3 h}+\frac {b n (h s-g t) \log (-t x) s^2}{2 h^2}+\frac {b n (s+t x)^2 s}{6 h}+\frac {b n (h s-g t) (s+t x) s}{2 h^2}+\frac {b n (s+t x)^3}{9 h}+\frac {b n (h s-g t) (s+t x)^2}{4 h^2}+\frac {b n (h s-g t)^2 (s+t x)}{h^3}-\frac {a (h s-g t)^2 (s+t x)}{h^3}-\frac {b t (h s-g t)^2 x \log \left (c x^n\right )}{h^3}-\frac {(s+t x)^3 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{3 h}-\frac {(h s-g t) (s+t x)^2 \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{2 h^2}-\frac {(h s-g t)^3 \log \left (-\frac {h s-g t-h (s+t x)}{g t}\right ) \left (a+b \log \left (c \left (\frac {s+t x}{t}-\frac {s}{t}\right )^n\right )\right )}{h^4}-\frac {b n (h s-g t)^3 \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )}{h^4}\right )+\frac {1}{3} b n \left (-\log \left (-\frac {h x}{g}\right ) \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) s^3-e q \operatorname {PolyLog}\left (2,\frac {h x}{g}+1\right ) s^3-d (s+t x) s^2+e q (s+t x) s^2+\frac {e (h s-g t-h (s+t x)) \log \left (f (g+h x)^q\right ) s^2}{h}+\frac {1}{4} e q (s+t x)^2 s+\frac {e q (h s-g t) (s+t x) s}{2 h}+\frac {e q (h s-g t)^2 \log (h s-g t-h (s+t x)) s}{2 h^2}-\frac {1}{2} (s+t x)^2 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right ) s+\frac {1}{9} e q (s+t x)^3+\frac {e q (h s-g t) (s+t x)^2}{6 h}+\frac {e q (h s-g t)^2 (s+t x)}{3 h^2}+\frac {e q (h s-g t)^3 \log (h s-g t-h (s+t x))}{3 h^3}-\frac {1}{3} (s+t x)^3 \left (d+e \log \left (f \left (g+\frac {h (s+t x)}{t}-\frac {h s}{t}\right )^q\right )\right )\right )}{t}\)

Input:

Int[(s + t*x)^2*(a + b*Log[c*x^n])*(d + e*Log[f*(g + h*x)^q]),x]
 

Output:

(((s + t*x)^3*(a + b*Log[c*(-(s/t) + (s + t*x)/t)^n])*(d + e*Log[f*(g - (h 
*s)/t + (h*(s + t*x))/t)^q]))/3 + (e*h*q*((b*n*s^2*(s + t*x))/(3*h) + (b*n 
*s*(h*s - g*t)*(s + t*x))/(2*h^2) - (a*(h*s - g*t)^2*(s + t*x))/h^3 + (b*n 
*(h*s - g*t)^2*(s + t*x))/h^3 + (b*n*s*(s + t*x)^2)/(6*h) + (b*n*(h*s - g* 
t)*(s + t*x)^2)/(4*h^2) + (b*n*(s + t*x)^3)/(9*h) + (b*n*s^3*Log[-(t*x)])/ 
(3*h) + (b*n*s^2*(h*s - g*t)*Log[-(t*x)])/(2*h^2) - (b*t*(h*s - g*t)^2*x*L 
og[c*x^n])/h^3 - ((h*s - g*t)*(s + t*x)^2*(a + b*Log[c*(-(s/t) + (s + t*x) 
/t)^n]))/(2*h^2) - ((s + t*x)^3*(a + b*Log[c*(-(s/t) + (s + t*x)/t)^n]))/( 
3*h) - ((h*s - g*t)^3*Log[-((h*s - g*t - h*(s + t*x))/(g*t))]*(a + b*Log[c 
*(-(s/t) + (s + t*x)/t)^n]))/h^4 - (b*n*(h*s - g*t)^3*PolyLog[2, -((h*x)/g 
)])/h^4))/3 + (b*n*(-(d*s^2*(s + t*x)) + e*q*s^2*(s + t*x) + (e*q*s*(h*s - 
 g*t)*(s + t*x))/(2*h) + (e*q*(h*s - g*t)^2*(s + t*x))/(3*h^2) + (e*q*s*(s 
 + t*x)^2)/4 + (e*q*(h*s - g*t)*(s + t*x)^2)/(6*h) + (e*q*(s + t*x)^3)/9 + 
 (e*s^2*(h*s - g*t - h*(s + t*x))*Log[f*(g + h*x)^q])/h + (e*q*s*(h*s - g* 
t)^2*Log[h*s - g*t - h*(s + t*x)])/(2*h^2) + (e*q*(h*s - g*t)^3*Log[h*s - 
g*t - h*(s + t*x)])/(3*h^3) - (s*(s + t*x)^2*(d + e*Log[f*(g - (h*s)/t + ( 
h*(s + t*x))/t)^q]))/2 - ((s + t*x)^3*(d + e*Log[f*(g - (h*s)/t + (h*(s + 
t*x))/t)^q]))/3 - s^3*Log[-((h*x)/g)]*(d + e*Log[f*(g - (h*s)/t + (h*(s + 
t*x))/t)^q]) - e*q*s^3*PolyLog[2, 1 + (h*x)/g]))/3)/t
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2863
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((h_.)*(x_)) 
^(m_.)*((f_) + (g_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a 
 + b*Log[c*(d + e*x)^n])^p, (h*x)^m*(f + g*x^r)^q, x], x] /; FreeQ[{a, b, c 
, d, e, f, g, h, m, n, p, q, r}, x] && IntegerQ[m] && IntegerQ[q]
 

rule 2889
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log 
[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*(g_.))*(x_)^(r_.), x_Symbol] :> Simp[x^( 
r + 1)*(a + b*Log[c*(d + e*x)^n])^p*((f + g*Log[h*(i + j*x)^m])/(r + 1)), x 
] + (-Simp[g*j*(m/(r + 1))   Int[x^(r + 1)*((a + b*Log[c*(d + e*x)^n])^p/(i 
 + j*x)), x], x] - Simp[b*e*n*(p/(r + 1))   Int[x^(r + 1)*(a + b*Log[c*(d + 
 e*x)^n])^(p - 1)*((f + g*Log[h*(i + j*x)^m])/(d + e*x)), x], x]) /; FreeQ[ 
{a, b, c, d, e, f, g, h, i, j, m, n}, x] && IGtQ[p, 0] && IntegerQ[r] && (E 
qQ[p, 1] || GtQ[r, 0]) && NeQ[r, -1]
 

rule 2890
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + Log[(h_.) 
*((i_.) + (j_.)*(x_))^(m_.)]*(g_.))*((k_) + (l_.)*(x_))^(r_.), x_Symbol] :> 
 Simp[1/l   Subst[Int[x^r*(a + b*Log[c*(-(e*k - d*l)/l + e*(x/l))^n])*(f + 
g*Log[h*(-(j*k - i*l)/l + j*(x/l))^m]), x], x, k + l*x], x] /; FreeQ[{a, b, 
 c, d, e, f, g, h, i, j, k, l, m, n}, x] && IntegerQ[r]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.18 (sec) , antiderivative size = 2779, normalized size of antiderivative = 4.58

\[\text {Expression too large to display}\]

Input:

int((t*x+s)^2*(a+b*ln(c*x^n))*(d+e*ln(f*(h*x+g)^q)),x)
 

Output:

(1/3*(t*x+s)^3*b*e/t*ln(x^n)-1/18*e*(9*I*Pi*b*s^2*csgn(I*x^n)*csgn(I*c*x^n 
)*csgn(I*c)*t*x+9*I*Pi*b*s*t^2*x^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+9*I 
*Pi*b*s*t^2*x^2*csgn(I*c*x^n)^3+3*I*Pi*b*t^3*x^3*csgn(I*x^n)*csgn(I*c*x^n) 
*csgn(I*c)+9*I*Pi*b*s^2*csgn(I*c*x^n)^3*t*x+3*I*Pi*b*t^3*x^3*csgn(I*c*x^n) 
^3-9*I*Pi*b*s*t^2*x^2*csgn(I*c*x^n)^2*csgn(I*c)-9*I*Pi*b*s*t^2*x^2*csgn(I* 
x^n)*csgn(I*c*x^n)^2-3*I*Pi*b*t^3*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2-3*I*Pi*b 
*t^3*x^3*csgn(I*c*x^n)^2*csgn(I*c)-9*I*Pi*b*s^2*csgn(I*x^n)*csgn(I*c*x^n)^ 
2*t*x-9*I*Pi*b*s^2*csgn(I*c*x^n)^2*csgn(I*c)*t*x-6*ln(c)*b*t^3*x^3+2*b*n*t 
^3*x^3-18*ln(c)*b*s*t^2*x^2-6*a*t^3*x^3+9*b*n*s*t^2*x^2+6*b*n*s^3*ln(x)-18 
*ln(c)*b*s^2*t*x-18*a*s*t^2*x^2+18*b*n*s^2*t*x-18*a*s^2*t*x)/t)*ln((h*x+g) 
^q)-5/4*q/h^2*b*e*t*n*g^2*s+(1/4*I*e*Pi*csgn(I*(h*x+g)^q)*csgn(I*f*(h*x+g) 
^q)^2-1/4*I*e*Pi*csgn(I*(h*x+g)^q)*csgn(I*f*(h*x+g)^q)*csgn(I*f)-1/4*I*e*P 
i*csgn(I*f*(h*x+g)^q)^3+1/4*I*e*Pi*csgn(I*f*(h*x+g)^q)^2*csgn(I*f)+1/2*ln( 
f)*e+1/2*d)*(1/3*(I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*csgn(I*x^n)*cs 
gn(I*c*x^n)*csgn(I*c)-I*Pi*b*csgn(I*c*x^n)^3+I*Pi*b*csgn(I*c*x^n)^2*csgn(I 
*c)+2*b*ln(c)+2*a)*(t*x+s)^3/t+2*b*(1/3*ln(x^n)*t^2*x^3+ln(x^n)*t*x^2*s+ln 
(x^n)*x*s^2+1/3*ln(x^n)/t*s^3-1/3/t*n*(1/3*t^3*x^3+3/2*s*t^2*x^2+3*s^2*t*x 
+s^3*ln(x))))+2/27*b*e*n*q*t^2*x^3-1/2*a*e*q*s*t*x^2+1/2*b*e*n*q*s*t*x^2-a 
*e*q*s^2*x-1/9*a*e*q*t^2*x^3+1/12*I*q/h*e*Pi*x^2*b*g*t^2*csgn(I*x^n)*csgn( 
I*c*x^n)^2+1/12*I*q/h*e*Pi*x^2*b*g*t^2*csgn(I*c*x^n)^2*csgn(I*c)-1/3*q/...
 

Fricas [F]

\[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=\int { {\left (t x + s\right )}^{2} {\left (e \log \left ({\left (h x + g\right )}^{q} f\right ) + d\right )} {\left (b \log \left (c x^{n}\right ) + a\right )} \,d x } \] Input:

integrate((t*x+s)^2*(a+b*log(c*x^n))*(d+e*log(f*(h*x+g)^q)),x, algorithm=" 
fricas")
 

Output:

integral(a*d*t^2*x^2 + 2*a*d*s*t*x + a*d*s^2 + (a*e*t^2*x^2 + 2*a*e*s*t*x 
+ a*e*s^2 + (b*e*t^2*x^2 + 2*b*e*s*t*x + b*e*s^2)*log(c*x^n))*log((h*x + g 
)^q*f) + (b*d*t^2*x^2 + 2*b*d*s*t*x + b*d*s^2)*log(c*x^n), x)
 

Sympy [F(-1)]

Timed out. \[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=\text {Timed out} \] Input:

integrate((t*x+s)**2*(a+b*ln(c*x**n))*(d+e*ln(f*(h*x+g)**q)),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 961, normalized size of antiderivative = 1.58 \[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=\text {Too large to display} \] Input:

integrate((t*x+s)^2*(a+b*log(c*x^n))*(d+e*log(f*(h*x+g)^q)),x, algorithm=" 
maxima")
 

Output:

-1/9*b*d*n*t^2*x^3 + 1/3*a*e*t^2*x^3*log((h*x + g)^q*f) + 1/3*b*d*t^2*x^3* 
log(c*x^n) - 1/2*b*d*n*s*t*x^2 + 1/3*a*d*t^2*x^3 - a*e*h*q*s^2*(x/h - g*lo 
g(h*x + g)/h^2) + 1/18*a*e*h*q*t^2*(6*g^3*log(h*x + g)/h^4 - (2*h^2*x^3 - 
3*g*h*x^2 + 6*g^2*x)/h^3) - 1/2*a*e*h*q*s*t*(2*g^2*log(h*x + g)/h^3 + (h*x 
^2 - 2*g*x)/h^2) + a*e*s*t*x^2*log((h*x + g)^q*f) + b*d*s*t*x^2*log(c*x^n) 
 - b*d*n*s^2*x + a*d*s*t*x^2 + a*e*s^2*x*log((h*x + g)^q*f) + b*d*s^2*x*lo 
g(c*x^n) + a*d*s^2*x + 1/3*(3*g*h^2*n*q*s^2 - 3*g^2*h*n*q*s*t + g^3*n*q*t^ 
2)*(log(h*x/g + 1)*log(x) + dilog(-h*x/g))*b*e/h^3 + 1/18*(6*(3*g*h^2*q*s^ 
2 - 3*g^2*h*q*s*t + g^3*q*t^2)*e*log(c) - (18*g*h^2*n*q*s^2 - 9*g^2*h*n*q* 
s*t + 2*g^3*n*q*t^2)*e)*b*log(h*x + g)/h^3 - 1/108*(4*(3*(h^3*q*t^2 - 3*h^ 
3*t^2*log(f))*e*log(c) - (2*h^3*n*q*t^2 - 3*h^3*n*t^2*log(f))*e)*b*x^3 + 3 
6*(3*g*h^2*n*q*s^2 - 3*g^2*h*n*q*s*t + g^3*n*q*t^2)*b*e*log(h*x + g)*log(x 
) + 3*(6*(3*h^3*q*s*t - g*h^2*q*t^2 - 6*h^3*s*t*log(f))*e*log(c) - (18*h^3 
*n*q*s*t - 5*g*h^2*n*q*t^2 - 18*h^3*n*s*t*log(f))*e)*b*x^2 + 6*(6*(3*h^3*q 
*s^2 - 3*g*h^2*q*s*t + g^2*h*q*t^2 - 3*h^3*s^2*log(f))*e*log(c) - (36*h^3* 
n*q*s^2 - 27*g*h^2*n*q*s*t + 8*g^2*h*n*q*t^2 - 18*h^3*n*s^2*log(f))*e)*b*x 
 + 6*(2*(e*h^3*n*t^2 - 3*e*h^3*t^2*log(c))*b*x^3 + 9*(e*h^3*n*s*t - 2*e*h^ 
3*s*t*log(c))*b*x^2 + 18*(e*h^3*n*s^2 - e*h^3*s^2*log(c))*b*x - 6*(b*e*h^3 
*t^2*x^3 + 3*b*e*h^3*s*t*x^2 + 3*b*e*h^3*s^2*x)*log(x^n))*log((h*x + g)^q) 
 + 6*(2*(h^3*q*t^2 - 3*h^3*t^2*log(f))*b*e*x^3 + 3*(3*h^3*q*s*t - g*h^2...
 

Giac [F]

\[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=\int { {\left (t x + s\right )}^{2} {\left (e \log \left ({\left (h x + g\right )}^{q} f\right ) + d\right )} {\left (b \log \left (c x^{n}\right ) + a\right )} \,d x } \] Input:

integrate((t*x+s)^2*(a+b*log(c*x^n))*(d+e*log(f*(h*x+g)^q)),x, algorithm=" 
giac")
 

Output:

integrate((t*x + s)^2*(e*log((h*x + g)^q*f) + d)*(b*log(c*x^n) + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx=\int {\left (s+t\,x\right )}^2\,\left (d+e\,\ln \left (f\,{\left (g+h\,x\right )}^q\right )\right )\,\left (a+b\,\ln \left (c\,x^n\right )\right ) \,d x \] Input:

int((s + t*x)^2*(d + e*log(f*(g + h*x)^q))*(a + b*log(c*x^n)),x)
 

Output:

int((s + t*x)^2*(d + e*log(f*(g + h*x)^q))*(a + b*log(c*x^n)), x)
 

Reduce [F]

\[ \int (s+t x)^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx =\text {Too large to display} \] Input:

int((t*x+s)^2*(a+b*log(c*x^n))*(d+e*log(f*(h*x+g)^q)),x)
 

Output:

( - 36*int(log(x**n*c)/(g*x + h*x**2),x)*b*e*g**4*n*q*t**2 + 108*int(log(x 
**n*c)/(g*x + h*x**2),x)*b*e*g**3*h*n*q*s*t - 108*int(log(x**n*c)/(g*x + h 
*x**2),x)*b*e*g**2*h**2*n*q*s**2 + 108*log((g + h*x)**q*f)*log(x**n*c)*b*e 
*h**3*n*s**2*x + 108*log((g + h*x)**q*f)*log(x**n*c)*b*e*h**3*n*s*t*x**2 + 
 36*log((g + h*x)**q*f)*log(x**n*c)*b*e*h**3*n*t**2*x**3 + 36*log((g + h*x 
)**q*f)*a*e*g**3*n*t**2 - 108*log((g + h*x)**q*f)*a*e*g**2*h*n*s*t + 108*l 
og((g + h*x)**q*f)*a*e*g*h**2*n*s**2 + 108*log((g + h*x)**q*f)*a*e*h**3*n* 
s**2*x + 108*log((g + h*x)**q*f)*a*e*h**3*n*s*t*x**2 + 36*log((g + h*x)**q 
*f)*a*e*h**3*n*t**2*x**3 - 12*log((g + h*x)**q*f)*b*e*g**3*n**2*t**2 + 54* 
log((g + h*x)**q*f)*b*e*g**2*h*n**2*s*t - 108*log((g + h*x)**q*f)*b*e*g*h* 
*2*n**2*s**2 - 108*log((g + h*x)**q*f)*b*e*h**3*n**2*s**2*x - 54*log((g + 
h*x)**q*f)*b*e*h**3*n**2*s*t*x**2 - 12*log((g + h*x)**q*f)*b*e*h**3*n**2*t 
**2*x**3 + 18*log(x**n*c)**2*b*e*g**3*q*t**2 - 54*log(x**n*c)**2*b*e*g**2* 
h*q*s*t + 54*log(x**n*c)**2*b*e*g*h**2*q*s**2 + 108*log(x**n*c)*b*d*h**3*n 
*s**2*x + 108*log(x**n*c)*b*d*h**3*n*s*t*x**2 + 36*log(x**n*c)*b*d*h**3*n* 
t**2*x**3 - 36*log(x**n*c)*b*e*g**2*h*n*q*t**2*x + 108*log(x**n*c)*b*e*g*h 
**2*n*q*s*t*x + 18*log(x**n*c)*b*e*g*h**2*n*q*t**2*x**2 - 108*log(x**n*c)* 
b*e*h**3*n*q*s**2*x - 54*log(x**n*c)*b*e*h**3*n*q*s*t*x**2 - 12*log(x**n*c 
)*b*e*h**3*n*q*t**2*x**3 + 108*a*d*h**3*n*s**2*x + 108*a*d*h**3*n*s*t*x**2 
 + 36*a*d*h**3*n*t**2*x**3 - 36*a*e*g**2*h*n*q*t**2*x + 108*a*e*g*h**2*...