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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [A] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 207 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=-\frac {2}{81} b^2 e n^2 r x^3+\frac {2}{81} b e n (3 a-b n) r x^3-\frac {1}{81} e \left (9 a^2-6 a b n+2 b^2 n^2\right ) r x^3+\frac {2}{27} b^2 e n r x^3 \log \left (c x^n\right )-\frac {2}{27} b e (3 a-b n) r x^3 \log \left (c x^n\right )-\frac {1}{9} b^2 e r x^3 \log ^2\left (c x^n\right )+\frac {2}{27} b^2 n^2 x^3 \left (d+e \log \left (f x^r\right )\right )-\frac {2}{9} b n x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \] Output:

-2/81*b^2*e*n^2*r*x^3+2/81*b*e*n*(-b*n+3*a)*r*x^3-1/81*e*(2*b^2*n^2-6*a*b* 
n+9*a^2)*r*x^3+2/27*b^2*e*n*r*x^3*ln(c*x^n)-2/27*b*e*(-b*n+3*a)*r*x^3*ln(c 
*x^n)-1/9*b^2*e*r*x^3*ln(c*x^n)^2+2/27*b^2*n^2*x^3*(d+e*ln(f*x^r))-2/9*b*n 
*x^3*(a+b*ln(c*x^n))*(d+e*ln(f*x^r))+1/3*x^3*(a+b*ln(c*x^n))^2*(d+e*ln(f*x 
^r))
 

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 157, normalized size of antiderivative = 0.76 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {1}{27} x^3 \left (9 a^2 d-6 a b d n+2 b^2 d n^2-3 a^2 e r+4 a b e n r-2 b^2 e n^2 r+e \left (9 a^2-6 a b n+2 b^2 n^2\right ) \log \left (f x^r\right )+3 b^2 \log ^2\left (c x^n\right ) \left (3 d-e r+3 e \log \left (f x^r\right )\right )+2 b \log \left (c x^n\right ) \left (9 a d-3 b d n-3 a e r+2 b e n r+(9 a e-3 b e n) \log \left (f x^r\right )\right )\right ) \] Input:

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

Output:

(x^3*(9*a^2*d - 6*a*b*d*n + 2*b^2*d*n^2 - 3*a^2*e*r + 4*a*b*e*n*r - 2*b^2* 
e*n^2*r + e*(9*a^2 - 6*a*b*n + 2*b^2*n^2)*Log[f*x^r] + 3*b^2*Log[c*x^n]^2* 
(3*d - e*r + 3*e*Log[f*x^r]) + 2*b*Log[c*x^n]*(9*a*d - 3*b*d*n - 3*a*e*r + 
 2*b*e*n*r + (9*a*e - 3*b*e*n)*Log[f*x^r])))/27
 

Rubi [A] (verified)

Time = 0.49 (sec) , antiderivative size = 196, normalized size of antiderivative = 0.95, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2813, 27, 2010, 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 )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx\)

\(\Big \downarrow \) 2813

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2010

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-1/27*(e*r*((2*b^2*n^2*x^3)/3 - (2*b*n*(3*a - b*n)*x^3)/3 + ((9*a^2 - 6*a* 
b*n + 2*b^2*n^2)*x^3)/3 - 2*b^2*n*x^3*Log[c*x^n] + 2*b*(3*a - b*n)*x^3*Log 
[c*x^n] + 3*b^2*x^3*Log[c*x^n]^2)) + (2*b^2*n^2*x^3*(d + e*Log[f*x^r]))/27 
 - (2*b*n*x^3*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]))/9 + (x^3*(a + b*Log[c 
*x^n])^2*(d + e*Log[f*x^r]))/3
 

