\(\int (a+b \log (c x^n)) (d+e \log (f (g+h x)^q)) \, dx\) [406]

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.68 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.07, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {2879, 2009, 2793, 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 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right ) \, dx\)

\(\Big \downarrow \) 2879

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

\(\Big \downarrow \) 2009

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

\(\Big \downarrow \) 2793

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

\(\Big \downarrow \) 2009

\(\displaystyle x \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )-e h q \left (-\frac {g \log \left (\frac {h x}{g}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{h^2}+\frac {a x}{h}+\frac {b x \log \left (c x^n\right )}{h}-\frac {b g n \operatorname {PolyLog}\left (2,-\frac {h x}{g}\right )}{h^2}-\frac {b n x}{h}\right )-b n \left (d x+\frac {e (g+h x) \log \left (f (g+h x)^q\right )}{h}-e q x\right )\)

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2793
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)* 
(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = ExpandIntegrand[a + b*Log[c*x^n], 
 (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, 
 f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && Integer 
Q[r]))
 

rule 2879
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log 
[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*(g_.)), x_Symbol] :> Simp[x*(a + b*Log[c 
*(d + e*x)^n])^p*(f + g*Log[h*(i + j*x)^m]), x] + (-Simp[g*j*m   Int[x*((a 
+ b*Log[c*(d + e*x)^n])^p/(i + j*x)), x], x] - Simp[b*e*n*p   Int[x*(a + b* 
Log[c*(d + e*x)^n])^(p - 1)*((f + g*Log[h*(i + j*x)^m])/(d + e*x)), x], x]) 
 /; FreeQ[{a, b, c, d, e, f, g, h, i, j, m, n}, x] && IGtQ[p, 0]
 
Maple [C] (warning: unable to verify)

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

Time = 33.00 (sec) , antiderivative size = 715, normalized size of antiderivative = 5.72

method result size
risch \(\left (b e x \ln \left (x^{n}\right )+\frac {x e \left (i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )-i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )+2 b \ln \left (c \right )-2 n b +2 a \right )}{2}\right ) \ln \left (\left (h x +g \right )^{q}\right )+\left (\frac {i e \pi \,\operatorname {csgn}\left (i \left (h x +g \right )^{q}\right ) \operatorname {csgn}\left (i f \left (h x +g \right )^{q}\right )^{2}}{4}-\frac {i e \pi \,\operatorname {csgn}\left (i \left (h x +g \right )^{q}\right ) \operatorname {csgn}\left (i f \left (h x +g \right )^{q}\right ) \operatorname {csgn}\left (i f \right )}{4}-\frac {i e \pi \operatorname {csgn}\left (i f \left (h x +g \right )^{q}\right )^{3}}{4}+\frac {i e \pi \operatorname {csgn}\left (i f \left (h x +g \right )^{q}\right )^{2} \operatorname {csgn}\left (i f \right )}{4}+\frac {\ln \left (f \right ) e}{2}+\frac {d}{2}\right ) \left (i \pi b x \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b x \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )+2 a x +2 \ln \left (c \right ) b x +2 b x \ln \left (x^{n}\right )-2 b n x -i \pi b x \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-i \pi b x \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )\right )+\frac {i q e g \ln \left (h x +g \right ) \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2 h}-\frac {i q e x \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i q e x \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}+\frac {i q e x \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}-x \ln \left (c \right ) b e q +2 b e n q x -a e q x -\frac {i q e g \ln \left (h x +g \right ) \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2 h}-\frac {i q e g \ln \left (h x +g \right ) \pi b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2 h}-\frac {i q e x \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}+\frac {i q e g \ln \left (h x +g \right ) \pi b \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2 h}+\frac {q e g \ln \left (h x +g \right ) b \ln \left (c \right )}{h}-\frac {q b e n g \ln \left (h x +g \right )}{h}+\frac {e a q g \ln \left (h x +g \right )}{h}-q b e \ln \left (x^{n}\right ) x +\frac {q b e \ln \left (x^{n}\right ) g \ln \left (h x +g \right )}{h}+\frac {q b e n g}{h}-\frac {q b e n g \ln \left (h x +g \right ) \ln \left (-\frac {h x}{g}\right )}{h}-\frac {q b e n g \operatorname {dilog}\left (-\frac {h x}{g}\right )}{h}\) \(715\)

Input:

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

Output:

(b*e*x*ln(x^n)+1/2*x*e*(I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*csgn(I*x 
^n)*csgn(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*b*ln(c)-2*n*b+2*a))*ln((h*x+g)^q)+(1/4*I*e*Pi*csgn(I*(h*x+g)^q 
)*csgn(I*f*(h*x+g)^q)^2-1/4*I*e*Pi*csgn(I*(h*x+g)^q)*csgn(I*f*(h*x+g)^q)*c 
sgn(I*f)-1/4*I*e*Pi*csgn(I*f*(h*x+g)^q)^3+1/4*I*e*Pi*csgn(I*f*(h*x+g)^q)^2 
*csgn(I*f)+1/2*ln(f)*e+1/2*d)*(I*Pi*b*x*csgn(I*x^n)*csgn(I*c*x^n)^2+I*Pi*b 
*x*csgn(I*c*x^n)^2*csgn(I*c)+2*a*x+2*ln(c)*b*x+2*b*x*ln(x^n)-2*b*n*x-I*Pi* 
b*x*csgn(I*c*x^n)^3-I*Pi*b*x*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c))+1/2*I*q/ 
h*e*g*ln(h*x+g)*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I*q*e*x*Pi*b*csgn(I*x 
^n)*csgn(I*c*x^n)^2+1/2*I*q*e*x*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+1 
/2*I*q*e*x*Pi*b*csgn(I*c*x^n)^3-x*ln(c)*b*e*q+2*b*e*n*q*x-a*e*q*x-1/2*I*q/ 
h*e*g*ln(h*x+g)*Pi*b*csgn(I*c*x^n)^3-1/2*I*q/h*e*g*ln(h*x+g)*Pi*b*csgn(I*x 
^n)*csgn(I*c*x^n)*csgn(I*c)-1/2*I*q*e*x*Pi*b*csgn(I*c*x^n)^2*csgn(I*c)+1/2 
*I*q/h*e*g*ln(h*x+g)*Pi*b*csgn(I*c*x^n)^2*csgn(I*c)+q/h*e*g*ln(h*x+g)*b*ln 
(c)-q/h*b*e*n*g*ln(h*x+g)+e*a*q/h*g*ln(h*x+g)-q*b*e*ln(x^n)*x+q/h*b*e*ln(x 
^n)*g*ln(h*x+g)+q/h*b*e*n*g-q/h*b*e*n*g*ln(h*x+g)*ln(-h*x/g)-q/h*b*e*n*g*d 
ilog(-h*x/g)
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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