\(\int x^3 (a+b \log (c x^n))^2 \log (d (\frac {1}{d}+f x^2)) \, dx\) [38]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F(-1)]
Maxima [F]
Giac [F(-2)]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 28, antiderivative size = 367 \[ \int x^3 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\frac {7 b^2 n^2 x^2}{32 d f}-\frac {3}{64} b^2 n^2 x^4-\frac {3 b n x^2 \left (a+b \log \left (c x^n\right )\right )}{8 d f}+\frac {1}{8} b n x^4 \left (a+b \log \left (c x^n\right )\right )+\frac {x^2 \left (a+b \log \left (c x^n\right )\right )^2}{4 d f}-\frac {1}{8} x^4 \left (a+b \log \left (c x^n\right )\right )^2-\frac {b^2 n^2 \log \left (1+d f x^2\right )}{32 d^2 f^2}+\frac {1}{32} b^2 n^2 x^4 \log \left (1+d f x^2\right )+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{8 d^2 f^2}-\frac {1}{8} b n x^4 \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{4 d^2 f^2}+\frac {1}{4} x^4 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\frac {b^2 n^2 \operatorname {PolyLog}\left (2,-d f x^2\right )}{16 d^2 f^2}-\frac {b n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-d f x^2\right )}{4 d^2 f^2}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-d f x^2\right )}{8 d^2 f^2} \] Output:

7/32*b^2*n^2*x^2/d/f-3/64*b^2*n^2*x^4-3/8*b*n*x^2*(a+b*ln(c*x^n))/d/f+1/8* 
b*n*x^4*(a+b*ln(c*x^n))+1/4*x^2*(a+b*ln(c*x^n))^2/d/f-1/8*x^4*(a+b*ln(c*x^ 
n))^2-1/32*b^2*n^2*ln(d*f*x^2+1)/d^2/f^2+1/32*b^2*n^2*x^4*ln(d*f*x^2+1)+1/ 
8*b*n*(a+b*ln(c*x^n))*ln(d*f*x^2+1)/d^2/f^2-1/8*b*n*x^4*(a+b*ln(c*x^n))*ln 
(d*f*x^2+1)-1/4*(a+b*ln(c*x^n))^2*ln(d*f*x^2+1)/d^2/f^2+1/4*x^4*(a+b*ln(c* 
x^n))^2*ln(d*f*x^2+1)+1/16*b^2*n^2*polylog(2,-d*f*x^2)/d^2/f^2-1/4*b*n*(a+ 
b*ln(c*x^n))*polylog(2,-d*f*x^2)/d^2/f^2+1/8*b^2*n^2*polylog(3,-d*f*x^2)/d 
^2/f^2
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.42 (sec) , antiderivative size = 654, normalized size of antiderivative = 1.78 \[ \int x^3 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\frac {2 d f x^2 \left (8 a^2-4 a b n+b^2 n^2+4 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+16 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+8 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )-d^2 f^2 x^4 \left (8 a^2-4 a b n+b^2 n^2+4 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+16 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+8 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )+2 d^2 f^2 x^4 \left (8 a^2-4 a b n+b^2 n^2-4 b (-4 a+b n) \log \left (c x^n\right )+8 b^2 \log ^2\left (c x^n\right )\right ) \log \left (1+d f x^2\right )-2 \left (8 a^2-4 a b n+b^2 n^2+4 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+16 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+8 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right ) \log \left (1+d f x^2\right )+b n \left (-4 a+b n+4 b n \log (x)-4 b \log \left (c x^n\right )\right ) \left (4 d f x^2-d^2 f^2 x^4-8 d f x^2 \log (x)+4 d^2 f^2 x^4 \log (x)+8 \log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+8 \log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+8 \operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )+8 \operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )\right )+32 b^2 n^2 \left (\frac {1}{4} d f x^2 \left (1-2 \log (x)+2 \log ^2(x)\right )-\frac {1}{32} d^2 f^2 x^4 \left (1-4 \log (x)+8 \log ^2(x)\right )-\frac {1}{2} \log ^2(x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )-\frac {1}{2} \log ^2(x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )-\log (x) \operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )-\log (x) \operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (3,-i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (3,i \sqrt {d} \sqrt {f} x\right )\right )}{64 d^2 f^2} \] Input:

Integrate[x^3*(a + b*Log[c*x^n])^2*Log[d*(d^(-1) + f*x^2)],x]
 

Output:

(2*d*f*x^2*(8*a^2 - 4*a*b*n + b^2*n^2 + 4*b^2*n*(n*Log[x] - Log[c*x^n]) + 
16*a*b*(-(n*Log[x]) + Log[c*x^n]) + 8*b^2*(-(n*Log[x]) + Log[c*x^n])^2) - 
d^2*f^2*x^4*(8*a^2 - 4*a*b*n + b^2*n^2 + 4*b^2*n*(n*Log[x] - Log[c*x^n]) + 
 16*a*b*(-(n*Log[x]) + Log[c*x^n]) + 8*b^2*(-(n*Log[x]) + Log[c*x^n])^2) + 
 2*d^2*f^2*x^4*(8*a^2 - 4*a*b*n + b^2*n^2 - 4*b*(-4*a + b*n)*Log[c*x^n] + 
8*b^2*Log[c*x^n]^2)*Log[1 + d*f*x^2] - 2*(8*a^2 - 4*a*b*n + b^2*n^2 + 4*b^ 
2*n*(n*Log[x] - Log[c*x^n]) + 16*a*b*(-(n*Log[x]) + Log[c*x^n]) + 8*b^2*(- 
(n*Log[x]) + Log[c*x^n])^2)*Log[1 + d*f*x^2] + b*n*(-4*a + b*n + 4*b*n*Log 
[x] - 4*b*Log[c*x^n])*(4*d*f*x^2 - d^2*f^2*x^4 - 8*d*f*x^2*Log[x] + 4*d^2* 
f^2*x^4*Log[x] + 8*Log[x]*Log[1 - I*Sqrt[d]*Sqrt[f]*x] + 8*Log[x]*Log[1 + 
I*Sqrt[d]*Sqrt[f]*x] + 8*PolyLog[2, (-I)*Sqrt[d]*Sqrt[f]*x] + 8*PolyLog[2, 
 I*Sqrt[d]*Sqrt[f]*x]) + 32*b^2*n^2*((d*f*x^2*(1 - 2*Log[x] + 2*Log[x]^2)) 
/4 - (d^2*f^2*x^4*(1 - 4*Log[x] + 8*Log[x]^2))/32 - (Log[x]^2*Log[1 - I*Sq 
rt[d]*Sqrt[f]*x])/2 - (Log[x]^2*Log[1 + I*Sqrt[d]*Sqrt[f]*x])/2 - Log[x]*P 
olyLog[2, (-I)*Sqrt[d]*Sqrt[f]*x] - Log[x]*PolyLog[2, I*Sqrt[d]*Sqrt[f]*x] 
 + PolyLog[3, (-I)*Sqrt[d]*Sqrt[f]*x] + PolyLog[3, I*Sqrt[d]*Sqrt[f]*x]))/ 
(64*d^2*f^2)
 

Rubi [A] (verified)

Time = 0.73 (sec) , antiderivative size = 338, normalized size of antiderivative = 0.92, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {2824, 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 x^3 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \left (a+b \log \left (c x^n\right )\right )^2 \, dx\)

\(\Big \downarrow \) 2824

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

\(\Big \downarrow \) 2009

\(\displaystyle -2 b n \left (\frac {\operatorname {PolyLog}\left (2,-d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )}{8 d^2 f^2}-\frac {\log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )}{16 d^2 f^2}+\frac {3 x^2 \left (a+b \log \left (c x^n\right )\right )}{16 d f}+\frac {1}{16} x^4 \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )-\frac {1}{16} x^4 \left (a+b \log \left (c x^n\right )\right )-\frac {b n \operatorname {PolyLog}\left (2,-d f x^2\right )}{32 d^2 f^2}-\frac {b n \operatorname {PolyLog}\left (3,-d f x^2\right )}{16 d^2 f^2}+\frac {b n \log \left (d f x^2+1\right )}{64 d^2 f^2}-\frac {7 b n x^2}{64 d f}-\frac {1}{64} b n x^4 \log \left (d f x^2+1\right )+\frac {3}{128} b n x^4\right )-\frac {\log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{4 d^2 f^2}+\frac {x^2 \left (a+b \log \left (c x^n\right )\right )^2}{4 d f}+\frac {1}{4} x^4 \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{8} x^4 \left (a+b \log \left (c x^n\right )\right )^2\)