Defintions of rubi rules used

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 2010
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] 
, x] /; FreeQ[{c, m}, x] && SumQ[u] &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) 
+ (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
 

rule 2813
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.) + Log[(f_.)*(x_)^(r_ 
.)]*(e_.))*((g_.)*(x_))^(m_.), x_Symbol] :> With[{u = IntHide[(g*x)^m*(a + 
b*Log[c*x^n])^p, x]}, Simp[(d + e*Log[f*x^r])   u, x] - Simp[e*r   Int[Simp 
lifyIntegrand[u/x, x], x], x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, r}, 
x] &&  !(EqQ[p, 1] && EqQ[a, 0] && NeQ[d, 0])
 
Maple [A] (verified)

Time = 28.77 (sec) , antiderivative size = 319, normalized size of antiderivative = 1.54

method result size
parallelrisch \(-\frac {-4 x^{3} \ln \left (c \,x^{n}\right ) b^{2} e \,n^{10} r -18 x^{3} \ln \left (c \,x^{n}\right ) a b d \,n^{9}+6 x^{3} \ln \left (f \,x^{r}\right ) a b e \,n^{10}+3 x^{3} \ln \left (c \,x^{n}\right )^{2} b^{2} e \,n^{9} r -4 x^{3} a b e \,n^{10} r +6 x^{3} \ln \left (c \,x^{n}\right ) \ln \left (f \,x^{r}\right ) b^{2} e \,n^{10}-9 b^{2} e \ln \left (f \,x^{r}\right ) \ln \left (c \,x^{n}\right )^{2} x^{3} n^{9}-2 x^{3} b^{2} d \,n^{11}-9 x^{3} a^{2} d \,n^{9}+6 x^{3} \ln \left (c \,x^{n}\right ) b^{2} d \,n^{10}-2 x^{3} \ln \left (f \,x^{r}\right ) b^{2} e \,n^{11}-9 x^{3} \ln \left (f \,x^{r}\right ) a^{2} e \,n^{9}-9 x^{3} \ln \left (c \,x^{n}\right )^{2} b^{2} d \,n^{9}+2 x^{3} b^{2} e \,n^{11} r +3 x^{3} a^{2} e \,n^{9} r +6 x^{3} a b d \,n^{10}+6 x^{3} \ln \left (c \,x^{n}\right ) a b e \,n^{9} r -18 x^{3} \ln \left (c \,x^{n}\right ) \ln \left (f \,x^{r}\right ) a b e \,n^{9}}{27 n^{9}}\) \(319\)
risch \(\text {Expression too large to display}\) \(9271\)

Input:

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

Output:

-1/27*(-4*x^3*ln(c*x^n)*b^2*e*n^10*r-18*x^3*ln(c*x^n)*a*b*d*n^9+6*x^3*ln(f 
*x^r)*a*b*e*n^10+3*x^3*ln(c*x^n)^2*b^2*e*n^9*r-4*x^3*a*b*e*n^10*r+6*x^3*ln 
(c*x^n)*ln(f*x^r)*b^2*e*n^10-9*b^2*e*ln(f*x^r)*ln(c*x^n)^2*x^3*n^9-2*x^3*b 
^2*d*n^11-9*x^3*a^2*d*n^9+6*x^3*ln(c*x^n)*b^2*d*n^10-2*x^3*ln(f*x^r)*b^2*e 
*n^11-9*x^3*ln(f*x^r)*a^2*e*n^9-9*x^3*ln(c*x^n)^2*b^2*d*n^9+2*x^3*b^2*e*n^ 
11*r+3*x^3*a^2*e*n^9*r+6*x^3*a*b*d*n^10+6*x^3*ln(c*x^n)*a*b*e*n^9*r-18*x^3 
*ln(c*x^n)*ln(f*x^r)*a*b*e*n^9)/n^9
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 388 vs. \(2 (187) = 374\).

