\(\int \frac {(a+b \log (c x^n))^2 \log (d (e+f x)^m)}{x^2} \, dx\) [88]

Optimal result
Mathematica [B] (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 = 26, antiderivative size = 248 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x^2} \, dx=\frac {2 b^2 f m n^2 \log (x)}{e}-\frac {2 b f m n \log \left (1+\frac {e}{f x}\right ) \left (a+b \log \left (c x^n\right )\right )}{e}-\frac {f m \log \left (1+\frac {e}{f x}\right ) \left (a+b \log \left (c x^n\right )\right )^2}{e}-\frac {2 b^2 f m n^2 \log (e+f x)}{e}-\frac {2 b^2 n^2 \log \left (d (e+f x)^m\right )}{x}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \log \left (d (e+f x)^m\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x}+\frac {2 b^2 f m n^2 \operatorname {PolyLog}\left (2,-\frac {e}{f x}\right )}{e}+\frac {2 b f m n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {e}{f x}\right )}{e}+\frac {2 b^2 f m n^2 \operatorname {PolyLog}\left (3,-\frac {e}{f x}\right )}{e} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(600\) vs. \(2(248)=496\).

Time = 0.35 (sec) , antiderivative size = 600, normalized size of antiderivative = 2.42 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x^2} \, dx=-\frac {-3 a^2 f m x \log (x)-6 a b f m n x \log (x)-6 b^2 f m n^2 x \log (x)+3 a b f m n x \log ^2(x)+3 b^2 f m n^2 x \log ^2(x)-b^2 f m n^2 x \log ^3(x)-6 a b f m x \log (x) \log \left (c x^n\right )-6 b^2 f m n x \log (x) \log \left (c x^n\right )+3 b^2 f m n x \log ^2(x) \log \left (c x^n\right )-3 b^2 f m x \log (x) \log ^2\left (c x^n\right )+3 a^2 f m x \log (e+f x)+6 a b f m n x \log (e+f x)+6 b^2 f m n^2 x \log (e+f x)-6 a b f m n x \log (x) \log (e+f x)-6 b^2 f m n^2 x \log (x) \log (e+f x)+3 b^2 f m n^2 x \log ^2(x) \log (e+f x)+6 a b f m x \log \left (c x^n\right ) \log (e+f x)+6 b^2 f m n x \log \left (c x^n\right ) \log (e+f x)-6 b^2 f m n x \log (x) \log \left (c x^n\right ) \log (e+f x)+3 b^2 f m x \log ^2\left (c x^n\right ) \log (e+f x)+3 a^2 e \log \left (d (e+f x)^m\right )+6 a b e n \log \left (d (e+f x)^m\right )+6 b^2 e n^2 \log \left (d (e+f x)^m\right )+6 a b e \log \left (c x^n\right ) \log \left (d (e+f x)^m\right )+6 b^2 e n \log \left (c x^n\right ) \log \left (d (e+f x)^m\right )+3 b^2 e \log ^2\left (c x^n\right ) \log \left (d (e+f x)^m\right )+6 a b f m n x \log (x) \log \left (1+\frac {f x}{e}\right )+6 b^2 f m n^2 x \log (x) \log \left (1+\frac {f x}{e}\right )-3 b^2 f m n^2 x \log ^2(x) \log \left (1+\frac {f x}{e}\right )+6 b^2 f m n x \log (x) \log \left (c x^n\right ) \log \left (1+\frac {f x}{e}\right )+6 b f m n x \left (a+b n+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {f x}{e}\right )-6 b^2 f m n^2 x \operatorname {PolyLog}\left (3,-\frac {f x}{e}\right )}{3 e x} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.61 (sec) , antiderivative size = 238, normalized size of antiderivative = 0.96, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {2825, 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 \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d (e+f x)^m\right )}{x^2} \, dx\)

\(\Big \downarrow \) 2825

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(-2*b^2*n^2*Log[d*(e + f*x)^m])/x - (2*b*n*(a + b*Log[c*x^n])*Log[d*(e + f 
*x)^m])/x - ((a + b*Log[c*x^n])^2*Log[d*(e + f*x)^m])/x - f*m*((-2*b^2*n^2 
*Log[x])/e + (2*b*n*Log[1 + e/(f*x)]*(a + b*Log[c*x^n]))/e + (Log[1 + e/(f 
*x)]*(a + b*Log[c*x^n])^2)/e + (2*b^2*n^2*Log[e + f*x])/e - (2*b^2*n^2*Pol 
yLog[2, -(e/(f*x))])/e - (2*b*n*(a + b*Log[c*x^n])*PolyLog[2, -(e/(f*x))]) 
/e - (2*b^2*n^2*PolyLog[3, -(e/(f*x))])/e)
 

Defintions of rubi rules used

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

