\(\int x^2 (a+b \log (c x^n)) \log (d (e+f x)^m) \, dx\) [77]

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 = 24, antiderivative size = 243 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right ) \, dx=\frac {4 b e^2 m n x}{9 f^2}-\frac {5 b e m n x^2}{36 f}+\frac {2}{27} b m n x^3-\frac {e^2 m x \left (a+b \log \left (c x^n\right )\right )}{3 f^2}+\frac {e m x^2 \left (a+b \log \left (c x^n\right )\right )}{6 f}-\frac {1}{9} m x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {b e^3 m n \log (e+f x)}{9 f^3}-\frac {b e^3 m n \log \left (-\frac {f x}{e}\right ) \log (e+f x)}{3 f^3}+\frac {e^3 m \left (a+b \log \left (c x^n\right )\right ) \log (e+f x)}{3 f^3}-\frac {1}{9} b n x^3 \log \left (d (e+f x)^m\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right )-\frac {b e^3 m n \operatorname {PolyLog}\left (2,1+\frac {f x}{e}\right )}{3 f^3} \] Output:

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

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.04 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right ) \, dx=\frac {-36 a e^2 f m x+48 b e^2 f m n x+18 a e f^2 m x^2-15 b e f^2 m n x^2-12 a f^3 m x^3+8 b f^3 m n x^3+36 a e^3 m \log (e+f x)-12 b e^3 m n \log (e+f x)-36 b e^3 m n \log (x) \log (e+f x)+36 a f^3 x^3 \log \left (d (e+f x)^m\right )-12 b f^3 n x^3 \log \left (d (e+f x)^m\right )-6 b \log \left (c x^n\right ) \left (f m x \left (6 e^2-3 e f x+2 f^2 x^2\right )-6 e^3 m \log (e+f x)-6 f^3 x^3 \log \left (d (e+f x)^m\right )\right )+36 b e^3 m n \log (x) \log \left (1+\frac {f x}{e}\right )+36 b e^3 m n \operatorname {PolyLog}\left (2,-\frac {f x}{e}\right )}{108 f^3} \] Input:

Integrate[x^2*(a + b*Log[c*x^n])*Log[d*(e + f*x)^m],x]
 

Output:

(-36*a*e^2*f*m*x + 48*b*e^2*f*m*n*x + 18*a*e*f^2*m*x^2 - 15*b*e*f^2*m*n*x^ 
2 - 12*a*f^3*m*x^3 + 8*b*f^3*m*n*x^3 + 36*a*e^3*m*Log[e + f*x] - 12*b*e^3* 
m*n*Log[e + f*x] - 36*b*e^3*m*n*Log[x]*Log[e + f*x] + 36*a*f^3*x^3*Log[d*( 
e + f*x)^m] - 12*b*f^3*n*x^3*Log[d*(e + f*x)^m] - 6*b*Log[c*x^n]*(f*m*x*(6 
*e^2 - 3*e*f*x + 2*f^2*x^2) - 6*e^3*m*Log[e + f*x] - 6*f^3*x^3*Log[d*(e + 
f*x)^m]) + 36*b*e^3*m*n*Log[x]*Log[1 + (f*x)/e] + 36*b*e^3*m*n*PolyLog[2, 
-((f*x)/e)])/(108*f^3)
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 234, normalized size of antiderivative = 0.96, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {2823, 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 x^2 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right ) \, dx\)

\(\Big \downarrow \) 2823

\(\displaystyle -b n \int \left (\frac {m \log (e+f x) e^3}{3 f^3 x}-\frac {m e^2}{3 f^2}+\frac {m x e}{6 f}-\frac {m x^2}{9}+\frac {1}{3} x^2 \log \left (d (e+f x)^m\right )\right )dx+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right )+\frac {e^3 m \log (e+f x) \left (a+b \log \left (c x^n\right )\right )}{3 f^3}-\frac {e^2 m x \left (a+b \log \left (c x^n\right )\right )}{3 f^2}+\frac {e m x^2 \left (a+b \log \left (c x^n\right )\right )}{6 f}-\frac {1}{9} m x^3 \left (a+b \log \left (c x^n\right )\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right )+\frac {e^3 m \log (e+f x) \left (a+b \log \left (c x^n\right )\right )}{3 f^3}-\frac {e^2 m x \left (a+b \log \left (c x^n\right )\right )}{3 f^2}+\frac {e m x^2 \left (a+b \log \left (c x^n\right )\right )}{6 f}-\frac {1}{9} m x^3 \left (a+b \log \left (c x^n\right )\right )-b n \left (\frac {1}{9} x^3 \log \left (d (e+f x)^m\right )+\frac {e^3 m \operatorname {PolyLog}\left (2,\frac {f x}{e}+1\right )}{3 f^3}+\frac {e^3 m \log (e+f x)}{9 f^3}+\frac {e^3 m \log \left (-\frac {f x}{e}\right ) \log (e+f x)}{3 f^3}-\frac {4 e^2 m x}{9 f^2}+\frac {5 e m x^2}{36 f}-\frac {2 m x^3}{27}\right )\)

