\(\int \frac {x^2 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx\) [872]

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

Optimal result

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

[Out]

-1/3*I*x^3*sec(x)^2/(a*sec(x)^4)^(1/2)+x^2*ln(1-exp(2*I*x))*sec(x)^2/(a*sec(x)^4)^(1/2)-I*x*polylog(2,exp(2*I*
x))*sec(x)^2/(a*sec(x)^4)^(1/2)+1/2*polylog(3,exp(2*I*x))*sec(x)^2/(a*sec(x)^4)^(1/2)

Rubi [A] (verified)

Time = 0.68 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6852, 3798, 2221, 2611, 2320, 6724} \[ \int \frac {x^2 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}+\frac {\operatorname {PolyLog}\left (3,e^{2 i x}\right ) \sec ^2(x)}{2 \sqrt {a \sec ^4(x)}}-\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}+\frac {x^2 \log \left (1-e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}} \]

[In]

Int[(x^2*Csc[x]*Sec[x])/Sqrt[a*Sec[x]^4],x]

[Out]

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

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 3798

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(
m + 1))), x] - Dist[2*I, Int[(c + d*x)^m*E^(2*I*k*Pi)*(E^(2*I*(e + f*x))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x))))
, x], x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rule 6852

Int[(u_.)*((a_.)*(v_)^(m_.))^(p_), x_Symbol] :> Dist[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]) &&
!(EqQ[v, x] && EqQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = \frac {\sec ^2(x) \int x^2 \cot (x) \, dx}{\sqrt {a \sec ^4(x)}} \\ & = -\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}-\frac {\left (2 i \sec ^2(x)\right ) \int \frac {e^{2 i x} x^2}{1-e^{2 i x}} \, dx}{\sqrt {a \sec ^4(x)}} \\ & = -\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}+\frac {x^2 \log \left (1-e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}-\frac {\left (2 \sec ^2(x)\right ) \int x \log \left (1-e^{2 i x}\right ) \, dx}{\sqrt {a \sec ^4(x)}} \\ & = -\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}+\frac {x^2 \log \left (1-e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}+\frac {\left (i \sec ^2(x)\right ) \int \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \, dx}{\sqrt {a \sec ^4(x)}} \\ & = -\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}+\frac {x^2 \log \left (1-e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}+\frac {\sec ^2(x) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{2 i x}\right )}{2 \sqrt {a \sec ^4(x)}} \\ & = -\frac {i x^3 \sec ^2(x)}{3 \sqrt {a \sec ^4(x)}}+\frac {x^2 \log \left (1-e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \sec ^2(x)}{\sqrt {a \sec ^4(x)}}+\frac {\operatorname {PolyLog}\left (3,e^{2 i x}\right ) \sec ^2(x)}{2 \sqrt {a \sec ^4(x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.69 \[ \int \frac {x^2 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=\frac {\left (-i \pi ^3+8 i x^3+24 x^2 \log \left (1-e^{-2 i x}\right )+24 i x \operatorname {PolyLog}\left (2,e^{-2 i x}\right )+12 \operatorname {PolyLog}\left (3,e^{-2 i x}\right )\right ) \sec ^2(x)}{24 \sqrt {a \sec ^4(x)}} \]

[In]

Integrate[(x^2*Csc[x]*Sec[x])/Sqrt[a*Sec[x]^4],x]

[Out]

(((-I)*Pi^3 + (8*I)*x^3 + 24*x^2*Log[1 - E^((-2*I)*x)] + (24*I)*x*PolyLog[2, E^((-2*I)*x)] + 12*PolyLog[3, E^(
(-2*I)*x)])*Sec[x]^2)/(24*Sqrt[a*Sec[x]^4])

Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.40

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

[In]

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

[Out]

1/3*I/(a*exp(4*I*x)/(exp(2*I*x)+1)^4)^(1/2)/(exp(2*I*x)+1)^2*exp(2*I*x)*x^3-2/(a*exp(4*I*x)/(exp(2*I*x)+1)^4)^
(1/2)/(exp(2*I*x)+1)^2*exp(2*I*x)*(1/3*I*x^3-1/2*x^2*ln(exp(I*x)+1)+I*x*polylog(2,-exp(I*x))-polylog(3,-exp(I*
x))-1/2*x^2*ln(1-exp(I*x))+I*x*polylog(2,exp(I*x))-polylog(3,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. 248 vs. \(2 (83) = 166\).

Time = 0.27 (sec) , antiderivative size = 248, normalized size of antiderivative = 2.28 \[ \int \frac {x^2 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=\frac {2 \, \sqrt {\frac {a}{\cos \left (x\right )^{4}}} \cos \left (x\right )^{2} {\rm polylog}\left (3, \cos \left (x\right ) + i \, \sin \left (x\right )\right ) + 2 \, \sqrt {\frac {a}{\cos \left (x\right )^{4}}} \cos \left (x\right )^{2} {\rm polylog}\left (3, \cos \left (x\right ) - i \, \sin \left (x\right )\right ) + 2 \, \sqrt {\frac {a}{\cos \left (x\right )^{4}}} \cos \left (x\right )^{2} {\rm polylog}\left (3, -\cos \left (x\right ) + i \, \sin \left (x\right )\right ) + 2 \, \sqrt {\frac {a}{\cos \left (x\right )^{4}}} \cos \left (x\right )^{2} {\rm polylog}\left (3, -\cos \left (x\right ) - i \, \sin \left (x\right )\right ) + {\left (x^{2} \cos \left (x\right )^{2} \log \left (\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) + x^{2} \cos \left (x\right )^{2} \log \left (\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) + x^{2} \cos \left (x\right )^{2} \log \left (-\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) + x^{2} \cos \left (x\right )^{2} \log \left (-\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) - 2 i \, x \cos \left (x\right )^{2} {\rm Li}_2\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right ) + 2 i \, x \cos \left (x\right )^{2} {\rm Li}_2\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right ) + 2 i \, x \cos \left (x\right )^{2} {\rm Li}_2\left (-\cos \left (x\right ) + i \, \sin \left (x\right )\right ) - 2 i \, x \cos \left (x\right )^{2} {\rm Li}_2\left (-\cos \left (x\right ) - i \, \sin \left (x\right )\right )\right )} \sqrt {\frac {a}{\cos \left (x\right )^{4}}}}{2 \, a} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

Integral(x**2*csc(x)*sec(x)/sqrt(a*sec(x)**4), x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.04 \[ \int \frac {x^2 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=\frac {-2 i \, x^{3} + 6 i \, x^{2} \arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right ) - 6 i \, x^{2} \arctan \left (\sin \left (x\right ), -\cos \left (x\right ) + 1\right ) + 3 \, x^{2} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + 3 \, x^{2} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) - 12 i \, x {\rm Li}_2\left (-e^{\left (i \, x\right )}\right ) - 12 i \, x {\rm Li}_2\left (e^{\left (i \, x\right )}\right ) + 12 \, {\rm Li}_{3}(-e^{\left (i \, x\right )}) + 12 \, {\rm Li}_{3}(e^{\left (i \, x\right )})}{6 \, \sqrt {a}} \]

[In]

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

[Out]

1/6*(-2*I*x^3 + 6*I*x^2*arctan2(sin(x), cos(x) + 1) - 6*I*x^2*arctan2(sin(x), -cos(x) + 1) + 3*x^2*log(cos(x)^
2 + sin(x)^2 + 2*cos(x) + 1) + 3*x^2*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) - 12*I*x*dilog(-e^(I*x)) - 12*I*x
*dilog(e^(I*x)) + 12*polylog(3, -e^(I*x)) + 12*polylog(3, e^(I*x)))/sqrt(a)

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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