\(\int x^3 (a+b \sec (c+d x^2))^2 \, dx\) [10]

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

Optimal result

Integrand size = 18, antiderivative size = 133 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{2 d^2}+\frac {i a b \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {i a b \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )}{d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d} \] Output:

1/4*a^2*x^4-2*I*a*b*x^2*arctan(exp(I*(d*x^2+c)))/d+1/2*b^2*ln(cos(d*x^2+c) 
)/d^2+I*a*b*polylog(2,-I*exp(I*(d*x^2+c)))/d^2-I*a*b*polylog(2,I*exp(I*(d* 
x^2+c)))/d^2+1/2*b^2*x^2*tan(d*x^2+c)/d
 

Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.92 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 d^2 x^4-8 i a b d x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )+2 b^2 \log \left (\cos \left (c+d x^2\right )\right )+4 i a b \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )-4 i a b \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )+2 b^2 d x^2 \tan \left (c+d x^2\right )}{4 d^2} \] Input:

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

Output:

(a^2*d^2*x^4 - (8*I)*a*b*d*x^2*ArcTan[E^(I*(c + d*x^2))] + 2*b^2*Log[Cos[c 
 + d*x^2]] + (4*I)*a*b*PolyLog[2, (-I)*E^(I*(c + d*x^2))] - (4*I)*a*b*Poly 
Log[2, I*E^(I*(c + d*x^2))] + 2*b^2*d*x^2*Tan[c + d*x^2])/(4*d^2)
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 131, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {4692, 3042, 4678, 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^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4692

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int x^2 \left (a+b \csc \left (d x^2+c+\frac {\pi }{2}\right )\right )^2dx^2\)

\(\Big \downarrow \) 4678

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {a^2 x^4}{2}-\frac {4 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {2 i a b \operatorname {PolyLog}\left (2,-i e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {2 i a b \operatorname {PolyLog}\left (2,i e^{i \left (d x^2+c\right )}\right )}{d^2}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{d}\right )\)

Input:

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

Output:

((a^2*x^4)/2 - ((4*I)*a*b*x^2*ArcTan[E^(I*(c + d*x^2))])/d + (b^2*Log[Cos[ 
c + d*x^2]])/d^2 + ((2*I)*a*b*PolyLog[2, (-I)*E^(I*(c + d*x^2))])/d^2 - (( 
2*I)*a*b*PolyLog[2, I*E^(I*(c + d*x^2))])/d^2 + (b^2*x^2*Tan[c + d*x^2])/d 
)/2
 

Defintions of rubi rules used

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4678
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 

rule 4692
Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol 
] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^ 
p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m + 
 1)/n], 0] && IntegerQ[p]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 525 vs. \(2 (109) = 218\).

Time = 0.11 (sec) , antiderivative size = 525, normalized size of antiderivative = 3.95 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^{2} d^{2} x^{4} \cos \left (d x^{2} + c\right ) + 2 \, b^{2} d x^{2} \sin \left (d x^{2} + c\right ) - 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) - 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) + 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) + 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) - {\left (2 \, a b c - b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) - {\left (2 \, a b c - b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right )}{4 \, d^{2} \cos \left (d x^{2} + c\right )} \] Input:

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

Output:

1/4*(a^2*d^2*x^4*cos(d*x^2 + c) + 2*b^2*d*x^2*sin(d*x^2 + c) - 2*I*a*b*cos 
(d*x^2 + c)*dilog(I*cos(d*x^2 + c) + sin(d*x^2 + c)) - 2*I*a*b*cos(d*x^2 + 
 c)*dilog(I*cos(d*x^2 + c) - sin(d*x^2 + c)) + 2*I*a*b*cos(d*x^2 + c)*dilo 
g(-I*cos(d*x^2 + c) + sin(d*x^2 + c)) + 2*I*a*b*cos(d*x^2 + c)*dilog(-I*co 
s(d*x^2 + c) - sin(d*x^2 + c)) - (2*a*b*c - b^2)*cos(d*x^2 + c)*log(cos(d* 
x^2 + c) + I*sin(d*x^2 + c) + I) + (2*a*b*c + b^2)*cos(d*x^2 + c)*log(cos( 
d*x^2 + c) - I*sin(d*x^2 + c) + I) + 2*(a*b*d*x^2 + a*b*c)*cos(d*x^2 + c)* 
log(I*cos(d*x^2 + c) + sin(d*x^2 + c) + 1) - 2*(a*b*d*x^2 + a*b*c)*cos(d*x 
^2 + c)*log(I*cos(d*x^2 + c) - sin(d*x^2 + c) + 1) + 2*(a*b*d*x^2 + a*b*c) 
*cos(d*x^2 + c)*log(-I*cos(d*x^2 + c) + sin(d*x^2 + c) + 1) - 2*(a*b*d*x^2 
 + a*b*c)*cos(d*x^2 + c)*log(-I*cos(d*x^2 + c) - sin(d*x^2 + c) + 1) - (2* 
a*b*c - b^2)*cos(d*x^2 + c)*log(-cos(d*x^2 + c) + I*sin(d*x^2 + c) + I) + 
(2*a*b*c + b^2)*cos(d*x^2 + c)*log(-cos(d*x^2 + c) - I*sin(d*x^2 + c) + I) 
)/(d^2*cos(d*x^2 + c))
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

1/4*a^2*x^4 + 1/4*(4*b^2*d*x^2*sin(2*d*x^2 + 2*c) + 16*(a*b*d^3*cos(2*d*x^ 
2 + 2*c)^2 + a*b*d^3*sin(2*d*x^2 + 2*c)^2 + 2*a*b*d^3*cos(2*d*x^2 + 2*c) + 
 a*b*d^3)*integrate((x^3*cos(2*d*x^2 + 2*c)*cos(d*x^2 + c) + x^3*sin(2*d*x 
^2 + 2*c)*sin(d*x^2 + c) + x^3*cos(d*x^2 + c))/(d*cos(2*d*x^2 + 2*c)^2 + d 
*sin(2*d*x^2 + 2*c)^2 + 2*d*cos(2*d*x^2 + 2*c) + d), x) + (b^2*cos(2*d*x^2 
 + 2*c)^2 + b^2*sin(2*d*x^2 + 2*c)^2 + 2*b^2*cos(2*d*x^2 + 2*c) + b^2)*log 
(cos(2*d*x^2 + 2*c)^2 + sin(2*d*x^2 + 2*c)^2 + 2*cos(2*d*x^2 + 2*c) + 1))/ 
(d^2*cos(2*d*x^2 + 2*c)^2 + d^2*sin(2*d*x^2 + 2*c)^2 + 2*d^2*cos(2*d*x^2 + 
 2*c) + d^2)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

( - 16*cos(c + d*x**2)*int((tan((c + d*x**2)/2)**2*x**3)/(tan((c + d*x**2) 
/2)**2 - 1),x)*a*b*d**2 - 2*cos(c + d*x**2)*log(tan((c + d*x**2)/2)**2 + 1 
)*b**2 + 2*cos(c + d*x**2)*log(tan((c + d*x**2)/2) - 1)*b**2 + 2*cos(c + d 
*x**2)*log(tan((c + d*x**2)/2) + 1)*b**2 + cos(c + d*x**2)*a**2*d**2*x**4 
+ 2*cos(c + d*x**2)*a*b*d**2*x**4 + 2*sin(c + d*x**2)*b**2*d*x**2)/(4*cos( 
c + d*x**2)*d**2)