Time = 0.07 (sec) , antiderivative size = 388, normalized size of antiderivative = 1.87 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {1}{3} \, b^{2} e n^{2} r x^{3} \log \left (x\right )^{3} - \frac {1}{9} \, {\left (b^{2} e r - 3 \, b^{2} d\right )} x^{3} \log \left (c\right )^{2} - \frac {2}{27} \, {\left (3 \, b^{2} d n - 9 \, a b d - {\left (2 \, b^{2} e n - 3 \, a b e\right )} r\right )} x^{3} \log \left (c\right ) + \frac {1}{27} \, {\left (2 \, b^{2} d n^{2} - 6 \, a b d n + 9 \, a^{2} d - {\left (2 \, b^{2} e n^{2} - 4 \, a b e n + 3 \, a^{2} e\right )} r\right )} x^{3} + \frac {1}{3} \, {\left (2 \, b^{2} e n r x^{3} \log \left (c\right ) + b^{2} e n^{2} x^{3} \log \left (f\right ) + {\left (b^{2} d n^{2} - {\left (b^{2} e n^{2} - 2 \, a b e n\right )} r\right )} x^{3}\right )} \log \left (x\right )^{2} + \frac {1}{27} \, {\left (9 \, b^{2} e x^{3} \log \left (c\right )^{2} - 6 \, {\left (b^{2} e n - 3 \, a b e\right )} x^{3} \log \left (c\right ) + {\left (2 \, b^{2} e n^{2} - 6 \, a b e n + 9 \, a^{2} e\right )} x^{3}\right )} \log \left (f\right ) + \frac {1}{9} \, {\left (3 \, b^{2} e r x^{3} \log \left (c\right )^{2} + 2 \, {\left (3 \, b^{2} d n - {\left (2 \, b^{2} e n - 3 \, a b e\right )} r\right )} x^{3} \log \left (c\right ) - {\left (2 \, b^{2} d n^{2} - 6 \, a b d n - {\left (2 \, b^{2} e n^{2} - 4 \, a b e n + 3 \, a^{2} e\right )} r\right )} x^{3} + 2 \, {\left (3 \, b^{2} e n x^{3} \log \left (c\right ) - {\left (b^{2} e n^{2} - 3 \, a b e n\right )} x^{3}\right )} \log \left (f\right )\right )} \log \left (x\right ) \] Input:

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

Output:

1/3*b^2*e*n^2*r*x^3*log(x)^3 - 1/9*(b^2*e*r - 3*b^2*d)*x^3*log(c)^2 - 2/27 
*(3*b^2*d*n - 9*a*b*d - (2*b^2*e*n - 3*a*b*e)*r)*x^3*log(c) + 1/27*(2*b^2* 
d*n^2 - 6*a*b*d*n + 9*a^2*d - (2*b^2*e*n^2 - 4*a*b*e*n + 3*a^2*e)*r)*x^3 + 
 1/3*(2*b^2*e*n*r*x^3*log(c) + b^2*e*n^2*x^3*log(f) + (b^2*d*n^2 - (b^2*e* 
n^2 - 2*a*b*e*n)*r)*x^3)*log(x)^2 + 1/27*(9*b^2*e*x^3*log(c)^2 - 6*(b^2*e* 
n - 3*a*b*e)*x^3*log(c) + (2*b^2*e*n^2 - 6*a*b*e*n + 9*a^2*e)*x^3)*log(f) 
+ 1/9*(3*b^2*e*r*x^3*log(c)^2 + 2*(3*b^2*d*n - (2*b^2*e*n - 3*a*b*e)*r)*x^ 
3*log(c) - (2*b^2*d*n^2 - 6*a*b*d*n - (2*b^2*e*n^2 - 4*a*b*e*n + 3*a^2*e)* 
r)*x^3 + 2*(3*b^2*e*n*x^3*log(c) - (b^2*e*n^2 - 3*a*b*e*n)*x^3)*log(f))*lo 
g(x)
 

Sympy [A] (verification not implemented)