Input:

Int[x^2*(a + b*Log[c*x^n])*Log[d*(e + f*x)^m],x]
 

Output:

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

Defintions of rubi rules used

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

rule 2823
Int[Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_. 
)]*(b_.))*((g_.)*(x_))^(q_.), x_Symbol] :> With[{u = IntHide[(g*x)^q*Log[d* 
(e + f*x^m)^r], x]}, Simp[(a + b*Log[c*x^n])   u, x] - Simp[b*n   Int[1/x 
 u, x], x]] /; FreeQ[{a, b, c, d, e, f, g, r, m, n, q}, x] && (IntegerQ[(q 
+ 1)/m] || (RationalQ[m] && RationalQ[q])) && NeQ[q, -1]
 
Maple [C] (warning: unable to verify)

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

Time = 72.41 (sec) , antiderivative size = 1067, normalized size of antiderivative = 4.39

method result size
risch \(\text {Expression too large to display}\) \(1067\)

Input:

int(x^2*(a+b*ln(c*x^n))*ln(d*(f*x+e)^m),x,method=_RETURNVERBOSE)
 

Output:

-1/9*x^3*ln(c)*b*m+(-1/4*I*Pi*csgn(I*d)*csgn(I*(f*x+e)^m)*csgn(I*d*(f*x+e) 
^m)+1/4*I*Pi*csgn(I*d)*csgn(I*d*(f*x+e)^m)^2+1/4*I*Pi*csg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^3*m*n*ln(f*x+e)/f^3-1/3*n*b/f^3*e^3* 
m*dilog(-f*x/e)-1/18*I*m*x^3*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2-1/18*I*m*x^3 
*b*Pi*csgn(I*c*x^n)^2*csgn(I*c)-1/12*I*m/f*x^2*e*b*Pi*csgn(I*x^n)*csgn(I*c 
*x^n)*csgn(I*c)+1/6*I*m/f^2*x*e^2*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c) 
-1/6*I*m/f^3*e^3*ln(f*x+e)*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-1/1...
 

Fricas [F]

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

integrate(x^2*(a+b*log(c*x^n))*log(d*(f*x+e)^m),x, algorithm="fricas")
 

Output:

integral((b*x^2*log(c*x^n) + a*x^2)*log((f*x + e)^m*d), x)
 

Sympy [F(-1)]

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

integrate(x**2*(a+b*ln(c*x**n))*ln(d*(f*x+e)**m),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 328, normalized size of antiderivative = 1.35 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right ) \, dx=\frac {{\left (\log \left (\frac {f x}{e} + 1\right ) \log \left (x\right ) + {\rm Li}_2\left (-\frac {f x}{e}\right )\right )} b e^{3} m n}{3 \, f^{3}} + \frac {{\left (3 \, a e^{3} m - {\left (e^{3} m n - 3 \, e^{3} m \log \left (c\right )\right )} b\right )} \log \left (f x + e\right )}{9 \, f^{3}} - \frac {36 \, b e^{3} m n \log \left (f x + e\right ) \log \left (x\right ) + 4 \, {\left (3 \, {\left (f^{3} m - 3 \, f^{3} \log \left (d\right )\right )} a - {\left (2 \, f^{3} m n - 3 \, f^{3} n \log \left (d\right ) - 3 \, {\left (f^{3} m - 3 \, f^{3} \log \left (d\right )\right )} \log \left (c\right )\right )} b\right )} x^{3} - 3 \, {\left (6 \, a e f^{2} m - {\left (5 \, e f^{2} m n - 6 \, e f^{2} m \log \left (c\right )\right )} b\right )} x^{2} + 12 \, {\left (3 \, a e^{2} f m - {\left (4 \, e^{2} f m n - 3 \, e^{2} f m \log \left (c\right )\right )} b\right )} x - 12 \, {\left (3 \, b f^{3} x^{3} \log \left (x^{n}\right ) + {\left (3 \, a f^{3} - {\left (f^{3} n - 3 \, f^{3} \log \left (c\right )\right )} b\right )} x^{3}\right )} \log \left ({\left (f x + e\right )}^{m}\right ) - 6 \, {\left (3 \, b e f^{2} m x^{2} - 6 \, b e^{2} f m x + 6 \, b e^{3} m \log \left (f x + e\right ) - 2 \, {\left (f^{3} m - 3 \, f^{3} \log \left (d\right )\right )} b x^{3}\right )} \log \left (x^{n}\right )}{108 \, f^{3}} \] Input:

integrate(x^2*(a+b*log(c*x^n))*log(d*(f*x+e)^m),x, algorithm="maxima")
 

Output:

1/3*(log(f*x/e + 1)*log(x) + dilog(-f*x/e))*b*e^3*m*n/f^3 + 1/9*(3*a*e^3*m 
 - (e^3*m*n - 3*e^3*m*log(c))*b)*log(f*x + e)/f^3 - 1/108*(36*b*e^3*m*n*lo 
g(f*x + e)*log(x) + 4*(3*(f^3*m - 3*f^3*log(d))*a - (2*f^3*m*n - 3*f^3*n*l 
og(d) - 3*(f^3*m - 3*f^3*log(d))*log(c))*b)*x^3 - 3*(6*a*e*f^2*m - (5*e*f^ 
2*m*n - 6*e*f^2*m*log(c))*b)*x^2 + 12*(3*a*e^2*f*m - (4*e^2*f*m*n - 3*e^2* 
f*m*log(c))*b)*x - 12*(3*b*f^3*x^3*log(x^n) + (3*a*f^3 - (f^3*n - 3*f^3*lo 
g(c))*b)*x^3)*log((f*x + e)^m) - 6*(3*b*e*f^2*m*x^2 - 6*b*e^2*f*m*x + 6*b* 
e^3*m*log(f*x + e) - 2*(f^3*m - 3*f^3*log(d))*b*x^3)*log(x^n))/f^3
 

Giac [F]

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

integrate(x^2*(a+b*log(c*x^n))*log(d*(f*x+e)^m),x, algorithm="giac")
 

Output:

integrate((b*log(c*x^n) + a)*x^2*log((f*x + e)^m*d), x)
 

Mupad [F(-1)]

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

int(x^2*log(d*(e + f*x)^m)*(a + b*log(c*x^n)),x)
 

Output:

int(x^2*log(d*(e + f*x)^m)*(a + b*log(c*x^n)), x)
 

Reduce [F]

\[ \int x^2 \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right ) \, dx=\frac {-36 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{f \,x^{2}+e x}d x \right ) b \,e^{4} m n +36 \,\mathrm {log}\left (\left (f x +e \right )^{m} d \right ) \mathrm {log}\left (x^{n} c \right ) b \,f^{3} n \,x^{3}+36 \,\mathrm {log}\left (\left (f x +e \right )^{m} d \right ) a \,e^{3} n +36 \,\mathrm {log}\left (\left (f x +e \right )^{m} d \right ) a \,f^{3} n \,x^{3}-12 \,\mathrm {log}\left (\left (f x +e \right )^{m} d \right ) b \,e^{3} n^{2}-12 \,\mathrm {log}\left (\left (f x +e \right )^{m} d \right ) b \,f^{3} n^{2} x^{3}+18 \mathrm {log}\left (x^{n} c \right )^{2} b \,e^{3} m -36 \,\mathrm {log}\left (x^{n} c \right ) b \,e^{2} f m n x +18 \,\mathrm {log}\left (x^{n} c \right ) b e \,f^{2} m n \,x^{2}-12 \,\mathrm {log}\left (x^{n} c \right ) b \,f^{3} m n \,x^{3}-36 a \,e^{2} f m n x +18 a e \,f^{2} m n \,x^{2}-12 a \,f^{3} m n \,x^{3}+48 b \,e^{2} f m \,n^{2} x -15 b e \,f^{2} m \,n^{2} x^{2}+8 b \,f^{3} m \,n^{2} x^{3}}{108 f^{3} n} \] Input:

int(x^2*(a+b*log(c*x^n))*log(d*(f*x+e)^m),x)
 

Output:

( - 36*int(log(x**n*c)/(e*x + f*x**2),x)*b*e**4*m*n + 36*log((e + f*x)**m* 
d)*log(x**n*c)*b*f**3*n*x**3 + 36*log((e + f*x)**m*d)*a*e**3*n + 36*log((e 
 + f*x)**m*d)*a*f**3*n*x**3 - 12*log((e + f*x)**m*d)*b*e**3*n**2 - 12*log( 
(e + f*x)**m*d)*b*f**3*n**2*x**3 + 18*log(x**n*c)**2*b*e**3*m - 36*log(x** 
n*c)*b*e**2*f*m*n*x + 18*log(x**n*c)*b*e*f**2*m*n*x**2 - 12*log(x**n*c)*b* 
f**3*m*n*x**3 - 36*a*e**2*f*m*n*x + 18*a*e*f**2*m*n*x**2 - 12*a*f**3*m*n*x 
**3 + 48*b*e**2*f*m*n**2*x - 15*b*e*f**2*m*n**2*x**2 + 8*b*f**3*m*n**2*x** 
3)/(108*f**3*n)