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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.62 \[ \int \frac {x \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=-\frac {i \left (x \left (x+2 i \log \left (1-e^{2 i x}\right )\right )+\operatorname {PolyLog}\left (2,e^{2 i x}\right )\right ) \sec ^2(x)}{2 \sqrt {a \sec ^4(x)}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.68 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.78, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {7271, 3042, 25, 4200, 25, 2620, 2715, 2838}

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 \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx\)

\(\Big \downarrow \) 7271

\(\displaystyle \frac {\sec ^2(x) \int x \cot (x)dx}{\sqrt {a \sec ^4(x)}}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 4200

\(\displaystyle -\frac {\sec ^2(x) \left (\frac {i x^2}{2}-2 i \int -\frac {e^{2 i x} x}{1-e^{2 i x}}dx\right )}{\sqrt {a \sec ^4(x)}}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\sec ^2(x) \left (2 i \int \frac {e^{2 i x} x}{1-e^{2 i x}}dx+\frac {i x^2}{2}\right )}{\sqrt {a \sec ^4(x)}}\)

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

\(\displaystyle -\frac {\sec ^2(x) \left (2 i \left (\frac {1}{2} i x \log \left (1-e^{2 i x}\right )-\frac {1}{4} \int e^{-2 i x} \log \left (1-e^{2 i x}\right )de^{2 i x}\right )+\frac {i x^2}{2}\right )}{\sqrt {a \sec ^4(x)}}\)

\(\Big \downarrow \) 2838

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2620
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] - Si 
mp[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 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

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

rule 4200
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol 
] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[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 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.21 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.57

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

Input:

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

Output:

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

Time = 0.09 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.70 \[ \int \frac {x \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=\frac {{\left (x \cos \left (x\right )^{2} \log \left (\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (-\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (-\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) - i \, \cos \left (x\right )^{2} {\rm Li}_2\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right ) + i \, \cos \left (x\right )^{2} {\rm Li}_2\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right ) + i \, \cos \left (x\right )^{2} {\rm Li}_2\left (-\cos \left (x\right ) + i \, \sin \left (x\right )\right ) - i \, \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} \] Input:

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

Output:

1/2*(x*cos(x)^2*log(cos(x) + I*sin(x) + 1) + x*cos(x)^2*log(cos(x) - I*sin 
(x) + 1) + x*cos(x)^2*log(-cos(x) + I*sin(x) + 1) + x*cos(x)^2*log(-cos(x) 
 - I*sin(x) + 1) - I*cos(x)^2*dilog(cos(x) + I*sin(x)) + I*cos(x)^2*dilog( 
cos(x) - I*sin(x)) + I*cos(x)^2*dilog(-cos(x) + I*sin(x)) - I*cos(x)^2*dil 
og(-cos(x) - I*sin(x)))*sqrt(a/cos(x)^4)/a
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.02 \[ \int \frac {x \csc (x) \sec (x)}{\sqrt {a \sec ^4(x)}} \, dx=\frac {-i \, x^{2} + 2 i \, x \arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right ) - 2 i \, x \arctan \left (\sin \left (x\right ), -\cos \left (x\right ) + 1\right ) + x \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + x \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) - 2 i \, {\rm Li}_2\left (-e^{\left (i \, x\right )}\right ) - 2 i \, {\rm Li}_2\left (e^{\left (i \, x\right )}\right )}{2 \, \sqrt {a}} \] Input:

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

Output:

1/2*(-I*x^2 + 2*I*x*arctan2(sin(x), cos(x) + 1) - 2*I*x*arctan2(sin(x), -c 
os(x) + 1) + x*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + x*log(cos(x)^2 + 
sin(x)^2 - 2*cos(x) + 1) - 2*I*dilog(-e^(I*x)) - 2*I*dilog(e^(I*x)))/sqrt( 
a)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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