Time = 4.02 (sec) , antiderivative size = 340, normalized size of antiderivative = 1.64 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {a^{2} d x^{3}}{3} - \frac {a^{2} e r x^{3}}{9} + \frac {a^{2} e x^{3} \log {\left (f x^{r} \right )}}{3} - \frac {2 a b d n x^{3}}{9} + \frac {2 a b d x^{3} \log {\left (c x^{n} \right )}}{3} + \frac {4 a b e n r x^{3}}{27} - \frac {2 a b e n x^{3} \log {\left (f x^{r} \right )}}{9} - \frac {2 a b e r x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {2 a b e x^{3} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )}}{3} + \frac {2 b^{2} d n^{2} x^{3}}{27} - \frac {2 b^{2} d n x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {b^{2} d x^{3} \log {\left (c x^{n} \right )}^{2}}{3} - \frac {2 b^{2} e n^{2} r x^{3}}{27} + \frac {2 b^{2} e n^{2} x^{3} \log {\left (f x^{r} \right )}}{27} + \frac {4 b^{2} e n r x^{3} \log {\left (c x^{n} \right )}}{27} - \frac {2 b^{2} e n x^{3} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )}}{9} - \frac {b^{2} e r x^{3} \log {\left (c x^{n} \right )}^{2}}{9} + \frac {b^{2} e x^{3} \log {\left (c x^{n} \right )}^{2} \log {\left (f x^{r} \right )}}{3} \] Input:

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

Output:

a**2*d*x**3/3 - a**2*e*r*x**3/9 + a**2*e*x**3*log(f*x**r)/3 - 2*a*b*d*n*x* 
*3/9 + 2*a*b*d*x**3*log(c*x**n)/3 + 4*a*b*e*n*r*x**3/27 - 2*a*b*e*n*x**3*l 
og(f*x**r)/9 - 2*a*b*e*r*x**3*log(c*x**n)/9 + 2*a*b*e*x**3*log(c*x**n)*log 
(f*x**r)/3 + 2*b**2*d*n**2*x**3/27 - 2*b**2*d*n*x**3*log(c*x**n)/9 + b**2* 
d*x**3*log(c*x**n)**2/3 - 2*b**2*e*n**2*r*x**3/27 + 2*b**2*e*n**2*x**3*log 
(f*x**r)/27 + 4*b**2*e*n*r*x**3*log(c*x**n)/27 - 2*b**2*e*n*x**3*log(c*x** 
n)*log(f*x**r)/9 - b**2*e*r*x**3*log(c*x**n)**2/9 + b**2*e*x**3*log(c*x**n 
)**2*log(f*x**r)/3
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.21 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {1}{3} \, b^{2} d x^{3} \log \left (c x^{n}\right )^{2} - \frac {2}{9} \, a b d n x^{3} - \frac {1}{9} \, a^{2} e r x^{3} + \frac {2}{3} \, a b d x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a^{2} e x^{3} \log \left (f x^{r}\right ) + \frac {1}{3} \, a^{2} d x^{3} - \frac {1}{9} \, {\left (r x^{3} - 3 \, x^{3} \log \left (f x^{r}\right )\right )} b^{2} e \log \left (c x^{n}\right )^{2} + \frac {2}{27} \, {\left ({\left (2 \, r - 3 \, \log \left (f\right )\right )} x^{3} - 3 \, x^{3} \log \left (x^{r}\right )\right )} a b e n - \frac {2}{9} \, {\left (r x^{3} - 3 \, x^{3} \log \left (f x^{r}\right )\right )} a b e \log \left (c x^{n}\right ) + \frac {2}{27} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} d - \frac {2}{27} \, {\left ({\left ({\left (r - \log \left (f\right )\right )} x^{3} - x^{3} \log \left (x^{r}\right )\right )} n^{2} - {\left ({\left (2 \, r - 3 \, \log \left (f\right )\right )} x^{3} - 3 \, x^{3} \log \left (x^{r}\right )\right )} n \log \left (c x^{n}\right )\right )} b^{2} e \] Input:

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

Output:

