\(\int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx\) [822]

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

Optimal result

Integrand size = 18, antiderivative size = 356 \[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\frac {3}{2} i x^2 \cos ^2(x) \sqrt {a \sec ^4(x)}+\frac {1}{2} x^3 \cos ^2(x) \sqrt {a \sec ^4(x)}-2 x^3 \text {arctanh}\left (e^{2 i x}\right ) \cos ^2(x) \sqrt {a \sec ^4(x)}-3 x \cos ^2(x) \log \left (1+e^{2 i x}\right ) \sqrt {a \sec ^4(x)}+\frac {3}{2} i \cos ^2(x) \operatorname {PolyLog}\left (2,-e^{2 i x}\right ) \sqrt {a \sec ^4(x)}+\frac {3}{2} i x^2 \cos ^2(x) \operatorname {PolyLog}\left (2,-e^{2 i x}\right ) \sqrt {a \sec ^4(x)}-\frac {3}{2} i x^2 \cos ^2(x) \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \sqrt {a \sec ^4(x)}-\frac {3}{2} x \cos ^2(x) \operatorname {PolyLog}\left (3,-e^{2 i x}\right ) \sqrt {a \sec ^4(x)}+\frac {3}{2} x \cos ^2(x) \operatorname {PolyLog}\left (3,e^{2 i x}\right ) \sqrt {a \sec ^4(x)}-\frac {3}{4} i \cos ^2(x) \operatorname {PolyLog}\left (4,-e^{2 i x}\right ) \sqrt {a \sec ^4(x)}+\frac {3}{4} i \cos ^2(x) \operatorname {PolyLog}\left (4,e^{2 i x}\right ) \sqrt {a \sec ^4(x)}-\frac {3}{2} x^2 \cos (x) \sqrt {a \sec ^4(x)} \sin (x)+\frac {1}{2} x^3 \sqrt {a \sec ^4(x)} \sin ^2(x) \] Output:

3/2*I*x^2*cos(x)^2*(a*sec(x)^4)^(1/2)+1/2*x^3*cos(x)^2*(a*sec(x)^4)^(1/2)- 
2*x^3*arctanh(exp(2*I*x))*cos(x)^2*(a*sec(x)^4)^(1/2)-3*x*cos(x)^2*ln(1+ex 
p(2*I*x))*(a*sec(x)^4)^(1/2)+3/2*I*cos(x)^2*polylog(2,-exp(2*I*x))*(a*sec( 
x)^4)^(1/2)+3/2*I*x^2*cos(x)^2*polylog(2,-exp(2*I*x))*(a*sec(x)^4)^(1/2)-3 
/2*I*x^2*cos(x)^2*polylog(2,exp(2*I*x))*(a*sec(x)^4)^(1/2)-3/2*x*cos(x)^2* 
polylog(3,-exp(2*I*x))*(a*sec(x)^4)^(1/2)+3/2*x*cos(x)^2*polylog(3,exp(2*I 
*x))*(a*sec(x)^4)^(1/2)-3/4*I*cos(x)^2*polylog(4,-exp(2*I*x))*(a*sec(x)^4) 
^(1/2)+3/4*I*cos(x)^2*polylog(4,exp(2*I*x))*(a*sec(x)^4)^(1/2)-3/2*x^2*cos 
(x)*(a*sec(x)^4)^(1/2)*sin(x)+1/2*x^3*(a*sec(x)^4)^(1/2)*sin(x)^2
 

Mathematica [A] (verified)

Time = 0.78 (sec) , antiderivative size = 191, normalized size of antiderivative = 0.54 \[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\frac {1}{64} \cos ^2(x) \sqrt {a \sec ^4(x)} \left (-i \pi ^4+96 i x^2+32 i x^4+64 x^3 \log \left (1-e^{-2 i x}\right )-192 x \log \left (1+e^{2 i x}\right )-64 x^3 \log \left (1+e^{2 i x}\right )+96 i x^2 \operatorname {PolyLog}\left (2,e^{-2 i x}\right )+96 i \left (1+x^2\right ) \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+96 x \operatorname {PolyLog}\left (3,e^{-2 i x}\right )-96 x \operatorname {PolyLog}\left (3,-e^{2 i x}\right )-48 i \operatorname {PolyLog}\left (4,e^{-2 i x}\right )-48 i \operatorname {PolyLog}\left (4,-e^{2 i x}\right )+32 x^3 \sec ^2(x)-96 x^2 \tan (x)\right ) \] Input:

Integrate[x^3*Csc[x]*Sec[x]*Sqrt[a*Sec[x]^4],x]
 

Output:

(Cos[x]^2*Sqrt[a*Sec[x]^4]*((-I)*Pi^4 + (96*I)*x^2 + (32*I)*x^4 + 64*x^3*L 
og[1 - E^((-2*I)*x)] - 192*x*Log[1 + E^((2*I)*x)] - 64*x^3*Log[1 + E^((2*I 
)*x)] + (96*I)*x^2*PolyLog[2, E^((-2*I)*x)] + (96*I)*(1 + x^2)*PolyLog[2, 
-E^((2*I)*x)] + 96*x*PolyLog[3, E^((-2*I)*x)] - 96*x*PolyLog[3, -E^((2*I)* 
x)] - (48*I)*PolyLog[4, E^((-2*I)*x)] - (48*I)*PolyLog[4, -E^((2*I)*x)] + 
32*x^3*Sec[x]^2 - 96*x^2*Tan[x]))/64
 

Rubi [A] (verified)

Time = 0.86 (sec) , antiderivative size = 203, normalized size of antiderivative = 0.57, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {7271, 4920, 27, 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^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx\)

\(\Big \downarrow \) 7271

\(\displaystyle \cos ^2(x) \sqrt {a \sec ^4(x)} \int x^3 \csc (x) \sec ^3(x)dx\)

\(\Big \downarrow \) 4920

\(\displaystyle \cos ^2(x) \sqrt {a \sec ^4(x)} \left (-3 \int \frac {1}{2} x^2 \left (\tan ^2(x)+2 \log (\tan (x))\right )dx+\frac {1}{2} x^3 \tan ^2(x)+x^3 \log (\tan (x))\right )\)

\(\Big \downarrow \) 27

\(\displaystyle \cos ^2(x) \sqrt {a \sec ^4(x)} \left (-\frac {3}{2} \int x^2 \left (\tan ^2(x)+2 \log (\tan (x))\right )dx+\frac {1}{2} x^3 \tan ^2(x)+x^3 \log (\tan (x))\right )\)

\(\Big \downarrow \) 2010

\(\displaystyle \cos ^2(x) \sqrt {a \sec ^4(x)} \left (-\frac {3}{2} \int \left (\tan ^2(x) x^2+2 \log (\tan (x)) x^2\right )dx+\frac {1}{2} x^3 \tan ^2(x)+x^3 \log (\tan (x))\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle \cos ^2(x) \sqrt {a \sec ^4(x)} \left (-\frac {3}{2} \left (\frac {4}{3} x^3 \text {arctanh}\left (e^{2 i x}\right )-i x^2 \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+i x^2 \operatorname {PolyLog}\left (2,e^{2 i x}\right )+x \operatorname {PolyLog}\left (3,-e^{2 i x}\right )-x \operatorname {PolyLog}\left (3,e^{2 i x}\right )-i \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+\frac {1}{2} i \operatorname {PolyLog}\left (4,-e^{2 i x}\right )-\frac {1}{2} i \operatorname {PolyLog}\left (4,e^{2 i x}\right )-\frac {x^3}{3}+\frac {2}{3} x^3 \log (\tan (x))-i x^2+x^2 \tan (x)+2 x \log \left (1+e^{2 i x}\right )\right )+\frac {1}{2} x^3 \tan ^2(x)+x^3 \log (\tan (x))\right )\)

Input:

Int[x^3*Csc[x]*Sec[x]*Sqrt[a*Sec[x]^4],x]
 

Output:

Cos[x]^2*Sqrt[a*Sec[x]^4]*(x^3*Log[Tan[x]] + (x^3*Tan[x]^2)/2 - (3*((-I)*x 
^2 - x^3/3 + (4*x^3*ArcTanh[E^((2*I)*x)])/3 + 2*x*Log[1 + E^((2*I)*x)] + ( 
2*x^3*Log[Tan[x]])/3 - I*PolyLog[2, -E^((2*I)*x)] - I*x^2*PolyLog[2, -E^(( 
2*I)*x)] + I*x^2*PolyLog[2, E^((2*I)*x)] + x*PolyLog[3, -E^((2*I)*x)] - x* 
PolyLog[3, E^((2*I)*x)] + (I/2)*PolyLog[4, -E^((2*I)*x)] - (I/2)*PolyLog[4 
, E^((2*I)*x)] + x^2*Tan[x]))/2)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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]]
 

