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

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.29 (sec) , antiderivative size = 736, normalized size of antiderivative = 5.01 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right )}{x} \, dx =\text {Too large to display} \] Input:

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

Output:

-(a^2*m*Log[x]*Log[1 - (I*Sqrt[f]*x)/Sqrt[e]]) + a*b*m*n*Log[x]^2*Log[1 - 
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b*m*n*PolyLog[3, (I*Sqrt[f 
]*x)/Sqrt[e]] + 2*b^2*m*n*Log[c*x^n]*PolyLog[3, (I*Sqrt[f]*x)/Sqrt[e]] - 2 
*b^2*m*n^2*PolyLog[4, ((-I)*Sqrt[f]*x)/Sqrt[e]] - 2*b^2*m*n^2*PolyLog[4, ( 
I*Sqrt[f]*x)/Sqrt[e]]
 

Rubi [A] (verified)

Time = 0.64 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.10, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {2822, 2775, 2821, 2830, 7143}

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 \left (e+f x^2\right )^m\right )}{x} \, dx\)

\(\Big \downarrow \) 2822

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

\(\Big \downarrow \) 2775

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

\(\Big \downarrow \) 2821

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

\(\Big \downarrow \) 2830

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

\(\Big \downarrow \) 7143

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2775
Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.))/((d_) 
+ (e_.)*(x_)^(r_)), x_Symbol] :> Simp[f^m*Log[1 + e*(x^r/d)]*((a + b*Log[c* 
x^n])^p/(e*r)), x] - Simp[b*f^m*n*(p/(e*r))   Int[Log[1 + e*(x^r/d)]*((a + 
b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, r}, x] & 
& EqQ[m, r - 1] && IGtQ[p, 0] && (IntegerQ[m] || GtQ[f, 0]) && NeQ[r, n]
 

rule 2821
Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b 
_.))^(p_.))/(x_), x_Symbol] :> Simp[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c 
*x^n])^p/m), x] + Simp[b*n*(p/m)   Int[PolyLog[2, (-d)*f*x^m]*((a + b*Log[c 
*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 
0] && EqQ[d*e, 1]
 

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

rule 2830
Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*PolyLog[k_, (e_.)*(x_)^(q_ 
.)])/(x_), x_Symbol] :> Simp[PolyLog[k + 1, e*x^q]*((a + b*Log[c*x^n])^p/q) 
, x] - Simp[b*n*(p/q)   Int[PolyLog[k + 1, e*x^q]*((a + b*Log[c*x^n])^(p - 
1)/x), x], x] /; FreeQ[{a, b, c, e, k, n, q}, x] && GtQ[p, 0]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
Maple [C] (warning: unable to verify)

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

Time = 96.78 (sec) , antiderivative size = 1930, normalized size of antiderivative = 13.13

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

Input:

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

Output:

1/3*b^2*n^2*ln(x)^3*ln((f*x^2+e)^m)-1/3*b^2*n^2*m*ln(x)^3*ln(1+f*x^2/e)-1/ 
2*b^2*n^2*m*ln(x)^2*polylog(2,-f*x^2/e)+1/2*b^2*n^2*m*ln(x)*polylog(3,-f*x 
^2/e)-1/4*b^2*m*n^2*polylog(4,-f*x^2/e)+b*n*(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*b*(ln(x^n)-n*ln(x))+2*a)*(1/2*( 
ln((f*x^2+e)^m)-m*ln(f*x^2+e))*ln(x)^2+m*(1/2*ln(f*x^2+e)*ln(x)^2-1/2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x))-4*I*Pi*...
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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