1/3*b^2*d*x^3*log(c*x^n)^2 - 2/9*a*b*d*n*x^3 - 1/9*a^2*e*r*x^3 + 2/3*a*b*d 
*x^3*log(c*x^n) + 1/3*a^2*e*x^3*log(f*x^r) + 1/3*a^2*d*x^3 - 1/9*(r*x^3 - 
3*x^3*log(f*x^r))*b^2*e*log(c*x^n)^2 + 2/27*((2*r - 3*log(f))*x^3 - 3*x^3* 
log(x^r))*a*b*e*n - 2/9*(r*x^3 - 3*x^3*log(f*x^r))*a*b*e*log(c*x^n) + 2/27 
*(n^2*x^3 - 3*n*x^3*log(c*x^n))*b^2*d - 2/27*(((r - log(f))*x^3 - x^3*log( 
x^r))*n^2 - ((2*r - 3*log(f))*x^3 - 3*x^3*log(x^r))*n*log(c*x^n))*b^2*e
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 480 vs. \(2 (187) = 374\).

Time = 0.12 (sec) , antiderivative size = 480, normalized size of antiderivative = 2.32 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx =\text {Too large to display} \] Input:

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

Output:

1/3*b^2*e*n^2*r*x^3*log(x)^3 - 1/3*b^2*e*n^2*r*x^3*log(x)^2 + 2/3*b^2*e*n* 
r*x^3*log(c)*log(x)^2 + 1/3*b^2*e*n^2*x^3*log(f)*log(x)^2 + 2/9*b^2*e*n^2* 
r*x^3*log(x) - 4/9*b^2*e*n*r*x^3*log(c)*log(x) + 1/3*b^2*e*r*x^3*log(c)^2* 
log(x) - 2/9*b^2*e*n^2*x^3*log(f)*log(x) + 2/3*b^2*e*n*x^3*log(c)*log(f)*l 
og(x) + 1/3*b^2*d*n^2*x^3*log(x)^2 + 2/3*a*b*e*n*r*x^3*log(x)^2 - 2/27*b^2 
*e*n^2*r*x^3 + 4/27*b^2*e*n*r*x^3*log(c) - 1/9*b^2*e*r*x^3*log(c)^2 + 2/27 
*b^2*e*n^2*x^3*log(f) - 2/9*b^2*e*n*x^3*log(c)*log(f) + 1/3*b^2*e*x^3*log( 
c)^2*log(f) - 2/9*b^2*d*n^2*x^3*log(x) - 4/9*a*b*e*n*r*x^3*log(x) + 2/3*b^ 
2*d*n*x^3*log(c)*log(x) + 2/3*a*b*e*r*x^3*log(c)*log(x) + 2/3*a*b*e*n*x^3* 
log(f)*log(x) + 2/27*b^2*d*n^2*x^3 + 4/27*a*b*e*n*r*x^3 - 2/9*b^2*d*n*x^3* 
log(c) - 2/9*a*b*e*r*x^3*log(c) + 1/3*b^2*d*x^3*log(c)^2 - 2/9*a*b*e*n*x^3 
*log(f) + 2/3*a*b*e*x^3*log(c)*log(f) + 2/3*a*b*d*n*x^3*log(x) + 1/3*a^2*e 
*r*x^3*log(x) - 2/9*a*b*d*n*x^3 - 1/9*a^2*e*r*x^3 + 2/3*a*b*d*x^3*log(c) + 
 1/3*a^2*e*x^3*log(f) + 1/3*a^2*d*x^3
 

Mupad [B] (verification not implemented)

