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

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 = 28, antiderivative size = 127 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )}{x^2} \, dx=\frac {b e h n q \log (x)}{g}-\frac {e h q \log \left (1+\frac {g}{h x}\right ) \left (a+b \log \left (c x^n\right )\right )}{g}-\frac {b e h n q \log (g+h x)}{g}-\frac {b n \left (d+e \log \left (f (g+h x)^q\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )}{x}+\frac {b e h n q \operatorname {PolyLog}\left (2,-\frac {g}{h x}\right )}{g} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.73 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.97, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2889, 2779, 2838, 2842, 47, 14, 16}

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

\(\Big \downarrow \) 2889

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

\(\Big \downarrow \) 2779

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

\(\Big \downarrow \) 2838

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

\(\Big \downarrow \) 2842

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

\(\Big \downarrow \) 47

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

\(\Big \downarrow \) 14

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

\(\Big \downarrow \) 16

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 14
Int[(a_.)/(x_), x_Symbol] :> Simp[a*Log[x], x] /; FreeQ[a, x]
 

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

rule 47
Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Simp[b/(b*c 
 - a*d)   Int[1/(a + b*x), x], x] - Simp[d/(b*c - a*d)   Int[1/(c + d*x), x 
], x] /; FreeQ[{a, b, c, d}, x]
 

rule 2779
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^(r 
_.))), x_Symbol] :> Simp[(-Log[1 + d/(e*x^r)])*((a + b*Log[c*x^n])^p/(d*r)) 
, x] + Simp[b*n*(p/(d*r))   Int[Log[1 + d/(e*x^r)]*((a + b*Log[c*x^n])^(p - 
 1)/x), x], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[p, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

rule 2842
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_ 
))^(q_.), x_Symbol] :> Simp[(f + g*x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/( 
g*(q + 1))), x] - Simp[b*e*(n/(g*(q + 1)))   Int[(f + g*x)^(q + 1)/(d + e*x 
), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && 
NeQ[q, -1]
 

rule 2889
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log 
[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*(g_.))*(x_)^(r_.), x_Symbol] :> Simp[x^( 
r + 1)*(a + b*Log[c*(d + e*x)^n])^p*((f + g*Log[h*(i + j*x)^m])/(r + 1)), x 
] + (-Simp[g*j*(m/(r + 1))   Int[x^(r + 1)*((a + b*Log[c*(d + e*x)^n])^p/(i 
 + j*x)), x], x] - Simp[b*e*n*(p/(r + 1))   Int[x^(r + 1)*(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] && IntegerQ[r] && (E 
qQ[p, 1] || GtQ[r, 0]) && NeQ[r, -1]
 
Maple [C] (warning: unable to verify)

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

Time = 33.78 (sec) , antiderivative size = 772, normalized size of antiderivative = 6.08

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

Input:

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

Output:

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

Fricas [F]

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

integrate((a+b*log(c*x^n))*(d+e*log(f*(h*x+g)^q))/x^2,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^2, x)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f (g+h x)^q\right )\right )}{x^2} \, 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 )}{x^2} \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

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