Input:

Int[x^3*(a + b*Log[c*x^n])^2*Log[d*(d^(-1) + f*x^2)],x]
 

Output:

(x^2*(a + b*Log[c*x^n])^2)/(4*d*f) - (x^4*(a + b*Log[c*x^n])^2)/8 - ((a + 
b*Log[c*x^n])^2*Log[1 + d*f*x^2])/(4*d^2*f^2) + (x^4*(a + b*Log[c*x^n])^2* 
Log[1 + d*f*x^2])/4 - 2*b*n*((-7*b*n*x^2)/(64*d*f) + (3*b*n*x^4)/128 + (3* 
x^2*(a + b*Log[c*x^n]))/(16*d*f) - (x^4*(a + b*Log[c*x^n]))/16 + (b*n*Log[ 
1 + d*f*x^2])/(64*d^2*f^2) - (b*n*x^4*Log[1 + d*f*x^2])/64 - ((a + b*Log[c 
*x^n])*Log[1 + d*f*x^2])/(16*d^2*f^2) + (x^4*(a + b*Log[c*x^n])*Log[1 + d* 
f*x^2])/16 - (b*n*PolyLog[2, -(d*f*x^2)])/(32*d^2*f^2) + ((a + b*Log[c*x^n 
])*PolyLog[2, -(d*f*x^2)])/(8*d^2*f^2) - (b*n*PolyLog[3, -(d*f*x^2)])/(16* 
d^2*f^2))
 

Defintions of rubi rules used

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

rule 2824
Int[Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_ 
.))^(p_.)*((g_.)*(x_))^(q_.), x_Symbol] :> With[{u = IntHide[(g*x)^q*Log[d* 
(e + f*x^m)], x]}, Simp[(a + b*Log[c*x^n])^p   u, x] - Simp[b*n*p   Int[(a 
+ b*Log[c*x^n])^(p - 1)/x   u, x], x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, 
 q}, x] && IGtQ[p, 0] && RationalQ[m] && RationalQ[q] && NeQ[q, -1] && (EqQ 
[p, 1] || (FractionQ[m] && IntegerQ[(q + 1)/m]) || (IGtQ[q, 0] && IntegerQ[ 
(q + 1)/m] && EqQ[d*e, 1]))
 
Maple [F]

\[\int x^{3} {\left (a +b \ln \left (c \,x^{n}\right )\right )}^{2} \ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right )d x\]

Input:

int(x^3*(a+b*ln(c*x^n))^2*ln(d*(1/d+f*x^2)),x)
 

Output:

int(x^3*(a+b*ln(c*x^n))^2*ln(d*(1/d+f*x^2)),x)
 

Fricas [F]

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

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

Output:

integral(b^2*x^3*log(d*f*x^2 + 1)*log(c*x^n)^2 + 2*a*b*x^3*log(d*f*x^2 + 1 
)*log(c*x^n) + a^2*x^3*log(d*f*x^2 + 1), x)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

1/32*(8*b^2*x^4*log(x^n)^2 - 4*(b^2*(n - 4*log(c)) - 4*a*b)*x^4*log(x^n) + 
 ((n^2 - 4*n*log(c) + 8*log(c)^2)*b^2 - 4*a*b*(n - 4*log(c)) + 8*a^2)*x^4) 
*log(d*f*x^2 + 1) - integrate(1/16*(8*b^2*d*f*x^5*log(x^n)^2 + 4*(4*a*b*d* 
f - (d*f*n - 4*d*f*log(c))*b^2)*x^5*log(x^n) + (8*a^2*d*f - 4*(d*f*n - 4*d 
*f*log(c))*a*b + (d*f*n^2 - 4*d*f*n*log(c) + 8*d*f*log(c)^2)*b^2)*x^5)/(d* 
f*x^2 + 1), x)
 

