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

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

Optimal result

Integrand size = 22, antiderivative size = 93 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=\frac {2 b^2 m^2 n^2 (e x)^{1+q}}{e (1+q)^3}-\frac {2 b m n (e x)^{1+q} \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )}{e (1+q)^2}+\frac {(e x)^{1+q} \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2}{e (1+q)} \] Output:

2*b^2*m^2*n^2*(e*x)^(1+q)/e/(1+q)^3-2*b*m*n*(e*x)^(1+q)*(a+b*ln(c*(d*x^m)^ 
n))/e/(1+q)^2+(e*x)^(1+q)*(a+b*ln(c*(d*x^m)^n))^2/e/(1+q)
 

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.97 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=\frac {x (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2}{1+q}-\frac {2 b m n x^{-q} (e x)^q \left (-\frac {b m n x^{1+q}}{(1+q)^2}+\frac {x^{1+q} \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )}{1+q}\right )}{1+q} \] Input:

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

Output:

(x*(e*x)^q*(a + b*Log[c*(d*x^m)^n])^2)/(1 + q) - (2*b*m*n*(e*x)^q*(-((b*m* 
n*x^(1 + q))/(1 + q)^2) + (x^(1 + q)*(a + b*Log[c*(d*x^m)^n]))/(1 + q)))/( 
(1 + q)*x^q)
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.01, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {2895, 2742, 2741}

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 (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx\)

\(\Big \downarrow \) 2895

\(\displaystyle \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2dx\)

\(\Big \downarrow \) 2742

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

\(\Big \downarrow \) 2741

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

Input:

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

Output:

((e*x)^(1 + q)*(a + b*Log[c*(d*x^m)^n])^2)/(e*(1 + q)) - (2*b*m*n*(-((b*m* 
n*(e*x)^(1 + q))/(e*(1 + q)^2)) + ((e*x)^(1 + q)*(a + b*Log[c*(d*x^m)^n])) 
/(e*(1 + q))))/(1 + q)
 

Defintions of rubi rules used

rule 2741
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> 
Simp[(d*x)^(m + 1)*((a + b*Log[c*x^n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^( 
m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1]
 

rule 2742
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbo 
l] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^n])^p/(d*(m + 1))), x] - Simp[b*n* 
(p/(m + 1))   Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b 
, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]
 

