\(\int x^2 (a+b \sec (c+d \sqrt {x})) \, dx\) [32]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [B] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 18, antiderivative size = 348 \[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {a x^3}{3}-\frac {4 i b x^{5/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {10 i b x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {10 i b x^2 \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {120 i b x \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {120 i b x \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {240 i b \operatorname {PolyLog}\left (6,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6}-\frac {240 i b \operatorname {PolyLog}\left (6,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6} \] Output:

1/3*a*x^3-4*I*b*x^(5/2)*arctan(exp(I*(c+d*x^(1/2))))/d+10*I*b*x^2*polylog( 
2,-I*exp(I*(c+d*x^(1/2))))/d^2-10*I*b*x^2*polylog(2,I*exp(I*(c+d*x^(1/2))) 
)/d^2-40*b*x^(3/2)*polylog(3,-I*exp(I*(c+d*x^(1/2))))/d^3+40*b*x^(3/2)*pol 
ylog(3,I*exp(I*(c+d*x^(1/2))))/d^3-120*I*b*x*polylog(4,-I*exp(I*(c+d*x^(1/ 
2))))/d^4+120*I*b*x*polylog(4,I*exp(I*(c+d*x^(1/2))))/d^4+240*b*x^(1/2)*po 
lylog(5,-I*exp(I*(c+d*x^(1/2))))/d^5-240*b*x^(1/2)*polylog(5,I*exp(I*(c+d* 
x^(1/2))))/d^5+240*I*b*polylog(6,-I*exp(I*(c+d*x^(1/2))))/d^6-240*I*b*poly 
log(6,I*exp(I*(c+d*x^(1/2))))/d^6
 

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 351, normalized size of antiderivative = 1.01 \[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\frac {a x^3}{3}-\frac {4 i b x^{5/2} \arctan \left (e^{i c+i d \sqrt {x}}\right )}{d}+\frac {10 i b x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {10 i b x^2 \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {120 i b x \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {120 i b x \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {240 i b \operatorname {PolyLog}\left (6,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6}-\frac {240 i b \operatorname {PolyLog}\left (6,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6} \] Input:

Integrate[x^2*(a + b*Sec[c + d*Sqrt[x]]),x]
 

Output:

(a*x^3)/3 - ((4*I)*b*x^(5/2)*ArcTan[E^(I*c + I*d*Sqrt[x])])/d + ((10*I)*b* 
x^2*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]))])/d^2 - ((10*I)*b*x^2*PolyLog[2, 
 I*E^(I*(c + d*Sqrt[x]))])/d^2 - (40*b*x^(3/2)*PolyLog[3, (-I)*E^(I*(c + d 
*Sqrt[x]))])/d^3 + (40*b*x^(3/2)*PolyLog[3, I*E^(I*(c + d*Sqrt[x]))])/d^3 
- ((120*I)*b*x*PolyLog[4, (-I)*E^(I*(c + d*Sqrt[x]))])/d^4 + ((120*I)*b*x* 
PolyLog[4, I*E^(I*(c + d*Sqrt[x]))])/d^4 + (240*b*Sqrt[x]*PolyLog[5, (-I)* 
E^(I*(c + d*Sqrt[x]))])/d^5 - (240*b*Sqrt[x]*PolyLog[5, I*E^(I*(c + d*Sqrt 
[x]))])/d^5 + ((240*I)*b*PolyLog[6, (-I)*E^(I*(c + d*Sqrt[x]))])/d^6 - ((2 
40*I)*b*PolyLog[6, I*E^(I*(c + d*Sqrt[x]))])/d^6
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 348, 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.111, Rules used = {2010, 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 x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx\)

\(\Big \downarrow \) 2010

\(\displaystyle \int \left (a x^2+b x^2 \sec \left (c+d \sqrt {x}\right )\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a x^3}{3}-\frac {4 i b x^{5/2} \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {240 i b \operatorname {PolyLog}\left (6,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6}-\frac {240 i b \operatorname {PolyLog}\left (6,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {240 b \sqrt {x} \operatorname {PolyLog}\left (5,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {120 i b x \operatorname {PolyLog}\left (4,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {120 i b x \operatorname {PolyLog}\left (4,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {40 b x^{3/2} \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i b x^2 \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {10 i b x^2 \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}\)

Input:

Int[x^2*(a + b*Sec[c + d*Sqrt[x]]),x]
 

Output:

(a*x^3)/3 - ((4*I)*b*x^(5/2)*ArcTan[E^(I*(c + d*Sqrt[x]))])/d + ((10*I)*b* 
x^2*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]))])/d^2 - ((10*I)*b*x^2*PolyLog[2, 
 I*E^(I*(c + d*Sqrt[x]))])/d^2 - (40*b*x^(3/2)*PolyLog[3, (-I)*E^(I*(c + d 
*Sqrt[x]))])/d^3 + (40*b*x^(3/2)*PolyLog[3, I*E^(I*(c + d*Sqrt[x]))])/d^3 
- ((120*I)*b*x*PolyLog[4, (-I)*E^(I*(c + d*Sqrt[x]))])/d^4 + ((120*I)*b*x* 
PolyLog[4, I*E^(I*(c + d*Sqrt[x]))])/d^4 + (240*b*Sqrt[x]*PolyLog[5, (-I)* 
E^(I*(c + d*Sqrt[x]))])/d^5 - (240*b*Sqrt[x]*PolyLog[5, I*E^(I*(c + d*Sqrt 
[x]))])/d^5 + ((240*I)*b*PolyLog[6, (-I)*E^(I*(c + d*Sqrt[x]))])/d^6 - ((2 
40*I)*b*PolyLog[6, I*E^(I*(c + d*Sqrt[x]))])/d^6
 

Defintions of rubi rules used

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

rule 2010
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] 
, x] /; FreeQ[{c, m}, x] && SumQ[u] &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) 
+ (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
 
Maple [F]

\[\int x^{2} \left (a +b \sec \left (c +d \sqrt {x}\right )\right )d x\]

Input:

int(x^2*(a+b*sec(c+d*x^(1/2))),x)
 

Output:

int(x^2*(a+b*sec(c+d*x^(1/2))),x)
 

Fricas [F]

\[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )} x^{2} \,d x } \] Input:

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

Output:

integral(b*x^2*sec(d*sqrt(x) + c) + a*x^2, x)
 

Sympy [F]

\[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int x^{2} \left (a + b \sec {\left (c + d \sqrt {x} \right )}\right )\, dx \] Input:

integrate(x**2*(a+b*sec(c+d*x**(1/2))),x)
 

Output:

Integral(x**2*(a + b*sec(c + d*sqrt(x))), x)
 

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 966 vs. \(2 (256) = 512\).

Time = 0.22 (sec) , antiderivative size = 966, normalized size of antiderivative = 2.78 \[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\text {Too large to display} \] Input:

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

Output:

1/3*((d*sqrt(x) + c)^6*a - 6*(d*sqrt(x) + c)^5*a*c + 15*(d*sqrt(x) + c)^4* 
a*c^2 - 20*(d*sqrt(x) + c)^3*a*c^3 + 15*(d*sqrt(x) + c)^2*a*c^4 - 6*(d*sqr 
t(x) + c)*a*c^5 - 6*b*c^5*log(sec(d*sqrt(x) + c) + tan(d*sqrt(x) + c)) - 6 
*(I*(d*sqrt(x) + c)^5*b - 5*I*(d*sqrt(x) + c)^4*b*c + 10*I*(d*sqrt(x) + c) 
^3*b*c^2 - 10*I*(d*sqrt(x) + c)^2*b*c^3 + 5*I*(d*sqrt(x) + c)*b*c^4)*arcta 
n2(cos(d*sqrt(x) + c), sin(d*sqrt(x) + c) + 1) - 6*(I*(d*sqrt(x) + c)^5*b 
- 5*I*(d*sqrt(x) + c)^4*b*c + 10*I*(d*sqrt(x) + c)^3*b*c^2 - 10*I*(d*sqrt( 
x) + c)^2*b*c^3 + 5*I*(d*sqrt(x) + c)*b*c^4)*arctan2(cos(d*sqrt(x) + c), - 
sin(d*sqrt(x) + c) + 1) - 30*(I*(d*sqrt(x) + c)^4*b - 4*I*(d*sqrt(x) + c)^ 
3*b*c + 6*I*(d*sqrt(x) + c)^2*b*c^2 - 4*I*(d*sqrt(x) + c)*b*c^3 + I*b*c^4) 
*dilog(I*e^(I*d*sqrt(x) + I*c)) - 30*(-I*(d*sqrt(x) + c)^4*b + 4*I*(d*sqrt 
(x) + c)^3*b*c - 6*I*(d*sqrt(x) + c)^2*b*c^2 + 4*I*(d*sqrt(x) + c)*b*c^3 - 
 I*b*c^4)*dilog(-I*e^(I*d*sqrt(x) + I*c)) + 3*((d*sqrt(x) + c)^5*b - 5*(d* 
sqrt(x) + c)^4*b*c + 10*(d*sqrt(x) + c)^3*b*c^2 - 10*(d*sqrt(x) + c)^2*b*c 
^3 + 5*(d*sqrt(x) + c)*b*c^4)*log(cos(d*sqrt(x) + c)^2 + sin(d*sqrt(x) + c 
)^2 + 2*sin(d*sqrt(x) + c) + 1) - 3*((d*sqrt(x) + c)^5*b - 5*(d*sqrt(x) + 
c)^4*b*c + 10*(d*sqrt(x) + c)^3*b*c^2 - 10*(d*sqrt(x) + c)^2*b*c^3 + 5*(d* 
sqrt(x) + c)*b*c^4)*log(cos(d*sqrt(x) + c)^2 + sin(d*sqrt(x) + c)^2 - 2*si 
n(d*sqrt(x) + c) + 1) - 720*I*b*polylog(6, I*e^(I*d*sqrt(x) + I*c)) + 720* 
I*b*polylog(6, -I*e^(I*d*sqrt(x) + I*c)) - 720*((d*sqrt(x) + c)*b - b*c...
 

Giac [F]

\[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int { {\left (b \sec \left (d \sqrt {x} + c\right ) + a\right )} x^{2} \,d x } \] Input:

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

Output:

integrate((b*sec(d*sqrt(x) + c) + a)*x^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=\int x^2\,\left (a+\frac {b}{\cos \left (c+d\,\sqrt {x}\right )}\right ) \,d x \] Input:

int(x^2*(a + b/cos(c + d*x^(1/2))),x)
 

Output:

int(x^2*(a + b/cos(c + d*x^(1/2))), x)
 

Reduce [F]

\[ \int x^2 \left (a+b \sec \left (c+d \sqrt {x}\right )\right ) \, dx=-2 \left (\int \frac {\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{2} x^{2}}{\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{2}-1}d x \right ) b +\frac {a \,x^{3}}{3}+\frac {b \,x^{3}}{3} \] Input:

int(x^2*(a+b*sec(c+d*x^(1/2))),x)
 

Output:

( - 6*int((tan((sqrt(x)*d + c)/2)**2*x**2)/(tan((sqrt(x)*d + c)/2)**2 - 1) 
,x)*b + a*x**3 + b*x**3)/3