Giac [F(-2)]

Exception generated. \[ \int x^3 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int x^3 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\frac {-48 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a^{2} n -6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) b^{2} n^{3}-24 a^{2} d^{2} f^{2} n \,x^{4}+48 a^{2} d f n \,x^{2}-9 b^{2} d^{2} f^{2} n^{3} x^{4}+42 b^{2} d f \,n^{3} x^{2}+192 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{d f \,x^{3}+x}d x \right ) a b n +96 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right ) a b \,d^{2} f^{2} n \,x^{4}-48 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{d f \,x^{3}+x}d x \right ) b^{2} n^{2}+96 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )^{2}}{d f \,x^{3}+x}d x \right ) b^{2} n +48 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a^{2} d^{2} f^{2} n \,x^{4}+6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) b^{2} d^{2} f^{2} n^{3} x^{4}-24 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d^{2} f^{2} n \,x^{4}+48 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d f n \,x^{2}+24 \,\mathrm {log}\left (x^{n} c \right ) b^{2} d^{2} f^{2} n^{2} x^{4}-72 \,\mathrm {log}\left (x^{n} c \right ) b^{2} d f \,n^{2} x^{2}+24 a b \,d^{2} f^{2} n^{2} x^{4}-72 a b d f \,n^{2} x^{2}-24 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right ) b^{2} d^{2} f^{2} n^{2} x^{4}-24 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a b \,d^{2} f^{2} n^{2} x^{4}-48 \,\mathrm {log}\left (x^{n} c \right ) a b \,d^{2} f^{2} n \,x^{4}+96 \,\mathrm {log}\left (x^{n} c \right ) a b d f n \,x^{2}+24 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a b \,n^{2}+48 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d^{2} f^{2} n \,x^{4}-96 \mathrm {log}\left (x^{n} c \right )^{2} a b +24 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} n -32 \mathrm {log}\left (x^{n} c \right )^{3} b^{2}}{192 d^{2} f^{2} n} \] Input:

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

Output:

(96*int(log(x**n*c)**2/(d*f*x**3 + x),x)*b**2*n + 192*int(log(x**n*c)/(d*f 
*x**3 + x),x)*a*b*n - 48*int(log(x**n*c)/(d*f*x**3 + x),x)*b**2*n**2 + 48* 
log(d*f*x**2 + 1)*log(x**n*c)**2*b**2*d**2*f**2*n*x**4 + 96*log(d*f*x**2 + 
 1)*log(x**n*c)*a*b*d**2*f**2*n*x**4 - 24*log(d*f*x**2 + 1)*log(x**n*c)*b* 
*2*d**2*f**2*n**2*x**4 + 48*log(d*f*x**2 + 1)*a**2*d**2*f**2*n*x**4 - 48*l 
og(d*f*x**2 + 1)*a**2*n - 24*log(d*f*x**2 + 1)*a*b*d**2*f**2*n**2*x**4 + 2 
4*log(d*f*x**2 + 1)*a*b*n**2 + 6*log(d*f*x**2 + 1)*b**2*d**2*f**2*n**3*x** 
4 - 6*log(d*f*x**2 + 1)*b**2*n**3 - 32*log(x**n*c)**3*b**2 - 96*log(x**n*c 
)**2*a*b - 24*log(x**n*c)**2*b**2*d**2*f**2*n*x**4 + 48*log(x**n*c)**2*b** 
2*d*f*n*x**2 + 24*log(x**n*c)**2*b**2*n - 48*log(x**n*c)*a*b*d**2*f**2*n*x 
**4 + 96*log(x**n*c)*a*b*d*f*n*x**2 + 24*log(x**n*c)*b**2*d**2*f**2*n**2*x 
**4 - 72*log(x**n*c)*b**2*d*f*n**2*x**2 - 24*a**2*d**2*f**2*n*x**4 + 48*a* 
*2*d*f*n*x**2 + 24*a*b*d**2*f**2*n**2*x**4 - 72*a*b*d*f*n**2*x**2 - 9*b**2 
*d**2*f**2*n**3*x**4 + 42*b**2*d*f*n**3*x**2)/(192*d**2*f**2*n)