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

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

Optimal result

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.48 (sec) , antiderivative size = 917, normalized size of antiderivative = 2.15 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right )}{x^2} \, dx =\text {Too large to display} \] Input:

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

Output:

(2*a^2*Sqrt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(I*Sqrt[f]*x)/Sqrt[e] 
] - (2*I)*b^2*Sqrt[f]*m*n*x*Log[x]*Log[c*x^n]*Log[1 + (I*Sqrt[f]*x)/Sqrt[e 
]] - a^2*Sqrt[e]*Log[d*(e + f*x^2)^m] - 2*a*b*Sqrt[e]*n*Log[d*(e + f*x^2)^ 
m] - 2*b^2*Sqrt[e]*n^2*Log[d*(e + f*x^2)^m] - 2*a*b*Sqrt[e]*Log[c*x^n]*Log 
[d*(e + f*x^2)^m] - 2*b^2*Sqrt[e]*n*Log[c*x^n]*Log[d*(e + f*x^2)^m] - b^2* 
Sqrt[e]*Log[c*x^n]^2*Log[d*(e + f*x^2)^m] - (2*I)*b*Sqrt[f]*m*n*x*(a + b*n 
 + b*Log[c*x^n])*PolyLog[2, ((-I)*Sqrt[f]*x)/Sqrt[e]] + (2*I)*b*Sqrt[f]...
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.81 (sec) , antiderivative size = 476, normalized size of antiderivative = 1.11, 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 {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right )}{x^2} \, dx\)

\(\Big \downarrow \) 2825

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(-2*b^2*n^2*Log[d*(e + f*x^2)^m])/x - (2*b*n*(a + b*Log[c*x^n])*Log[d*(e + 
 f*x^2)^m])/x - ((a + b*Log[c*x^n])^2*Log[d*(e + f*x^2)^m])/x - 2*f*m*((-2 
*b^2*n^2*ArcTan[(Sqrt[f]*x)/Sqrt[e]])/(Sqrt[e]*Sqrt[f]) - (2*b*n*ArcTan[(S 
qrt[f]*x)/Sqrt[e]]*(a + b*Log[c*x^n]))/(Sqrt[e]*Sqrt[f]) - ((a + b*Log[c*x 
^n])^2*Log[1 - (Sqrt[f]*x)/Sqrt[-e]])/(2*Sqrt[-e]*Sqrt[f]) + ((a + b*Log[c 
*x^n])^2*Log[1 + (Sqrt[f]*x)/Sqrt[-e]])/(2*Sqrt[-e]*Sqrt[f]) + (b*n*(a + b 
*Log[c*x^n])*PolyLog[2, -((Sqrt[f]*x)/Sqrt[-e])])/(Sqrt[-e]*Sqrt[f]) - (b* 
n*(a + b*Log[c*x^n])*PolyLog[2, (Sqrt[f]*x)/Sqrt[-e]])/(Sqrt[-e]*Sqrt[f]) 
+ (I*b^2*n^2*PolyLog[2, ((-I)*Sqrt[f]*x)/Sqrt[e]])/(Sqrt[e]*Sqrt[f]) - (I* 
b^2*n^2*PolyLog[2, (I*Sqrt[f]*x)/Sqrt[e]])/(Sqrt[e]*Sqrt[f]) - (b^2*n^2*Po 
lyLog[3, -((Sqrt[f]*x)/Sqrt[-e])])/(Sqrt[-e]*Sqrt[f]) + (b^2*n^2*PolyLog[3 
, (Sqrt[f]*x)/Sqrt[-e]])/(Sqrt[-e]*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 (f \,x^{2}+e \right )^{m}\right )}{x^{2}}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral((b^2*log(c*x^n)^2 + 2*a*b*log(c*x^n) + a^2)*log((f*x^2 + e)^m*d)/ 
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 (e+f x^2\right )^m\right )}{x^2} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Maxima [F(-2)]

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

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(e>0)', see `assume?` for more de 
tails)Is e
 

Giac [F]

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

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

Output:

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

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

Output:

int((log(d*(e + f*x^2)^m)*(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 (e+f x^2\right )^m\right )}{x^2} \, dx=\frac {2 \sqrt {f}\, \sqrt {e}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {e}}\right ) a^{2} m x +4 \sqrt {f}\, \sqrt {e}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {e}}\right ) a b m n x +4 \sqrt {f}\, \sqrt {e}\, \mathit {atan} \left (\frac {f x}{\sqrt {f}\, \sqrt {e}}\right ) b^{2} m \,n^{2} x -2 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )^{2}}{f \,x^{4}+e \,x^{2}}d x \right ) b^{2} e^{2} m x -4 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{f \,x^{4}+e \,x^{2}}d x \right ) a b \,e^{2} m x -4 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{f \,x^{4}+e \,x^{2}}d x \right ) b^{2} e^{2} m n x -\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) \mathrm {log}\left (x^{n} c \right )^{2} b^{2} e -2 \,\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) \mathrm {log}\left (x^{n} c \right ) a b e -2 \,\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) \mathrm {log}\left (x^{n} c \right ) b^{2} e n -\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) a^{2} e -2 \,\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) a b e n -2 \,\mathrm {log}\left (\left (f \,x^{2}+e \right )^{m} d \right ) b^{2} e \,n^{2}-2 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} e m -4 \,\mathrm {log}\left (x^{n} c \right ) a b e m -8 \,\mathrm {log}\left (x^{n} c \right ) b^{2} e m n -4 a b e m n -8 b^{2} e m \,n^{2}}{e x} \] Input:

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

Output:

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