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

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

Optimal result

Integrand size = 26, antiderivative size = 241 \[ \int x \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 {3}{4} b^2 n^2 x^2+b n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {b^2 n^2 \left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{4 d f}-\frac {b n \left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )}{2 d f}+\frac {\left (1+d f x^2\right ) \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )}{2 d f}-\frac {b^2 n^2 \operatorname {PolyLog}\left (2,-d f x^2\right )}{4 d f}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-d f x^2\right )}{2 d f}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-d f x^2\right )}{4 d f} \] Output:

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.32 (sec) , antiderivative size = 519, normalized size of antiderivative = 2.15 \[ \int x \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 {-d f x^2 \left (2 a^2-2 a b n+b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+4 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+2 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )+d f x^2 \left (2 a^2-2 a b n+b^2 n^2-2 b (-2 a+b n) \log \left (c x^n\right )+2 b^2 \log ^2\left (c x^n\right )\right ) \log \left (1+d f x^2\right )+\left (2 a^2-2 a b n+b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+4 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+2 b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right ) \log \left (1+d f x^2\right )+2 b n \left (2 a-b n-2 b n \log (x)+2 b \log \left (c x^n\right )\right ) \left (\frac {1}{2} d f x^2-d f x^2 \log (x)+\log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+\log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )\right )-b^2 n^2 \left (d f x^2-2 d f x^2 \log (x)+2 d f x^2 \log ^2(x)-2 \log ^2(x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )-2 \log ^2(x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )-4 \log (x) \operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )-4 \log (x) \operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )+4 \operatorname {PolyLog}\left (3,-i \sqrt {d} \sqrt {f} x\right )+4 \operatorname {PolyLog}\left (3,i \sqrt {d} \sqrt {f} x\right )\right )}{4 d f} \] Input:

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

Output:

(-(d*f*x^2*(2*a^2 - 2*a*b*n + b^2*n^2 + 2*b^2*n*(n*Log[x] - Log[c*x^n]) + 
4*a*b*(-(n*Log[x]) + Log[c*x^n]) + 2*b^2*(-(n*Log[x]) + Log[c*x^n])^2)) + 
d*f*x^2*(2*a^2 - 2*a*b*n + b^2*n^2 - 2*b*(-2*a + b*n)*Log[c*x^n] + 2*b^2*L 
og[c*x^n]^2)*Log[1 + d*f*x^2] + (2*a^2 - 2*a*b*n + b^2*n^2 + 2*b^2*n*(n*Lo 
g[x] - Log[c*x^n]) + 4*a*b*(-(n*Log[x]) + Log[c*x^n]) + 2*b^2*(-(n*Log[x]) 
 + Log[c*x^n])^2)*Log[1 + d*f*x^2] + 2*b*n*(2*a - b*n - 2*b*n*Log[x] + 2*b 
*Log[c*x^n])*((d*f*x^2)/2 - d*f*x^2*Log[x] + Log[x]*Log[1 - I*Sqrt[d]*Sqrt 
[f]*x] + Log[x]*Log[1 + I*Sqrt[d]*Sqrt[f]*x] + PolyLog[2, (-I)*Sqrt[d]*Sqr 
t[f]*x] + PolyLog[2, I*Sqrt[d]*Sqrt[f]*x]) - b^2*n^2*(d*f*x^2 - 2*d*f*x^2* 
Log[x] + 2*d*f*x^2*Log[x]^2 - 2*Log[x]^2*Log[1 - I*Sqrt[d]*Sqrt[f]*x] - 2* 
Log[x]^2*Log[1 + I*Sqrt[d]*Sqrt[f]*x] - 4*Log[x]*PolyLog[2, (-I)*Sqrt[d]*S 
qrt[f]*x] - 4*Log[x]*PolyLog[2, I*Sqrt[d]*Sqrt[f]*x] + 4*PolyLog[3, (-I)*S 
qrt[d]*Sqrt[f]*x] + 4*PolyLog[3, I*Sqrt[d]*Sqrt[f]*x]))/(4*d*f)
 

Rubi [A] (verified)

Time = 0.78 (sec) , antiderivative size = 227, normalized size of antiderivative = 0.94, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, 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 \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 {\left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right ) \log \left (d f x^2+1\right )}{2 d f x}-\frac {1}{2} x \left (a+b \log \left (c x^n\right )\right )\right )dx+\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{2 d f}-\frac {1}{2} x^2 \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 )}{4 d f}+\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )}{4 d f}-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )+\frac {b n \operatorname {PolyLog}\left (2,-d f x^2\right )}{8 d f}+\frac {b n \operatorname {PolyLog}\left (3,-d f x^2\right )}{8 d f}-\frac {b n \left (d f x^2+1\right ) \log \left (d f x^2+1\right )}{8 d f}+\frac {3}{8} b n x^2\right )+\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{2 d f}-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2\)

