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

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 = 24, antiderivative size = 206 \[ \int x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=-\frac {1}{8} b^2 e n^2 r x^2+\frac {1}{8} b e n (2 a-b n) r x^2-\frac {1}{8} e \left (2 a^2-2 a b n+b^2 n^2\right ) r x^2+\frac {1}{4} b^2 e n r x^2 \log \left (c x^n\right )-\frac {1}{4} b e (2 a-b n) r x^2 \log \left (c x^n\right )-\frac {1}{4} b^2 e r x^2 \log ^2\left (c x^n\right )+\frac {1}{4} b^2 n^2 x^2 \left (d+e \log \left (f x^r\right )\right )-\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \] Output:

-1/8*b^2*e*n^2*r*x^2+1/8*b*e*n*(-b*n+2*a)*r*x^2-1/8*e*(b^2*n^2-2*a*b*n+2*a 
^2)*r*x^2+1/4*b^2*e*n*r*x^2*ln(c*x^n)-1/4*b*e*(-b*n+2*a)*r*x^2*ln(c*x^n)-1 
/4*b^2*e*r*x^2*ln(c*x^n)^2+1/4*b^2*n^2*x^2*(d+e*ln(f*x^r))-1/2*b*n*x^2*(a+ 
b*ln(c*x^n))*(d+e*ln(f*x^r))+1/2*x^2*(a+b*ln(c*x^n))^2*(d+e*ln(f*x^r))
 

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.75 \[ \int x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {1}{8} x^2 \left (4 a^2 d-4 a b d n+2 b^2 d n^2-2 a^2 e r+4 a b e n r-3 b^2 e n^2 r+2 e \left (2 a^2-2 a b n+b^2 n^2\right ) \log \left (f x^r\right )+2 b^2 \log ^2\left (c x^n\right ) \left (2 d-e r+2 e \log \left (f x^r\right )\right )-4 b \log \left (c x^n\right ) \left (-2 a d+b d n+a e r-b e n r+(-2 a e+b e n) \log \left (f x^r\right )\right )\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 193, normalized size of antiderivative = 0.94, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, 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 \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}{4} x \left (2 a^2-2 b n a+b^2 n^2+2 b^2 \log ^2\left (c x^n\right )+2 b (2 a-b n) \log \left (c x^n\right )\right )dx+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )-\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )+\frac {1}{4} b^2 n^2 x^2 \left (d+e \log \left (f x^r\right )\right )\)

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2010

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-1/4*(e*r*((b^2*n^2*x^2)/2 - (b*n*(2*a - b*n)*x^2)/2 + ((2*a^2 - 2*a*b*n + 
 b^2*n^2)*x^2)/2 - b^2*n*x^2*Log[c*x^n] + b*(2*a - b*n)*x^2*Log[c*x^n] + b 
^2*x^2*Log[c*x^n]^2)) + (b^2*n^2*x^2*(d + e*Log[f*x^r]))/4 - (b*n*x^2*(a + 
 b*Log[c*x^n])*(d + e*Log[f*x^r]))/2 + (x^2*(a + b*Log[c*x^n])^2*(d + e*Lo 
g[f*x^r]))/2
 

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 = 12.55 (sec) , antiderivative size = 319, normalized size of antiderivative = 1.55

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

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 386 vs. \(2 (186) = 372\).

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

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

Output:

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

Sympy [A] (verification not implemented)

Time = 1.85 (sec) , antiderivative size = 318, normalized size of antiderivative = 1.54 \[ \int x \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^{2}}{2} - \frac {a^{2} e r x^{2}}{4} + \frac {a^{2} e x^{2} \log {\left (f x^{r} \right )}}{2} - \frac {a b d n x^{2}}{2} + a b d x^{2} \log {\left (c x^{n} \right )} + \frac {a b e n r x^{2}}{2} - \frac {a b e n x^{2} \log {\left (f x^{r} \right )}}{2} - \frac {a b e r x^{2} \log {\left (c x^{n} \right )}}{2} + a b e x^{2} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )} + \frac {b^{2} d n^{2} x^{2}}{4} - \frac {b^{2} d n x^{2} \log {\left (c x^{n} \right )}}{2} + \frac {b^{2} d x^{2} \log {\left (c x^{n} \right )}^{2}}{2} - \frac {3 b^{2} e n^{2} r x^{2}}{8} + \frac {b^{2} e n^{2} x^{2} \log {\left (f x^{r} \right )}}{4} + \frac {b^{2} e n r x^{2} \log {\left (c x^{n} \right )}}{2} - \frac {b^{2} e n x^{2} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )}}{2} - \frac {b^{2} e r x^{2} \log {\left (c x^{n} \right )}^{2}}{4} + \frac {b^{2} e x^{2} \log {\left (c x^{n} \right )}^{2} \log {\left (f x^{r} \right )}}{2} \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

