\(\int \frac {(a+b \log (c x^n))^2 (d+e \log (f (g+h x)^q))}{x} \, dx\) [413]

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

Optimal result

Integrand size = 30, antiderivative size = 159 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f (g+h x)^q\right )\right )}{x} \, dx=\frac {d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}+\frac {e \left (a+b \log \left (c x^n\right )\right )^3 \log \left (f (g+h x)^q\right )}{3 b n}-\frac {e q \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {h x}{g}\right )}{3 b n}-e q \left (a+b \log \left (c x^n\right )\right )^2 \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )+2 b e n q \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (3,-\frac {h x}{g}\right )-2 b^2 e n^2 q \operatorname {PolyLog}\left (4,-\frac {h x}{g}\right ) \] Output:

1/3*d*(a+b*ln(c*x^n))^3/b/n+1/3*e*(a+b*ln(c*x^n))^3*ln(f*(h*x+g)^q)/b/n-1/ 
3*e*q*(a+b*ln(c*x^n))^3*ln(1+h*x/g)/b/n-e*q*(a+b*ln(c*x^n))^2*polylog(2,-h 
*x/g)+2*b*e*n*q*(a+b*ln(c*x^n))*polylog(3,-h*x/g)-2*b^2*e*n^2*q*polylog(4, 
-h*x/g)
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(421\) vs. \(2(159)=318\).

Time = 0.26 (sec) , antiderivative size = 421, normalized size of antiderivative = 2.65 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f (g+h x)^q\right )\right )}{x} \, dx=a^2 d \log (x)-a b d n \log ^2(x)+\frac {1}{3} b^2 d n^2 \log ^3(x)+2 a b d \log (x) \log \left (c x^n\right )-b^2 d n \log ^2(x) \log \left (c x^n\right )+b^2 d \log (x) \log ^2\left (c x^n\right )+a^2 e \log (x) \log \left (f (g+h x)^q\right )-a b e n \log ^2(x) \log \left (f (g+h x)^q\right )+\frac {1}{3} b^2 e n^2 \log ^3(x) \log \left (f (g+h x)^q\right )+2 a b e \log (x) \log \left (c x^n\right ) \log \left (f (g+h x)^q\right )-b^2 e n \log ^2(x) \log \left (c x^n\right ) \log \left (f (g+h x)^q\right )+b^2 e \log (x) \log ^2\left (c x^n\right ) \log \left (f (g+h x)^q\right )-a^2 e q \log (x) \log \left (1+\frac {h x}{g}\right )+a b e n q \log ^2(x) \log \left (1+\frac {h x}{g}\right )-\frac {1}{3} b^2 e n^2 q \log ^3(x) \log \left (1+\frac {h x}{g}\right )-2 a b e q \log (x) \log \left (c x^n\right ) \log \left (1+\frac {h x}{g}\right )+b^2 e n q \log ^2(x) \log \left (c x^n\right ) \log \left (1+\frac {h x}{g}\right )-b^2 e q \log (x) \log ^2\left (c x^n\right ) \log \left (1+\frac {h x}{g}\right )-e q \left (a+b \log \left (c x^n\right )\right )^2 \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )+2 b e n q \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (3,-\frac {h x}{g}\right )-2 b^2 e n^2 q \operatorname {PolyLog}\left (4,-\frac {h x}{g}\right ) \] Input:

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

Output:

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

Rubi [F]

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 \frac {\left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f (g+h x)^q\right )\right )}{x} \, dx\)

\(\Big \downarrow \) 2891

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

Input:

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

Output:

$Aborted
 

Defintions of rubi rules used

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

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

Time = 90.49 (sec) , antiderivative size = 4094, normalized size of antiderivative = 25.75

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

Input:

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

Output:

-q*e*dilog((h*x+g)/g)*a^2+1/6*(1/8*I*e*Pi*csgn(I*(h*x+g)^q)*csgn(I*f*(h*x+ 
g)^q)^2-1/8*I*e*Pi*csgn(I*(h*x+g)^q)*csgn(I*f*(h*x+g)^q)*csgn(I*f)-1/8*I*e 
*Pi*csgn(I*f*(h*x+g)^q)^3+1/8*I*e*Pi*csgn(I*f*(h*x+g)^q)^2*csgn(I*f)+1/4*l 
n(f)*e+1/4*d)/n*(I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*csgn(I*x^n)*csg 
n(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*ln(x^n)*b+2*b*ln(c)+2*a)^3/b+I*q*e*dilog((h*x+g)/g)*ln(x)*Pi*b^2*n*cs 
gn(I*x^n)*csgn(I*c*x^n)^2+I*q*e*dilog((h*x+g)/g)*ln(x)*Pi*b^2*n*csgn(I*c*x 
^n)^2*csgn(I*c)+I*q*e*dilog((h*x+g)/g)*Pi*ln(c)*b^2*csgn(I*x^n)*csgn(I*c*x 
^n)*csgn(I*c)+I*q*e*dilog((h*x+g)/g)*Pi*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c 
)*ln(x^n)*b^2+I*q*e*dilog((h*x+g)/g)*Pi*a*b*csgn(I*x^n)*csgn(I*c*x^n)*csgn 
(I*c)+I*q*e*ln(x)^2*ln((h*x+g)/g)*Pi*b^2*n*csgn(I*x^n)*csgn(I*c*x^n)^2+I*q 
*e*ln(x)^2*ln((h*x+g)/g)*Pi*b^2*n*csgn(I*c*x^n)^2*csgn(I*c)-1/2*I*q*b^2*e* 
n*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(x)^2*ln(1+h*x/g)-1/2*I*q*b^2*e*n*Pi*cs 
gn(I*c*x^n)^2*csgn(I*c)*ln(x)^2*ln(1+h*x/g)-I*q*b^2*e*n*Pi*csgn(I*x^n)*csg 
n(I*c*x^n)^2*ln(x)*polylog(2,-h*x/g)-I*q*b^2*e*n*Pi*csgn(I*c*x^n)^2*csgn(I 
*c)*ln(x)*polylog(2,-h*x/g)-I*q*b^2*e*n*Pi*csgn(I*x^n)*csgn(I*c*x^n)*csgn( 
I*c)*polylog(3,-h*x/g)-I*q*e*ln(x)*ln((h*x+g)/g)*Pi*a*b*csgn(I*x^n)*csgn(I 
*c*x^n)^2-I*q*e*ln(x)*ln((h*x+g)/g)*Pi*a*b*csgn(I*c*x^n)^2*csgn(I*c)-I*q*e 
*ln(x)*ln((h*x+g)/g)*Pi*ln(c)*b^2*csgn(I*x^n)*csgn(I*c*x^n)^2-I*q*e*ln(x)* 
ln((h*x+g)/g)*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(x^n)*b^2-I*q*e*ln(x)*ln...
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
                                                                                    
                                                                                    
 

Maxima [F]

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

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

Output:

1/3*b^2*d*log(c*x^n)^3/n + a*b*d*log(c*x^n)^2/n + a^2*d*log(x) + 1/3*(b^2* 
e*n^2*log(x)^3 + 3*b^2*e*log(x)*log(x^n)^2 - 3*(b^2*e*n*log(c) + a*b*e*n)* 
log(x)^2 - 3*(b^2*e*n*log(x)^2 - 2*(b^2*e*log(c) + a*b*e)*log(x))*log(x^n) 
 + 3*(b^2*e*log(c)^2 + 2*a*b*e*log(c) + a^2*e)*log(x))*log((h*x + g)^q) - 
integrate(1/3*(b^2*e*h*n^2*q*x*log(x)^3 - 3*b^2*e*g*log(c)^2*log(f) - 6*a* 
b*e*g*log(c)*log(f) - 3*a^2*e*g*log(f) - 3*(b^2*e*h*n*q*log(c) + a*b*e*h*n 
*q)*x*log(x)^2 + 3*(b^2*e*h*q*log(c)^2 + 2*a*b*e*h*q*log(c) + a^2*e*h*q)*x 
*log(x) + 3*(b^2*e*h*q*x*log(x) - b^2*e*h*x*log(f) - b^2*e*g*log(f))*log(x 
^n)^2 - 3*(b^2*e*h*log(c)^2*log(f) + 2*a*b*e*h*log(c)*log(f) + a^2*e*h*log 
(f))*x - 3*(b^2*e*h*n*q*x*log(x)^2 + 2*b^2*e*g*log(c)*log(f) + 2*a*b*e*g*l 
og(f) - 2*(b^2*e*h*q*log(c) + a*b*e*h*q)*x*log(x) + 2*(b^2*e*h*log(c)*log( 
f) + a*b*e*h*log(f))*x)*log(x^n))/(h*x^2 + g*x), x)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(6*int(log((g + h*x)**q*f)/(g*x + h*x**2),x)*a**2*e*g*n*q + 6*int((log((g 
+ h*x)**q*f)*log(x**n*c)**2)/x,x)*b**2*e*n*q + 12*int((log((g + h*x)**q*f) 
*log(x**n*c))/x,x)*a*b*e*n*q + 3*log((g + h*x)**q*f)**2*a**2*e*n + 2*log(x 
**n*c)**3*b**2*d*q + 6*log(x**n*c)**2*a*b*d*q + 6*log(x)*a**2*d*n*q)/(6*n* 
q)