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

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 = 25, antiderivative size = 495 \[ \int \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right ) \, dx=4 a b m n x-8 b^2 m n^2 x+4 b m n (a-b n) x-\frac {4 b \sqrt {e} m n (a-b n) \arctan \left (\frac {\sqrt {f} x}{\sqrt {e}}\right )}{\sqrt {f}}+8 b^2 m n x \log \left (c x^n\right )-\frac {4 b^2 \sqrt {e} m n \arctan \left (\frac {\sqrt {f} x}{\sqrt {e}}\right ) \log \left (c x^n\right )}{\sqrt {f}}-2 m x \left (a+b \log \left (c x^n\right )\right )^2+\frac {2 \sqrt {e} m \arctan \left (\frac {\sqrt {f} x}{\sqrt {e}}\right ) \left (a+b \log \left (c x^n\right )\right )^2}{\sqrt {f}}-2 a b n x \log \left (d \left (e+f x^2\right )^m\right )+2 b^2 n^2 x \log \left (d \left (e+f x^2\right )^m\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (d \left (e+f x^2\right )^m\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right )-\frac {2 b^2 \sqrt {-e} m n^2 \operatorname {PolyLog}\left (2,-\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}}+\frac {2 b \sqrt {-e} m n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}}+\frac {2 b^2 \sqrt {-e} m n^2 \operatorname {PolyLog}\left (2,\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}}-\frac {2 b \sqrt {-e} m n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}}-\frac {2 b^2 \sqrt {-e} m n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}}+\frac {2 b^2 \sqrt {-e} m n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {f} x}{\sqrt {-e}}\right )}{\sqrt {f}} \] Output:

4*a*b*m*n*x-8*b^2*m*n^2*x+4*b*m*n*(-b*n+a)*x-4*b*e^(1/2)*m*n*(-b*n+a)*arct 
an(f^(1/2)*x/e^(1/2))/f^(1/2)+8*b^2*m*n*x*ln(c*x^n)-4*b^2*e^(1/2)*m*n*arct 
an(f^(1/2)*x/e^(1/2))*ln(c*x^n)/f^(1/2)-2*m*x*(a+b*ln(c*x^n))^2+2*e^(1/2)* 
m*arctan(f^(1/2)*x/e^(1/2))*(a+b*ln(c*x^n))^2/f^(1/2)-2*a*b*n*x*ln(d*(f*x^ 
2+e)^m)+2*b^2*n^2*x*ln(d*(f*x^2+e)^m)-2*b^2*n*x*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)-2*b^2*(-e)^(1/2)*m*n^2*polylog(2,- 
f^(1/2)*x/(-e)^(1/2))/f^(1/2)+2*b*(-e)^(1/2)*m*n*(a+b*ln(c*x^n))*polylog(2 
,-f^(1/2)*x/(-e)^(1/2))/f^(1/2)+2*b^2*(-e)^(1/2)*m*n^2*polylog(2,f^(1/2)*x 
/(-e)^(1/2))/f^(1/2)-2*b*(-e)^(1/2)*m*n*(a+b*ln(c*x^n))*polylog(2,f^(1/2)* 
x/(-e)^(1/2))/f^(1/2)-2*b^2*(-e)^(1/2)*m*n^2*polylog(3,-f^(1/2)*x/(-e)^(1/ 
2))/f^(1/2)+2*b^2*(-e)^(1/2)*m*n^2*polylog(3,f^(1/2)*x/(-e)^(1/2))/f^(1/2)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

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

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

Output:

(-2*a^2*Sqrt[f]*m*x + 8*a*b*Sqrt[f]*m*n*x - 12*b^2*Sqrt[f]*m*n^2*x + 2*a^2 
*Sqrt[e]*m*ArcTan[(Sqrt[f]*x)/Sqrt[e]] - 4*a*b*Sqrt[e]*m*n*ArcTan[(Sqrt[f] 
*x)/Sqrt[e]] + 4*b^2*Sqrt[e]*m*n^2*ArcTan[(Sqrt[f]*x)/Sqrt[e]] - 4*a*b*Sqr 
t[e]*m*n*ArcTan[(Sqrt[f]*x)/Sqrt[e]]*Log[x] + 4*b^2*Sqrt[e]*m*n^2*ArcTan[( 
Sqrt[f]*x)/Sqrt[e]]*Log[x] + 2*b^2*Sqrt[e]*m*n^2*ArcTan[(Sqrt[f]*x)/Sqrt[e 
]]*Log[x]^2 - 4*a*b*Sqrt[f]*m*x*Log[c*x^n] + 8*b^2*Sqrt[f]*m*n*x*Log[c*x^n 
] + 4*a*b*Sqrt[e]*m*ArcTan[(Sqrt[f]*x)/Sqrt[e]]*Log[c*x^n] - 4*b^2*Sqrt[e] 
*m*n*ArcTan[(Sqrt[f]*x)/Sqrt[e]]*Log[c*x^n] - 4*b^2*Sqrt[e]*m*n*ArcTan[(Sq 
rt[f]*x)/Sqrt[e]]*Log[x]*Log[c*x^n] - 2*b^2*Sqrt[f]*m*x*Log[c*x^n]^2 + 2*b 
^2*Sqrt[e]*m*ArcTan[(Sqrt[f]*x)/Sqrt[e]]*Log[c*x^n]^2 + (2*I)*a*b*Sqrt[e]* 
m*n*Log[x]*Log[1 - (I*Sqrt[f]*x)/Sqrt[e]] - (2*I)*b^2*Sqrt[e]*m*n^2*Log[x] 
*Log[1 - (I*Sqrt[f]*x)/Sqrt[e]] - I*b^2*Sqrt[e]*m*n^2*Log[x]^2*Log[1 - (I* 
Sqrt[f]*x)/Sqrt[e]] + (2*I)*b^2*Sqrt[e]*m*n*Log[x]*Log[c*x^n]*Log[1 - (I*S 
qrt[f]*x)/Sqrt[e]] - (2*I)*a*b*Sqrt[e]*m*n*Log[x]*Log[1 + (I*Sqrt[f]*x)/Sq 
rt[e]] + (2*I)*b^2*Sqrt[e]*m*n^2*Log[x]*Log[1 + (I*Sqrt[f]*x)/Sqrt[e]] + I 
*b^2*Sqrt[e]*m*n^2*Log[x]^2*Log[1 + (I*Sqrt[f]*x)/Sqrt[e]] - (2*I)*b^2*Sqr 
t[e]*m*n*Log[x]*Log[c*x^n]*Log[1 + (I*Sqrt[f]*x)/Sqrt[e]] + a^2*Sqrt[f]*x* 
Log[d*(e + f*x^2)^m] - 2*a*b*Sqrt[f]*n*x*Log[d*(e + f*x^2)^m] + 2*b^2*Sqrt 
[f]*n^2*x*Log[d*(e + f*x^2)^m] + 2*a*b*Sqrt[f]*x*Log[c*x^n]*Log[d*(e + f*x 
^2)^m] - 2*b^2*Sqrt[f]*n*x*Log[c*x^n]*Log[d*(e + f*x^2)^m] + b^2*Sqrt[f...
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 1.07 (sec) , antiderivative size = 553, normalized size of antiderivative = 1.12, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2818, 6, 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 \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^2\right )^m\right ) \, dx\)

\(\Big \downarrow \) 2818

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

\(\Big \downarrow \) 6

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 6
Int[(u_.)*((v_.) + (a_.)*(Fx_) + (b_.)*(Fx_))^(p_.), x_Symbol] :> Int[u*(v 
+ (a + b)*Fx)^p, x] /; FreeQ[{a, b}, x] &&  !FreeQ[Fx, x]
 

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

rule 2818
Int[Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_. 
)]*(b_.))^(p_.), x_Symbol] :> With[{u = IntHide[(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, r, m, n}, x] && IGtQ[p, 0] && Inte 
gerQ[m]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

integrate((a+b*log(c*x^n))^2*log(d*(f*x^2+e)^m),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)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-2)]

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

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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