rule 2895
Int[((a_.) + Log[(c_.)*((d_.)*((e_.) + (f_.)*(x_))^(m_.))^(n_)]*(b_.))^(p_. 
)*(u_.), x_Symbol] :> Subst[Int[u*(a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x], 
 c*d^n*(e + f*x)^(m*n), c*(d*(e + f*x)^m)^n] /; FreeQ[{a, b, c, d, e, f, m, 
 n, p}, x] &&  !IntegerQ[n] &&  !(EqQ[d, 1] && EqQ[m, 1]) && IntegralFreeQ[ 
IntHide[u*(a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x]]
 
Maple [B] (verified)

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

Time = 1.97 (sec) , antiderivative size = 282, normalized size of antiderivative = 3.03

method result size
parallelrisch \(-\frac {2 x \left (e x \right )^{q} \ln \left (c \left (d \,x^{m}\right )^{n}\right ) b^{2} m n q +2 x \left (e x \right )^{q} a b m n q +2 x \left (e x \right )^{q} \ln \left (c \left (d \,x^{m}\right )^{n}\right ) b^{2} m n -4 x \left (e x \right )^{q} \ln \left (c \left (d \,x^{m}\right )^{n}\right ) a b q +2 x \left (e x \right )^{q} a b m n -x \left (e x \right )^{q} a^{2} q^{2}-2 x \left (e x \right )^{q} a^{2} q -x \left (e x \right )^{q} {\ln \left (c \left (d \,x^{m}\right )^{n}\right )}^{2} b^{2}-x \left (e x \right )^{q} {\ln \left (c \left (d \,x^{m}\right )^{n}\right )}^{2} b^{2} q^{2}-2 x \left (e x \right )^{q} b^{2} m^{2} n^{2}-2 x \left (e x \right )^{q} {\ln \left (c \left (d \,x^{m}\right )^{n}\right )}^{2} b^{2} q -2 x \left (e x \right )^{q} \ln \left (c \left (d \,x^{m}\right )^{n}\right ) a b -2 x \left (e x \right )^{q} \ln \left (c \left (d \,x^{m}\right )^{n}\right ) a b \,q^{2}-x \left (e x \right )^{q} a^{2}}{\left (q^{2}+2 q +1\right ) \left (1+q \right )}\) \(282\)

Input:

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

Output:

-(2*x*(e*x)^q*ln(c*(d*x^m)^n)*b^2*m*n*q+2*x*(e*x)^q*a*b*m*n*q+2*x*(e*x)^q* 
ln(c*(d*x^m)^n)*b^2*m*n-4*x*(e*x)^q*ln(c*(d*x^m)^n)*a*b*q+2*x*(e*x)^q*a*b* 
m*n-x*(e*x)^q*a^2*q^2-2*x*(e*x)^q*a^2*q-x*(e*x)^q*ln(c*(d*x^m)^n)^2*b^2-x* 
(e*x)^q*ln(c*(d*x^m)^n)^2*b^2*q^2-2*x*(e*x)^q*b^2*m^2*n^2-2*x*(e*x)^q*ln(c 
*(d*x^m)^n)^2*b^2*q-2*x*(e*x)^q*ln(c*(d*x^m)^n)*a*b-2*x*(e*x)^q*ln(c*(d*x^ 
m)^n)*a*b*q^2-x*(e*x)^q*a^2)/(q^2+2*q+1)/(1+q)
 

Fricas [B] (verification not implemented)

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

Time = 0.08 (sec) , antiderivative size = 391, normalized size of antiderivative = 4.20 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=\frac {{\left ({\left (b^{2} q^{2} + 2 \, b^{2} q + b^{2}\right )} x \log \left (c\right )^{2} + {\left (b^{2} n^{2} q^{2} + 2 \, b^{2} n^{2} q + b^{2} n^{2}\right )} x \log \left (d\right )^{2} + {\left (b^{2} m^{2} n^{2} q^{2} + 2 \, b^{2} m^{2} n^{2} q + b^{2} m^{2} n^{2}\right )} x \log \left (x\right )^{2} - 2 \, {\left (b^{2} m n - a b q^{2} - a b + {\left (b^{2} m n - 2 \, a b\right )} q\right )} x \log \left (c\right ) + {\left (2 \, b^{2} m^{2} n^{2} - 2 \, a b m n + a^{2} q^{2} + a^{2} - 2 \, {\left (a b m n - a^{2}\right )} q\right )} x + 2 \, {\left ({\left (b^{2} n q^{2} + 2 \, b^{2} n q + b^{2} n\right )} x \log \left (c\right ) - {\left (b^{2} m n^{2} - a b n q^{2} - a b n + {\left (b^{2} m n^{2} - 2 \, a b n\right )} q\right )} x\right )} \log \left (d\right ) + 2 \, {\left ({\left (b^{2} m n q^{2} + 2 \, b^{2} m n q + b^{2} m n\right )} x \log \left (c\right ) + {\left (b^{2} m n^{2} q^{2} + 2 \, b^{2} m n^{2} q + b^{2} m n^{2}\right )} x \log \left (d\right ) - {\left (b^{2} m^{2} n^{2} - a b m n q^{2} - a b m n + {\left (b^{2} m^{2} n^{2} - 2 \, a b m n\right )} q\right )} x\right )} \log \left (x\right )\right )} e^{\left (q \log \left (e\right ) + q \log \left (x\right )\right )}}{q^{3} + 3 \, q^{2} + 3 \, q + 1} \] Input:

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

Output:

((b^2*q^2 + 2*b^2*q + b^2)*x*log(c)^2 + (b^2*n^2*q^2 + 2*b^2*n^2*q + b^2*n 
^2)*x*log(d)^2 + (b^2*m^2*n^2*q^2 + 2*b^2*m^2*n^2*q + b^2*m^2*n^2)*x*log(x 
)^2 - 2*(b^2*m*n - a*b*q^2 - a*b + (b^2*m*n - 2*a*b)*q)*x*log(c) + (2*b^2* 
m^2*n^2 - 2*a*b*m*n + a^2*q^2 + a^2 - 2*(a*b*m*n - a^2)*q)*x + 2*((b^2*n*q 
^2 + 2*b^2*n*q + b^2*n)*x*log(c) - (b^2*m*n^2 - a*b*n*q^2 - a*b*n + (b^2*m 
*n^2 - 2*a*b*n)*q)*x)*log(d) + 2*((b^2*m*n*q^2 + 2*b^2*m*n*q + b^2*m*n)*x* 
log(c) + (b^2*m*n^2*q^2 + 2*b^2*m*n^2*q + b^2*m*n^2)*x*log(d) - (b^2*m^2*n 
^2 - a*b*m*n*q^2 - a*b*m*n + (b^2*m^2*n^2 - 2*a*b*m*n)*q)*x)*log(x))*e^(q* 
log(e) + q*log(x))/(q^3 + 3*q^2 + 3*q + 1)
 

Sympy [F]

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

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

Output:

Integral((e*x)**q*(a + b*log(c*(d*x**m)**n))**2, x)
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.60 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=-\frac {2 \, a b e^{q} m n x x^{q}}{{\left (q + 1\right )}^{2}} + 2 \, {\left (\frac {e^{q} m^{2} n^{2} x x^{q}}{{\left (q + 1\right )}^{3}} - \frac {e^{q} m n x x^{q} \log \left (\left (d x^{m}\right )^{n} c\right )}{{\left (q + 1\right )}^{2}}\right )} b^{2} + \frac {\left (e x\right )^{q + 1} b^{2} \log \left (\left (d x^{m}\right )^{n} c\right )^{2}}{e {\left (q + 1\right )}} + \frac {2 \, \left (e x\right )^{q + 1} a b \log \left (\left (d x^{m}\right )^{n} c\right )}{e {\left (q + 1\right )}} + \frac {\left (e x\right )^{q + 1} a^{2}}{e {\left (q + 1\right )}} \] Input:

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