Input:

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

Output:

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

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 {\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*(a+b*ln(c*x^n))^2*ln(d*(1/d+f*x^2)),x)
 

Output:

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

Fricas [F]

\[ \int x \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 \log \left ({\left (f x^{2} + \frac {1}{d}\right )} d\right ) \,d x } \] Input:

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

Output:

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

Sympy [F(-1)]

Timed out. \[ \int x \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*(a+b*ln(c*x**n))**2*ln(d*(1/d+f*x**2)),x)
 

Output:

Timed out
 

Maxima [F]

\[ \int x \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 \log \left ({\left (f x^{2} + \frac {1}{d}\right )} d\right ) \,d x } \] Input:

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

Output:

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

Giac [F]

\[ \int x \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 \log \left ({\left (f x^{2} + \frac {1}{d}\right )} d\right ) \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int x \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\,\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*log(d*(f*x^2 + 1/d))*(a + b*log(c*x^n))^2,x)
 

Output:

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

Reduce [F]

\[ \int x \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 {-12 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )^{2}}{d f \,x^{3}+x}d x \right ) b^{2} n -24 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{d f \,x^{3}+x}d x \right ) a b n +12 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{d f \,x^{3}+x}d x \right ) b^{2} n^{2}+6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d f n \,x^{2}+12 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right ) a b d f n \,x^{2}-6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) \mathrm {log}\left (x^{n} c \right ) b^{2} d f \,n^{2} x^{2}+6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a^{2} d f n \,x^{2}+6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a^{2} n -6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a b d f \,n^{2} x^{2}-6 \,\mathrm {log}\left (d f \,x^{2}+1\right ) a b \,n^{2}+3 \,\mathrm {log}\left (d f \,x^{2}+1\right ) b^{2} d f \,n^{3} x^{2}+3 \,\mathrm {log}\left (d f \,x^{2}+1\right ) b^{2} n^{3}+4 \mathrm {log}\left (x^{n} c \right )^{3} b^{2}+12 \mathrm {log}\left (x^{n} c \right )^{2} a b -6 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d f n \,x^{2}-6 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} n -12 \,\mathrm {log}\left (x^{n} c \right ) a b d f n \,x^{2}+12 \,\mathrm {log}\left (x^{n} c \right ) b^{2} d f \,n^{2} x^{2}-6 a^{2} d f n \,x^{2}+12 a b d f \,n^{2} x^{2}-9 b^{2} d f \,n^{3} x^{2}}{12 d f n} \] Input:

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

Output:

( - 12*int(log(x**n*c)**2/(d*f*x**3 + x),x)*b**2*n - 24*int(log(x**n*c)/(d 
*f*x**3 + x),x)*a*b*n + 12*int(log(x**n*c)/(d*f*x**3 + x),x)*b**2*n**2 + 6 
*log(d*f*x**2 + 1)*log(x**n*c)**2*b**2*d*f*n*x**2 + 12*log(d*f*x**2 + 1)*l 
og(x**n*c)*a*b*d*f*n*x**2 - 6*log(d*f*x**2 + 1)*log(x**n*c)*b**2*d*f*n**2* 
x**2 + 6*log(d*f*x**2 + 1)*a**2*d*f*n*x**2 + 6*log(d*f*x**2 + 1)*a**2*n - 
6*log(d*f*x**2 + 1)*a*b*d*f*n**2*x**2 - 6*log(d*f*x**2 + 1)*a*b*n**2 + 3*l 
og(d*f*x**2 + 1)*b**2*d*f*n**3*x**2 + 3*log(d*f*x**2 + 1)*b**2*n**3 + 4*lo 
g(x**n*c)**3*b**2 + 12*log(x**n*c)**2*a*b - 6*log(x**n*c)**2*b**2*d*f*n*x* 
*2 - 6*log(x**n*c)**2*b**2*n - 12*log(x**n*c)*a*b*d*f*n*x**2 + 12*log(x**n 
*c)*b**2*d*f*n**2*x**2 - 6*a**2*d*f*n*x**2 + 12*a*b*d*f*n**2*x**2 - 9*b**2 
*d*f*n**3*x**2)/(12*d*f*n)