1/2*b^2*d*x^2*log(c*x^n)^2 - 1/2*a*b*d*n*x^2 - 1/4*a^2*e*r*x^2 + a*b*d*x^2 
*log(c*x^n) - 1/4*(r*x^2 - 2*x^2*log(f*x^r))*b^2*e*log(c*x^n)^2 + 1/2*a^2* 
e*x^2*log(f*x^r) + 1/2*((r - log(f))*x^2 - x^2*log(x^r))*a*b*e*n + 1/2*a^2 
*d*x^2 - 1/2*(r*x^2 - 2*x^2*log(f*x^r))*a*b*e*log(c*x^n) + 1/4*(n^2*x^2 - 
2*n*x^2*log(c*x^n))*b^2*d - 1/8*(((3*r - 2*log(f))*x^2 - 2*x^2*log(x^r))*n 
^2 - 4*((r - log(f))*x^2 - x^2*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. 471 vs. \(2 (186) = 372\).

Time = 0.12 (sec) , antiderivative size = 471, normalized size of antiderivative = 2.29 \[ \int x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx=\frac {1}{2} \, b^{2} e n^{2} r x^{2} \log \left (x\right )^{3} - \frac {3}{4} \, b^{2} e n^{2} r x^{2} \log \left (x\right )^{2} + b^{2} e n r x^{2} \log \left (c\right ) \log \left (x\right )^{2} + \frac {1}{2} \, b^{2} e n^{2} x^{2} \log \left (f\right ) \log \left (x\right )^{2} + \frac {3}{4} \, b^{2} e n^{2} r x^{2} \log \left (x\right ) - b^{2} e n r x^{2} \log \left (c\right ) \log \left (x\right ) + \frac {1}{2} \, b^{2} e r x^{2} \log \left (c\right )^{2} \log \left (x\right ) - \frac {1}{2} \, b^{2} e n^{2} x^{2} \log \left (f\right ) \log \left (x\right ) + b^{2} e n x^{2} \log \left (c\right ) \log \left (f\right ) \log \left (x\right ) + \frac {1}{2} \, b^{2} d n^{2} x^{2} \log \left (x\right )^{2} + a b e n r x^{2} \log \left (x\right )^{2} - \frac {3}{8} \, b^{2} e n^{2} r x^{2} + \frac {1}{2} \, b^{2} e n r x^{2} \log \left (c\right ) - \frac {1}{4} \, b^{2} e r x^{2} \log \left (c\right )^{2} + \frac {1}{4} \, b^{2} e n^{2} x^{2} \log \left (f\right ) - \frac {1}{2} \, b^{2} e n x^{2} \log \left (c\right ) \log \left (f\right ) + \frac {1}{2} \, b^{2} e x^{2} \log \left (c\right )^{2} \log \left (f\right ) - \frac {1}{2} \, b^{2} d n^{2} x^{2} \log \left (x\right ) - a b e n r x^{2} \log \left (x\right ) + b^{2} d n x^{2} \log \left (c\right ) \log \left (x\right ) + a b e r x^{2} \log \left (c\right ) \log \left (x\right ) + a b e n x^{2} \log \left (f\right ) \log \left (x\right ) + \frac {1}{4} \, b^{2} d n^{2} x^{2} + \frac {1}{2} \, a b e n r x^{2} - \frac {1}{2} \, b^{2} d n x^{2} \log \left (c\right ) - \frac {1}{2} \, a b e r x^{2} \log \left (c\right ) + \frac {1}{2} \, b^{2} d x^{2} \log \left (c\right )^{2} - \frac {1}{2} \, a b e n x^{2} \log \left (f\right ) + a b e x^{2} \log \left (c\right ) \log \left (f\right ) + a b d n x^{2} \log \left (x\right ) + \frac {1}{2} \, a^{2} e r x^{2} \log \left (x\right ) - \frac {1}{2} \, a b d n x^{2} - \frac {1}{4} \, a^{2} e r x^{2} + a b d x^{2} \log \left (c\right ) + \frac {1}{2} \, a^{2} e x^{2} \log \left (f\right ) + \frac {1}{2} \, a^{2} d x^{2} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 25.83 (sec) , antiderivative size = 187, normalized size of antiderivative = 0.91 \[ \int x \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 (a\,b\,e\,x^2-\frac {b^2\,e\,n\,x^2}{2}\right )+\frac {a^2\,e\,x^2}{2}+\frac {b^2\,e\,n^2\,x^2}{4}+\frac {b^2\,e\,x^2\,{\ln \left (c\,x^n\right )}^2}{2}-\frac {a\,b\,e\,n\,x^2}{2}\right )+x^2\,\left (\frac {a^2\,d}{2}+\frac {b^2\,d\,n^2}{4}-\frac {a^2\,e\,r}{4}-\frac {3\,b^2\,e\,n^2\,r}{8}-\frac {a\,b\,d\,n}{2}+\frac {a\,b\,e\,n\,r}{2}\right )+\frac {b^2\,x^2\,{\ln \left (c\,x^n\right )}^2\,\left (2\,d-e\,r\right )}{4}+\frac {b\,x^2\,\ln \left (c\,x^n\right )\,\left (2\,a\,d-b\,d\,n-a\,e\,r+b\,e\,n\,r\right )}{2} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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