Output:

-2*a*b*e^q*m*n*x*x^q/(q + 1)^2 + 2*(e^q*m^2*n^2*x*x^q/(q + 1)^3 - e^q*m*n* 
x*x^q*log((d*x^m)^n*c)/(q + 1)^2)*b^2 + (e*x)^(q + 1)*b^2*log((d*x^m)^n*c) 
^2/(e*(q + 1)) + 2*(e*x)^(q + 1)*a*b*log((d*x^m)^n*c)/(e*(q + 1)) + (e*x)^ 
(q + 1)*a^2/(e*(q + 1))
 

Giac [B] (verification not implemented)

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

Time = 0.15 (sec) , antiderivative size = 576, normalized size of antiderivative = 6.19 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=\frac {b^{2} e^{q} m^{2} n^{2} q^{2} x x^{q} \log \left (x\right )^{2}}{q^{3} + 3 \, q^{2} + 3 \, q + 1} + \frac {2 \, b^{2} e^{q} m^{2} n^{2} q x x^{q} \log \left (x\right )^{2}}{q^{3} + 3 \, q^{2} + 3 \, q + 1} - \frac {2 \, b^{2} e^{q} m^{2} n^{2} q x x^{q} \log \left (x\right )}{q^{3} + 3 \, q^{2} + 3 \, q + 1} + \frac {2 \, b^{2} e^{q} m n^{2} q x x^{q} \log \left (d\right ) \log \left (x\right )}{q^{2} + 2 \, q + 1} + \frac {b^{2} e^{q} m^{2} n^{2} x x^{q} \log \left (x\right )^{2}}{q^{3} + 3 \, q^{2} + 3 \, q + 1} - \frac {2 \, b^{2} e^{q} m^{2} n^{2} x x^{q} \log \left (x\right )}{q^{3} + 3 \, q^{2} + 3 \, q + 1} + \frac {2 \, b^{2} e^{q} m n q x x^{q} \log \left (c\right ) \log \left (x\right )}{q^{2} + 2 \, q + 1} + \frac {2 \, b^{2} e^{q} m n^{2} x x^{q} \log \left (d\right ) \log \left (x\right )}{q^{2} + 2 \, q + 1} + \frac {2 \, b^{2} e^{q} m^{2} n^{2} x x^{q}}{q^{3} + 3 \, q^{2} + 3 \, q + 1} - \frac {2 \, b^{2} e^{q} m n^{2} x x^{q} \log \left (d\right )}{q^{2} + 2 \, q + 1} + \frac {2 \, a b e^{q} m n q x x^{q} \log \left (x\right )}{q^{2} + 2 \, q + 1} + \frac {2 \, b^{2} e^{q} m n x x^{q} \log \left (c\right ) \log \left (x\right )}{q^{2} + 2 \, q + 1} - \frac {2 \, b^{2} e^{q} m n x x^{q} \log \left (c\right )}{q^{2} + 2 \, q + 1} + \frac {\left (e x\right )^{q} b^{2} n^{2} x \log \left (d\right )^{2}}{q + 1} + \frac {2 \, a b e^{q} m n x x^{q} \log \left (x\right )}{q^{2} + 2 \, q + 1} - \frac {2 \, a b e^{q} m n x x^{q}}{q^{2} + 2 \, q + 1} + \frac {2 \, \left (e x\right )^{q} b^{2} n x \log \left (c\right ) \log \left (d\right )}{q + 1} + \frac {\left (e x\right )^{q} b^{2} x \log \left (c\right )^{2}}{q + 1} + \frac {2 \, \left (e x\right )^{q} a b n x \log \left (d\right )}{q + 1} + \frac {2 \, \left (e x\right )^{q} a b x \log \left (c\right )}{q + 1} + \frac {\left (e x\right )^{q} a^{2} x}{q + 1} \] Input:

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