rule 4920
Int[Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b 
_.)*(x_)]^(p_.), x_Symbol] :> Module[{u = IntHide[Csc[a + b*x]^n*Sec[a + b* 
x]^p, x]}, Simp[(c + d*x)^m   u, x] - Simp[d*m   Int[(c + d*x)^(m - 1)*u, x 
], x]] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p] && GtQ[m, 0] && NeQ[n, 
p]
 

rule 7271
Int[(u_.)*((a_.)*(v_)^(m_.))^(p_), x_Symbol] :> Simp[a^IntPart[p]*((a*v^m)^ 
FracPart[p]/v^(m*FracPart[p]))   Int[u*v^(m*p), x], x] /; FreeQ[{a, m, p}, 
x] &&  !IntegerQ[p] &&  !FreeQ[v, x] &&  !(EqQ[a, 1] && EqQ[m, 1]) &&  !(Eq 
Q[v, x] && EqQ[m, 1])
 
Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 254, normalized size of antiderivative = 0.71

method result size
risch \(\sqrt {\frac {a \,{\mathrm e}^{4 i x}}{\left (1+{\mathrm e}^{2 i x}\right )^{4}}}\, x^{2} \left (2 x -3 i-3 i {\mathrm e}^{-2 i x}\right )-2 i \sqrt {\frac {a \,{\mathrm e}^{4 i x}}{\left (1+{\mathrm e}^{2 i x}\right )^{4}}}\, {\mathrm e}^{-2 i x} \left (1+{\mathrm e}^{2 i x}\right )^{2} \left (-\frac {3 x^{2}}{2}-\frac {3 i x \ln \left (1+{\mathrm e}^{2 i x}\right )}{2}-\frac {3 \operatorname {polylog}\left (2, -{\mathrm e}^{2 i x}\right )}{4}-\frac {i x^{3} \ln \left (1+{\mathrm e}^{2 i x}\right )}{2}-\frac {3 x^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i x}\right )}{4}-\frac {3 i x \operatorname {polylog}\left (3, -{\mathrm e}^{2 i x}\right )}{4}+\frac {3 \operatorname {polylog}\left (4, -{\mathrm e}^{2 i x}\right )}{8}+\frac {i x^{3} \ln \left (1-{\mathrm e}^{i x}\right )}{2}+\frac {3 x^{2} \operatorname {polylog}\left (2, {\mathrm e}^{i x}\right )}{2}+3 i x \operatorname {polylog}\left (3, {\mathrm e}^{i x}\right )-3 \operatorname {polylog}\left (4, {\mathrm e}^{i x}\right )+\frac {i x^{3} \ln \left ({\mathrm e}^{i x}+1\right )}{2}+\frac {3 x^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{i x}\right )}{2}+3 i x \operatorname {polylog}\left (3, -{\mathrm e}^{i x}\right )-3 \operatorname {polylog}\left (4, -{\mathrm e}^{i x}\right )\right )\) \(254\)

Input:

int(x^3*csc(x)*sec(x)*(a*sec(x)^4)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

(a*exp(4*I*x)/(1+exp(2*I*x))^4)^(1/2)*x^2*(2*x-3*I-3*I*exp(-2*I*x))-2*I*(a 
*exp(4*I*x)/(1+exp(2*I*x))^4)^(1/2)*exp(-2*I*x)*(1+exp(2*I*x))^2*(-3/2*x^2 
-3/2*I*x*ln(1+exp(2*I*x))-3/4*polylog(2,-exp(2*I*x))-1/2*I*x^3*ln(1+exp(2* 
I*x))-3/4*x^2*polylog(2,-exp(2*I*x))-3/4*I*x*polylog(3,-exp(2*I*x))+3/8*po 
lylog(4,-exp(2*I*x))+1/2*I*x^3*ln(1-exp(I*x))+3/2*x^2*polylog(2,exp(I*x))+ 
3*I*x*polylog(3,exp(I*x))-3*polylog(4,exp(I*x))+1/2*I*x^3*ln(exp(I*x)+1)+3 
/2*x^2*polylog(2,-exp(I*x))+3*I*x*polylog(3,-exp(I*x))-3*polylog(4,-exp(I* 
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. 740 vs. \(2 (266) = 532\).

Time = 0.17 (sec) , antiderivative size = 740, normalized size of antiderivative = 2.08 \[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\text {Too large to display} \] Input:

integrate(x^3*csc(x)*sec(x)*(a*sec(x)^4)^(1/2),x, algorithm="fricas")
 

Output:

3*x*sqrt(a/cos(x)^4)*cos(x)^2*polylog(3, cos(x) + I*sin(x)) + 3*x*sqrt(a/c 
os(x)^4)*cos(x)^2*polylog(3, cos(x) - I*sin(x)) - 3*x*sqrt(a/cos(x)^4)*cos 
(x)^2*polylog(3, I*cos(x) + sin(x)) - 3*x*sqrt(a/cos(x)^4)*cos(x)^2*polylo 
g(3, I*cos(x) - sin(x)) - 3*x*sqrt(a/cos(x)^4)*cos(x)^2*polylog(3, -I*cos( 
x) + sin(x)) - 3*x*sqrt(a/cos(x)^4)*cos(x)^2*polylog(3, -I*cos(x) - sin(x) 
) + 3*x*sqrt(a/cos(x)^4)*cos(x)^2*polylog(3, -cos(x) + I*sin(x)) + 3*x*sqr 
t(a/cos(x)^4)*cos(x)^2*polylog(3, -cos(x) - I*sin(x)) + 3*I*sqrt(a/cos(x)^ 
4)*cos(x)^2*polylog(4, cos(x) + I*sin(x)) - 3*I*sqrt(a/cos(x)^4)*cos(x)^2* 
polylog(4, cos(x) - I*sin(x)) + 3*I*sqrt(a/cos(x)^4)*cos(x)^2*polylog(4, I 
*cos(x) + sin(x)) - 3*I*sqrt(a/cos(x)^4)*cos(x)^2*polylog(4, I*cos(x) - si 
n(x)) - 3*I*sqrt(a/cos(x)^4)*cos(x)^2*polylog(4, -I*cos(x) + sin(x)) + 3*I 
*sqrt(a/cos(x)^4)*cos(x)^2*polylog(4, -I*cos(x) - sin(x)) - 3*I*sqrt(a/cos 
(x)^4)*cos(x)^2*polylog(4, -cos(x) + I*sin(x)) + 3*I*sqrt(a/cos(x)^4)*cos( 
x)^2*polylog(4, -cos(x) - I*sin(x)) + 1/2*(x^3*cos(x)^2*log(cos(x) + I*sin 
(x) + 1) + x^3*cos(x)^2*log(cos(x) - I*sin(x) + 1) + x^3*cos(x)^2*log(-cos 
(x) + I*sin(x) + 1) + x^3*cos(x)^2*log(-cos(x) - I*sin(x) + 1) - 3*I*x^2*c 
os(x)^2*dilog(cos(x) + I*sin(x)) + 3*I*x^2*cos(x)^2*dilog(cos(x) - I*sin(x 
)) + 3*I*x^2*cos(x)^2*dilog(-cos(x) + I*sin(x)) - 3*I*x^2*cos(x)^2*dilog(- 
cos(x) - I*sin(x)) - 3*(I*x^2 + I)*cos(x)^2*dilog(I*cos(x) + sin(x)) - 3*( 
-I*x^2 - I)*cos(x)^2*dilog(I*cos(x) - sin(x)) - 3*(-I*x^2 - I)*cos(x)^2...
 

Sympy [F]

\[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\int x^{3} \sqrt {a \sec ^{4}{\left (x \right )}} \csc {\left (x \right )} \sec {\left (x \right )}\, dx \] Input:

integrate(x**3*csc(x)*sec(x)*(a*sec(x)**4)**(1/2),x)
 

Output:

Integral(x**3*sqrt(a*sec(x)**4)*csc(x)*sec(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. 852 vs. \(2 (266) = 532\).

Time = 0.19 (sec) , antiderivative size = 852, normalized size of antiderivative = 2.39 \[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\text {Too large to display} \] Input:

integrate(x^3*csc(x)*sec(x)*(a*sec(x)^4)^(1/2),x, algorithm="maxima")
 

Output:

(18*x^2*cos(4*x) + 18*I*x^2*sin(4*x) - 2*(4*x^3 + (4*x^3 + 9*x)*cos(4*x) + 
 2*(4*x^3 + 9*x)*cos(2*x) - (-4*I*x^3 - 9*I*x)*sin(4*x) - 2*(-4*I*x^3 - 9* 
I*x)*sin(2*x) + 9*x)*arctan2(sin(2*x), cos(2*x) + 1) + 6*(x^3*cos(4*x) + 2 
*x^3*cos(2*x) + I*x^3*sin(4*x) + 2*I*x^3*sin(2*x) + x^3)*arctan2(sin(x), c 
os(x) + 1) - 6*(x^3*cos(4*x) + 2*x^3*cos(2*x) + I*x^3*sin(4*x) + 2*I*x^3*s 
in(2*x) + x^3)*arctan2(sin(x), -cos(x) + 1) + 6*(-2*I*x^3 + 3*x^2)*cos(2*x 
) + 3*(4*x^2 + (4*x^2 + 3)*cos(4*x) + 2*(4*x^2 + 3)*cos(2*x) + (4*I*x^2 + 
3*I)*sin(4*x) + 2*(4*I*x^2 + 3*I)*sin(2*x) + 3)*dilog(-e^(2*I*x)) - 18*(x^ 
2*cos(4*x) + 2*x^2*cos(2*x) + I*x^2*sin(4*x) + 2*I*x^2*sin(2*x) + x^2)*dil 
og(-e^(I*x)) - 18*(x^2*cos(4*x) + 2*x^2*cos(2*x) + I*x^2*sin(4*x) + 2*I*x^ 
2*sin(2*x) + x^2)*dilog(e^(I*x)) - (-4*I*x^3 + (-4*I*x^3 - 9*I*x)*cos(4*x) 
 - 2*(4*I*x^3 + 9*I*x)*cos(2*x) + (4*x^3 + 9*x)*sin(4*x) + 2*(4*x^3 + 9*x) 
*sin(2*x) - 9*I*x)*log(cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1) + 3*(-I*x 
^3*cos(4*x) - 2*I*x^3*cos(2*x) + x^3*sin(4*x) + 2*x^3*sin(2*x) - I*x^3)*lo 
g(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 3*(-I*x^3*cos(4*x) - 2*I*x^3*cos(2 
*x) + x^3*sin(4*x) + 2*x^3*sin(2*x) - I*x^3)*log(cos(x)^2 + sin(x)^2 - 2*c 
os(x) + 1) - 6*(cos(4*x) + 2*cos(2*x) + I*sin(4*x) + 2*I*sin(2*x) + 1)*pol 
ylog(4, -e^(2*I*x)) + 36*(cos(4*x) + 2*cos(2*x) + I*sin(4*x) + 2*I*sin(2*x 
) + 1)*polylog(4, -e^(I*x)) + 36*(cos(4*x) + 2*cos(2*x) + I*sin(4*x) + 2*I 
*sin(2*x) + 1)*polylog(4, e^(I*x)) + 12*(I*x*cos(4*x) + 2*I*x*cos(2*x) ...
                                                                                    
                                                                                    
 

Giac [F]

\[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\int { \sqrt {a \sec \left (x\right )^{4}} x^{3} \csc \left (x\right ) \sec \left (x\right ) \,d x } \] Input:

integrate(x^3*csc(x)*sec(x)*(a*sec(x)^4)^(1/2),x, algorithm="giac")
 

Output:

integrate(sqrt(a*sec(x)^4)*x^3*csc(x)*sec(x), x)
 

Mupad [F(-1)]

Timed out. \[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\int \frac {x^3\,\sqrt {\frac {a}{{\cos \left (x\right )}^4}}}{\cos \left (x\right )\,\sin \left (x\right )} \,d x \] Input:

int((x^3*(a/cos(x)^4)^(1/2))/(cos(x)*sin(x)),x)
 

Output:

int((x^3*(a/cos(x)^4)^(1/2))/(cos(x)*sin(x)), x)
 

Reduce [F]

\[ \int x^3 \csc (x) \sec (x) \sqrt {a \sec ^4(x)} \, dx=\sqrt {a}\, \left (\int \csc \left (x \right ) \sec \left (x \right )^{3} x^{3}d x \right ) \] Input:

int(x^3*csc(x)*sec(x)*(a*sec(x)^4)^(1/2),x)
 

Output:

sqrt(a)*int(csc(x)*sec(x)**3*x**3,x)