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

Optimal result
Mathematica [A] (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 = 27, antiderivative size = 276 \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x^2} \, dx=\frac {a x}{g}-\frac {b n x}{g}+\frac {b (d+e x) \log \left (c (d+e x)^n\right )}{e g}+\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^{3/2}}-\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^{3/2}}-\frac {b \sqrt {-f} n \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^{3/2}}+\frac {b \sqrt {-f} n \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^{3/2}} \] Output:

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

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 263, normalized size of antiderivative = 0.95 \[ \int \frac {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x^2} \, dx=\frac {2 a \sqrt {g} x-2 b \sqrt {g} n x+\frac {2 b \sqrt {g} (d+e x) \log \left (c (d+e x)^n\right )}{e}+\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )-\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )-b \sqrt {-f} n \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )+b \sqrt {-f} n \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^{3/2}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.94 (sec) , antiderivative size = 276, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {2863, 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 {x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x^2} \, dx\)

\(\Big \downarrow \) 2863

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(a*x)/g - (b*n*x)/g + (b*(d + e*x)*Log[c*(d + e*x)^n])/(e*g) + (Sqrt[-f]*( 
a + b*Log[c*(d + e*x)^n])*Log[(e*(Sqrt[-f] - Sqrt[g]*x))/(e*Sqrt[-f] + d*S 
qrt[g])])/(2*g^(3/2)) - (Sqrt[-f]*(a + b*Log[c*(d + e*x)^n])*Log[(e*(Sqrt[ 
-f] + Sqrt[g]*x))/(e*Sqrt[-f] - d*Sqrt[g])])/(2*g^(3/2)) - (b*Sqrt[-f]*n*P 
olyLog[2, -((Sqrt[g]*(d + e*x))/(e*Sqrt[-f] - d*Sqrt[g]))])/(2*g^(3/2)) + 
(b*Sqrt[-f]*n*PolyLog[2, (Sqrt[g]*(d + e*x))/(e*Sqrt[-f] + d*Sqrt[g])])/(2 
*g^(3/2))
 

Defintions of rubi rules used

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

rule 2863
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((h_.)*(x_)) 
^(m_.)*((f_) + (g_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a 
 + b*Log[c*(d + e*x)^n])^p, (h*x)^m*(f + g*x^r)^q, x], x] /; FreeQ[{a, b, c 
, d, e, f, g, h, m, n, p, q, r}, x] && IntegerQ[m] && IntegerQ[q]
 
Maple [C] (warning: unable to verify)

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

Time = 1.66 (sec) , antiderivative size = 491, normalized size of antiderivative = 1.78

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

Input:

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

Output:

b*ln((e*x+d)^n)/g*x+b/e/g*d*ln((e*x+d)^n)+b*f/g/(g*f)^(1/2)*arctan(1/2*(2* 
g*(e*x+d)-2*d*g)/e/(g*f)^(1/2))*n*ln(e*x+d)-b*f/g/(g*f)^(1/2)*arctan(1/2*( 
2*g*(e*x+d)-2*d*g)/e/(g*f)^(1/2))*ln((e*x+d)^n)-b*n*x/g-b*d*n/e/g-1/2*b*n* 
f/g*ln(e*x+d)/(-g*f)^(1/2)*ln((e*(-g*f)^(1/2)-g*(e*x+d)+d*g)/(e*(-g*f)^(1/ 
2)+d*g))+1/2*b*n*f/g*ln(e*x+d)/(-g*f)^(1/2)*ln((e*(-g*f)^(1/2)+g*(e*x+d)-d 
*g)/(e*(-g*f)^(1/2)-d*g))-1/2*b*n*f/g/(-g*f)^(1/2)*dilog((e*(-g*f)^(1/2)-g 
*(e*x+d)+d*g)/(e*(-g*f)^(1/2)+d*g))+1/2*b*n*f/g/(-g*f)^(1/2)*dilog((e*(-g* 
f)^(1/2)+g*(e*x+d)-d*g)/(e*(-g*f)^(1/2)-d*g))+(1/2*I*b*Pi*csgn(I*(e*x+d)^n 
)*csgn(I*c*(e*x+d)^n)^2-1/2*I*b*Pi*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)*c 
sgn(I*c)-1/2*I*b*Pi*csgn(I*c*(e*x+d)^n)^3+1/2*I*b*Pi*csgn(I*c*(e*x+d)^n)^2 
*csgn(I*c)+b*ln(c)+a)*(x/g-f/g/(g*f)^(1/2)*arctan(g*x/(g*f)^(1/2)))
 

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

-a*(f*arctan(g*x/sqrt(f*g))/(sqrt(f*g)*g) - x/g) + b*integrate((x^2*log((e 
*x + d)^n) + x^2*log(c))/(g*x^2 + f), x)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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