Output:

b^2*e^q*m^2*n^2*q^2*x*x^q*log(x)^2/(q^3 + 3*q^2 + 3*q + 1) + 2*b^2*e^q*m^2 
*n^2*q*x*x^q*log(x)^2/(q^3 + 3*q^2 + 3*q + 1) - 2*b^2*e^q*m^2*n^2*q*x*x^q* 
log(x)/(q^3 + 3*q^2 + 3*q + 1) + 2*b^2*e^q*m*n^2*q*x*x^q*log(d)*log(x)/(q^ 
2 + 2*q + 1) + b^2*e^q*m^2*n^2*x*x^q*log(x)^2/(q^3 + 3*q^2 + 3*q + 1) - 2* 
b^2*e^q*m^2*n^2*x*x^q*log(x)/(q^3 + 3*q^2 + 3*q + 1) + 2*b^2*e^q*m*n*q*x*x 
^q*log(c)*log(x)/(q^2 + 2*q + 1) + 2*b^2*e^q*m*n^2*x*x^q*log(d)*log(x)/(q^ 
2 + 2*q + 1) + 2*b^2*e^q*m^2*n^2*x*x^q/(q^3 + 3*q^2 + 3*q + 1) - 2*b^2*e^q 
*m*n^2*x*x^q*log(d)/(q^2 + 2*q + 1) + 2*a*b*e^q*m*n*q*x*x^q*log(x)/(q^2 + 
2*q + 1) + 2*b^2*e^q*m*n*x*x^q*log(c)*log(x)/(q^2 + 2*q + 1) - 2*b^2*e^q*m 
*n*x*x^q*log(c)/(q^2 + 2*q + 1) + (e*x)^q*b^2*n^2*x*log(d)^2/(q + 1) + 2*a 
*b*e^q*m*n*x*x^q*log(x)/(q^2 + 2*q + 1) - 2*a*b*e^q*m*n*x*x^q/(q^2 + 2*q + 
 1) + 2*(e*x)^q*b^2*n*x*log(c)*log(d)/(q + 1) + (e*x)^q*b^2*x*log(c)^2/(q 
+ 1) + 2*(e*x)^q*a*b*n*x*log(d)/(q + 1) + 2*(e*x)^q*a*b*x*log(c)/(q + 1) + 
 (e*x)^q*a^2*x/(q + 1)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.22 \[ \int (e x)^q \left (a+b \log \left (c \left (d x^m\right )^n\right )\right )^2 \, dx=\frac {x^{q} e^{q} x \left (\mathrm {log}\left (x^{m n} d^{n} c \right )^{2} b^{2} q^{2}+2 \mathrm {log}\left (x^{m n} d^{n} c \right )^{2} b^{2} q +\mathrm {log}\left (x^{m n} d^{n} c \right )^{2} b^{2}+2 \,\mathrm {log}\left (x^{m n} d^{n} c \right ) a b \,q^{2}+4 \,\mathrm {log}\left (x^{m n} d^{n} c \right ) a b q +2 \,\mathrm {log}\left (x^{m n} d^{n} c \right ) a b -2 \,\mathrm {log}\left (x^{m n} d^{n} c \right ) b^{2} m n q -2 \,\mathrm {log}\left (x^{m n} d^{n} c \right ) b^{2} m n +a^{2} q^{2}+2 a^{2} q +a^{2}-2 a b m n q -2 a b m n +2 b^{2} m^{2} n^{2}\right )}{q^{3}+3 q^{2}+3 q +1} \] Input:

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

Output:

(x**q*e**q*x*(log(x**(m*n)*d**n*c)**2*b**2*q**2 + 2*log(x**(m*n)*d**n*c)** 
2*b**2*q + log(x**(m*n)*d**n*c)**2*b**2 + 2*log(x**(m*n)*d**n*c)*a*b*q**2 
+ 4*log(x**(m*n)*d**n*c)*a*b*q + 2*log(x**(m*n)*d**n*c)*a*b - 2*log(x**(m* 
n)*d**n*c)*b**2*m*n*q - 2*log(x**(m*n)*d**n*c)*b**2*m*n + a**2*q**2 + 2*a* 
*2*q + a**2 - 2*a*b*m*n*q - 2*a*b*m*n + 2*b**2*m**2*n**2))/(q**3 + 3*q**2 
+ 3*q + 1)