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

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

Optimal result

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

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

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

Output:

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

Rubi [C] (verified)

Result contains complex when optimal does not.

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

\(\Big \downarrow \) 2825

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(-2*b^2*n^2*Log[1 + d*f*x^2])/x - (2*b*n*(a + b*Log[c*x^n])*Log[1 + d*f*x^ 
2])/x - ((a + b*Log[c*x^n])^2*Log[1 + d*f*x^2])/x - 2*f*((-2*b^2*Sqrt[d]*n 
^2*ArcTan[Sqrt[d]*Sqrt[f]*x])/Sqrt[f] - (2*b*Sqrt[d]*n*ArcTan[Sqrt[d]*Sqrt 
[f]*x]*(a + b*Log[c*x^n]))/Sqrt[f] - (Sqrt[-d]*(a + b*Log[c*x^n])^2*Log[1 
- Sqrt[-d]*Sqrt[f]*x])/(2*Sqrt[f]) + (Sqrt[-d]*(a + b*Log[c*x^n])^2*Log[1 
+ Sqrt[-d]*Sqrt[f]*x])/(2*Sqrt[f]) + (b*Sqrt[-d]*n*(a + b*Log[c*x^n])*Poly 
Log[2, -(Sqrt[-d]*Sqrt[f]*x)])/Sqrt[f] - (b*Sqrt[-d]*n*(a + b*Log[c*x^n])* 
PolyLog[2, Sqrt[-d]*Sqrt[f]*x])/Sqrt[f] + (I*b^2*Sqrt[d]*n^2*PolyLog[2, (- 
I)*Sqrt[d]*Sqrt[f]*x])/Sqrt[f] - (I*b^2*Sqrt[d]*n^2*PolyLog[2, I*Sqrt[d]*S 
qrt[f]*x])/Sqrt[f] - (b^2*Sqrt[-d]*n^2*PolyLog[3, -(Sqrt[-d]*Sqrt[f]*x)])/ 
Sqrt[f] + (b^2*Sqrt[-d]*n^2*PolyLog[3, Sqrt[-d]*Sqrt[f]*x])/Sqrt[f])
 

Defintions of rubi rules used

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

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

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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