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

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.09 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.34 \[ \int x \left (a+b \log \left (c x^n\right )\right ) \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\frac {1}{4} b x^2 \left (n-2 \left (-n \log (x)+\log \left (c x^n\right )\right )\right )+\frac {b \left (-n+2 \left (-n \log (x)+\log \left (c x^n\right )\right )\right ) \log \left (1+d f x^2\right )}{4 d f}+\frac {1}{4} b x^2 \left (-n+2 n \log (x)+2 \left (-n \log (x)+\log \left (c x^n\right )\right )\right ) \log \left (1+d f x^2\right )+\frac {1}{2} a \left (-x^2+\frac {\left (1+d f x^2\right ) \log \left (1+d f x^2\right )}{d f}\right )-b d f n \left (\frac {-\frac {x^2}{4}+\frac {1}{2} x^2 \log (x)}{d f}-\frac {\log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )}{2 d^2 f^2}-\frac {\log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )}{2 d^2 f^2}\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.99, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {2823, 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 ) \, dx\)

\(\Big \downarrow \) 2823

\(\displaystyle -b n \int \left (\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right )}{2 d f x}-\frac {x}{2}\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 d f}-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle \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 d f}-\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )-b n \left (-\frac {\operatorname {PolyLog}\left (2,-d f x^2\right )}{4 d f}+\frac {\left (d f x^2+1\right ) \log \left (d f x^2+1\right )}{4 d f}-\frac {x^2}{2}\right )\)

Input:

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

Output:

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

Defintions of rubi rules used

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

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

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

Time = 16.78 (sec) , antiderivative size = 340, normalized size of antiderivative = 2.98

method result size
risch \(\left (\frac {b \,x^{2} \ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right )}{2}+\frac {b \left (-d f \,x^{2}+\ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right )\right )}{2 d f}\right ) \ln \left (x^{n}\right )+\frac {\left (\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}-\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}+\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}+b \ln \left (c \right )+a \right ) \left (\ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right ) d \left (\frac {1}{d}+f \,x^{2}\right )-d \left (\frac {1}{d}+f \,x^{2}\right )\right )}{2 d f}-\frac {x^{2} b n \ln \left (d f \,x^{2}+1\right )}{4}+\frac {b n \,x^{2}}{2}-\frac {n b \ln \left (d f \,x^{2}+1\right )}{4 d f}-\frac {n b \ln \left (x \right ) \ln \left (d f \,x^{2}+1\right )}{2 d f}+\frac {n b \ln \left (x \right ) \ln \left (1+x \sqrt {-d f}\right )}{2 d f}+\frac {n b \ln \left (x \right ) \ln \left (1-x \sqrt {-d f}\right )}{2 d f}+\frac {n b \operatorname {dilog}\left (1+x \sqrt {-d f}\right )}{2 d f}+\frac {n b \operatorname {dilog}\left (1-x \sqrt {-d f}\right )}{2 d f}\) \(340\)

Input:

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

Output:

(1/2*b*x^2*ln(d*(1/d+f*x^2))+1/2*b*(-d*f*x^2+ln(d*(1/d+f*x^2)))/d/f)*ln(x^ 
n)+1/2*(1/2*I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I*Pi*b*csgn(I*x^n)*csgn 
(I*c*x^n)*csgn(I*c)-1/2*I*Pi*b*csgn(I*c*x^n)^3+1/2*I*Pi*b*csgn(I*c*x^n)^2* 
csgn(I*c)+b*ln(c)+a)/d/f*(ln(d*(1/d+f*x^2))*d*(1/d+f*x^2)-d*(1/d+f*x^2))-1 
/4*x^2*b*n*ln(d*f*x^2+1)+1/2*b*n*x^2-1/4*n*b/d/f*ln(d*f*x^2+1)-1/2*n*b/d/f 
*ln(x)*ln(d*f*x^2+1)+1/2*n*b/d/f*ln(x)*ln(1+x*(-d*f)^(1/2))+1/2*n*b/d/f*ln 
(x)*ln(1-x*(-d*f)^(1/2))+1/2*n*b/d/f*dilog(1+x*(-d*f)^(1/2))+1/2*n*b/d/f*d 
ilog(1-x*(-d*f)^(1/2))
 

Fricas [F]

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

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

Output:

integral(b*x*log(d*f*x^2 + 1)*log(c*x^n) + a*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 ) \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))*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 ) \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=\int { {\left (b \log \left (c x^{n}\right ) + a\right )} x \log \left ({\left (f x^{2} + \frac {1}{d}\right )} d\right ) \,d x } \] Input:

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

Output:

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

Giac [F]

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

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

Output:

integrate((b*log(c*x^n) + a)*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 ) \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 ) \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

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