Time = 25.66 (sec) , antiderivative size = 189, normalized size of antiderivative = 0.91 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\ln \left (f\,x^r\right )\,\left (\ln \left (c\,x^n\right )\,\left (\frac {2\,a\,b\,e\,x^3}{3}-\frac {2\,b^2\,e\,n\,x^3}{9}\right )+\frac {a^2\,e\,x^3}{3}+\frac {2\,b^2\,e\,n^2\,x^3}{27}+\frac {b^2\,e\,x^3\,{\ln \left (c\,x^n\right )}^2}{3}-\frac {2\,a\,b\,e\,n\,x^3}{9}\right )+x^3\,\left (\frac {a^2\,d}{3}+\frac {2\,b^2\,d\,n^2}{27}-\frac {a^2\,e\,r}{9}-\frac {2\,b^2\,e\,n^2\,r}{27}-\frac {2\,a\,b\,d\,n}{9}+\frac {4\,a\,b\,e\,n\,r}{27}\right )+\frac {b^2\,x^3\,{\ln \left (c\,x^n\right )}^2\,\left (3\,d-e\,r\right )}{9}+\frac {2\,b\,x^3\,\ln \left (c\,x^n\right )\,\left (9\,a\,d-3\,b\,d\,n-3\,a\,e\,r+2\,b\,e\,n\,r\right )}{27} \] Input:

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

Output:

log(f*x^r)*(log(c*x^n)*((2*a*b*e*x^3)/3 - (2*b^2*e*n*x^3)/9) + (a^2*e*x^3) 
/3 + (2*b^2*e*n^2*x^3)/27 + (b^2*e*x^3*log(c*x^n)^2)/3 - (2*a*b*e*n*x^3)/9 
) + x^3*((a^2*d)/3 + (2*b^2*d*n^2)/27 - (a^2*e*r)/9 - (2*b^2*e*n^2*r)/27 - 
 (2*a*b*d*n)/9 + (4*a*b*e*n*r)/27) + (b^2*x^3*log(c*x^n)^2*(3*d - e*r))/9 
+ (2*b*x^3*log(c*x^n)*(9*a*d - 3*b*d*n - 3*a*e*r + 2*b*e*n*r))/27
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.09 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {x^{3} \left (9 \mathrm {log}\left (x^{n} c \right )^{2} \mathrm {log}\left (x^{r} f \right ) b^{2} e +9 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d -3 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} e r +18 \,\mathrm {log}\left (x^{n} c \right ) \mathrm {log}\left (x^{r} f \right ) a b e -6 \,\mathrm {log}\left (x^{n} c \right ) \mathrm {log}\left (x^{r} f \right ) b^{2} e n +18 \,\mathrm {log}\left (x^{n} c \right ) a b d -6 \,\mathrm {log}\left (x^{n} c \right ) a b e r -6 \,\mathrm {log}\left (x^{n} c \right ) b^{2} d n +4 \,\mathrm {log}\left (x^{n} c \right ) b^{2} e n r +9 \,\mathrm {log}\left (x^{r} f \right ) a^{2} e -6 \,\mathrm {log}\left (x^{r} f \right ) a b e n +2 \,\mathrm {log}\left (x^{r} f \right ) b^{2} e \,n^{2}+9 a^{2} d -3 a^{2} e r -6 a b d n +4 a b e n r +2 b^{2} d \,n^{2}-2 b^{2} e \,n^{2} r \right )}{27} \] Input:

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

Output:

(x**3*(9*log(x**n*c)**2*log(x**r*f)*b**2*e + 9*log(x**n*c)**2*b**2*d - 3*l 
og(x**n*c)**2*b**2*e*r + 18*log(x**n*c)*log(x**r*f)*a*b*e - 6*log(x**n*c)* 
log(x**r*f)*b**2*e*n + 18*log(x**n*c)*a*b*d - 6*log(x**n*c)*a*b*e*r - 6*lo 
g(x**n*c)*b**2*d*n + 4*log(x**n*c)*b**2*e*n*r + 9*log(x**r*f)*a**2*e - 6*l 
og(x**r*f)*a*b*e*n + 2*log(x**r*f)*b**2*e*n**2 + 9*a**2*d - 3*a**2*e*r - 6 
*a*b*d*n + 4*a*b*e*n*r + 2*b**2*d*n**2 - 2*b**2*e*n**2*r))/27