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

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

Optimal result

Integrand size = 23, antiderivative size = 182 \[ \int \left (a+b \log \left (c x^n\right )\right ) \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=4 b n x-\frac {2 b n \arctan \left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )+\frac {2 \arctan \left (\sqrt {d} \sqrt {f} x\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {d} \sqrt {f}}-b n x \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )-\frac {i b n \operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+\frac {i b n \operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}} \] Output:

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

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.40 \[ \int \left (a+b \log \left (c x^n\right )\right ) \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx=-2 a x+\frac {2 a \arctan \left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-2 b x \left (-n-n \log (x)+\log \left (c x^n\right )\right )+\frac {2 b \arctan \left (\sqrt {d} \sqrt {f} x\right ) \left (-n-n \log (x)+\log \left (c x^n\right )\right )}{\sqrt {d} \sqrt {f}}+a x \log \left (1+d f x^2\right )+b x \left (-n+\log \left (c x^n\right )\right ) \log \left (1+d f x^2\right )-2 b d f n \left (\frac {x (-1+\log (x))}{d f}+\frac {i \left (\log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )\right )}{2 d^{3/2} f^{3/2}}-\frac {i \left (\log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+\operatorname {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )\right )}{2 d^{3/2} f^{3/2}}\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.97, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2817, 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 \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 \) 2817

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-2*x*(a + b*Log[c*x^n]) + (2*ArcTan[Sqrt[d]*Sqrt[f]*x]*(a + b*Log[c*x^n])) 
/(Sqrt[d]*Sqrt[f]) + x*(a + b*Log[c*x^n])*Log[1 + d*f*x^2] - b*n*(-4*x + ( 
2*ArcTan[Sqrt[d]*Sqrt[f]*x])/(Sqrt[d]*Sqrt[f]) + x*Log[1 + d*f*x^2] + (I*P 
olyLog[2, (-I)*Sqrt[d]*Sqrt[f]*x])/(Sqrt[d]*Sqrt[f]) - (I*PolyLog[2, I*Sqr 
t[d]*Sqrt[f]*x])/(Sqrt[d]*Sqrt[f]))
 

Defintions of rubi rules used

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

rule 2817
Int[Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_. 
)]*(b_.))^(p_.), x_Symbol] :> With[{u = IntHide[Log[d*(e + f*x^m)^r], 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, r, m, n}, x] && IGtQ[p, 0] 
&& RationalQ[m] && (EqQ[p, 1] || (FractionQ[m] && IntegerQ[1/m]) || (EqQ[r, 
 1] && EqQ[m, 1] && EqQ[d*e, 1]))
 
Maple [C] (warning: unable to verify)

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

Time = 8.28 (sec) , antiderivative size = 356, normalized size of antiderivative = 1.96

method result size
risch \(b x \ln \left (d f \,x^{2}+1\right ) \ln \left (x^{n}\right )-2 b x \ln \left (x^{n}\right )-\frac {2 b \arctan \left (\frac {x d f}{\sqrt {d f}}\right ) n \ln \left (x \right )}{\sqrt {d f}}+\frac {2 b \arctan \left (\frac {x d f}{\sqrt {d f}}\right ) \ln \left (x^{n}\right )}{\sqrt {d f}}-b n x \ln \left (d f \,x^{2}+1\right )+4 b n x -\frac {b n \sqrt {-d f}\, \ln \left (x \right ) \ln \left (1+x \sqrt {-d f}\right )}{d f}+\frac {b n \sqrt {-d f}\, \ln \left (x \right ) \ln \left (1-x \sqrt {-d f}\right )}{d f}-\frac {b n \sqrt {-d f}\, \operatorname {dilog}\left (1+x \sqrt {-d f}\right )}{d f}+\frac {b n \sqrt {-d f}\, \operatorname {dilog}\left (1-x \sqrt {-d f}\right )}{d f}-\frac {2 b n \arctan \left (\frac {x d f}{\sqrt {d f}}\right )}{\sqrt {d f}}+\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 (x \ln \left (d f \,x^{2}+1\right )-2 d f \left (\frac {x}{d f}-\frac {\arctan \left (\frac {x d f}{\sqrt {d f}}\right )}{d f \sqrt {d f}}\right )\right )\) \(356\)

Input:

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

Output:

b*x*ln(d*f*x^2+1)*ln(x^n)-2*b*x*ln(x^n)-2*b/(d*f)^(1/2)*arctan(x*d*f/(d*f) 
^(1/2))*n*ln(x)+2*b/(d*f)^(1/2)*arctan(x*d*f/(d*f)^(1/2))*ln(x^n)-b*n*x*ln 
(d*f*x^2+1)+4*b*n*x-b*n*(-d*f)^(1/2)/d/f*ln(x)*ln(1+x*(-d*f)^(1/2))+b*n*(- 
d*f)^(1/2)/d/f*ln(x)*ln(1-x*(-d*f)^(1/2))-b*n*(-d*f)^(1/2)/d/f*dilog(1+x*( 
-d*f)^(1/2))+b*n*(-d*f)^(1/2)/d/f*dilog(1-x*(-d*f)^(1/2))-2*b*n/(d*f)^(1/2 
)*arctan(x*d*f/(d*f)^(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)*(x*ln(d*f*x^2+1)-2*d*f*(1/d/f*x- 
1/d/f/(d*f)^(1/2)*arctan(x*d*f/(d*f)^(1/2))))
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

Integral((a + b*log(c*x**n))*log(d*f*x**2 + 1), x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

Output:

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

Reduce [F]

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

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

Output:

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