rule 2825
Int[Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_. 
)]*(b_.))^(p_.)*((g_.)*(x_))^(q_.), x_Symbol] :> With[{u = IntHide[(g*x)^q* 
(a + b*Log[c*x^n])^p, x]}, Simp[Log[d*(e + f*x^m)^r]   u, x] - Simp[f*m*r 
 Int[x^(m - 1)/(e + f*x^m)   u, x], x]] /; FreeQ[{a, b, c, d, e, f, g, r, m 
, n, q}, x] && IGtQ[p, 0] && RationalQ[m] && RationalQ[q]
 
Maple [C] (warning: unable to verify)

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

Time = 66.46 (sec) , antiderivative size = 3983, normalized size of antiderivative = 16.06

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

Input:

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

Output:

m*f/e*ln(x)*a^2+(-1/8*I*Pi*csgn(I*d)*csgn(I*(f*x+e)^m)*csgn(I*d*(f*x+e)^m) 
+1/8*I*Pi*csgn(I*d)*csgn(I*d*(f*x+e)^m)^2+1/8*I*Pi*csgn(I*(f*x+e)^m)*csgn( 
I*d*(f*x+e)^m)^2-1/8*I*Pi*csgn(I*d*(f*x+e)^m)^3+1/4*ln(d))*(-(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*c 
sgn(I*c*x^n)^3+I*Pi*b*csgn(I*c*x^n)^2*csgn(I*c)+2*b*ln(c)+2*a)^2/x-4*b^2/x 
*ln(x^n)^2-8*b^2*n/x*ln(x^n)-8*b^2*n^2/x+4*(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*P 
i*b*csgn(I*c*x^n)^2*csgn(I*c)+2*b*ln(c)+2*a)*b*(-ln(x^n)/x-n/x))-m*f/e*ln( 
f*x+e)*a^2+2*m*f/e*ln(x)*ln(c)*b^2*n+2*m*f/e*ln(x)*ln(c)*a*b+2*m*f/e*ln(x) 
*a*n*b-2*m*f*b*ln(x^n)/e*ln(f*x+e)*a+2*m*f*b*ln(x^n)/e*ln(x)*a-m*f*b*n/e*l 
n(x)^2*a+2*m*f*b*n/e*dilog(-f*x/e)*a-m*f*b^2*n/e*ln(x^n)*ln(x)^2-2*m*f*b^2 
/e*ln(x)*dilog(-f*x/e)*n^2+2*m*f*b^2*n/e*ln(x^n)*dilog(-f*x/e)+m*f*b^2/e*n 
^2*ln(f*x+e)*ln(x)^2-m*f*b^2/e*n^2*ln(x)^2*ln(1+f*x/e)-2*m*f*b^2/e*n^2*ln( 
x)*polylog(2,-f*x/e)-2*m*f*ln(x^n)/e*ln(f*x+e)*b^2*ln(c)-2*m*f*ln(x^n)/e*l 
n(f*x+e)*n*b^2+2*m*f*ln(x^n)/e*ln(x)*b^2*ln(c)+(-b^2/x*ln(x^n)^2-(I*Pi*b^2 
*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)- 
I*Pi*b^2*csgn(I*c*x^n)^3+I*Pi*b^2*csgn(I*c*x^n)^2*csgn(I*c)+2*b^2*ln(c)+2* 
n*b^2+2*a*b)/x*ln(x^n)-1/4*(2*Pi^2*b^2*csgn(I*x^n)^2*csgn(I*c*x^n)^3*csgn( 
I*c)-Pi^2*b^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2*csgn(I*c)^2-4*Pi^2*b^2*csgn(I* 
x^n)*csgn(I*c*x^n)^4*csgn(I*c)+4*I*Pi*a*b*csgn(I*x^n)*csgn(I*c*x^n)^2+4...
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

( - int(log(x**n*c)**2/(e*x**2 + f*x**3),x)*b**2*e**2*m*x - 2*int(log(x**n 
*c)/(e*x**2 + f*x**3),x)*a*b*e**2*m*x - 2*int(log(x**n*c)/(e*x**2 + f*x**3 
),x)*b**2*e**2*m*n*x - log((e + f*x)**m*d)*log(x**n*c)**2*b**2*e - 2*log(( 
e + f*x)**m*d)*log(x**n*c)*a*b*e - 2*log((e + f*x)**m*d)*log(x**n*c)*b**2* 
e*n - log((e + f*x)**m*d)*a**2*e - log((e + f*x)**m*d)*a**2*f*x - 2*log((e 
 + f*x)**m*d)*a*b*e*n - 2*log((e + f*x)**m*d)*a*b*f*n*x - 2*log((e + f*x)* 
*m*d)*b**2*e*n**2 - 2*log((e + f*x)**m*d)*b**2*f*n**2*x - log(x**n*c)**2*b 
**2*e*m - 2*log(x**n*c)*a*b*e*m - 4*log(x**n*c)*b**2*e*m*n + log(x)*a**2*f 
*m*x + 2*log(x)*a*b*f*m*n*x + 2*log(x)*b**2*f*m*n**2*x - 2*a*b*e*m*n - 4*b 
**2*e*m*n**2)/(e*x)