\(\int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx\) [211]

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

Optimal result

Integrand size = 11, antiderivative size = 60 \[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\frac {\arctan \left (\sqrt {-\sin (x)}\right ) \cos (x)}{\sqrt {\cos (x) \cot (x)} \sqrt {-\sin (x)}}-\frac {\text {arctanh}\left (\sqrt {-\sin (x)}\right ) \cos (x)}{\sqrt {\cos (x) \cot (x)} \sqrt {-\sin (x)}} \] Output:

arctan((-sin(x))^(1/2))*cos(x)/(cos(x)*cot(x))^(1/2)/(-sin(x))^(1/2)-arcta 
nh((-sin(x))^(1/2))*cos(x)/(cos(x)*cot(x))^(1/2)/(-sin(x))^(1/2)
 

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.73 \[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=-\frac {\left (\arctan \left (\sqrt [4]{\sin ^2(x)}\right )-\text {arctanh}\left (\sqrt [4]{\sin ^2(x)}\right )\right ) \sqrt {\cos (x) \cot (x)} \sin (x) \tan (x)}{\sin ^2(x)^{3/4}} \] Input:

Integrate[1/Sqrt[Csc[x] - Sin[x]],x]
 

Output:

-(((ArcTan[(Sin[x]^2)^(1/4)] - ArcTanh[(Sin[x]^2)^(1/4)])*Sqrt[Cos[x]*Cot[ 
x]]*Sin[x]*Tan[x])/(Sin[x]^2)^(3/4))
 

Rubi [A] (warning: unable to verify)

Time = 0.40 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.60, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.091, Rules used = {3042, 4897, 3042, 4900, 3042, 3081, 3042, 3044, 266, 827, 216, 219}

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 {1}{\sqrt {\csc (x)-\sin (x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sqrt {\csc (x)-\sin (x)}}dx\)

\(\Big \downarrow \) 4897

\(\displaystyle \int \frac {1}{\sqrt {\cos (x) \cot (x)}}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sqrt {\cos (x) \cot (x)}}dx\)

\(\Big \downarrow \) 4900

\(\displaystyle \frac {\sqrt {\cos (x)} \sqrt {\cot (x)} \int \frac {1}{\sqrt {\cos (x)} \sqrt {\cot (x)}}dx}{\sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\sqrt {\cos (x)} \sqrt {\cot (x)} \int \frac {1}{\sqrt {\sin \left (x+\frac {\pi }{2}\right )} \sqrt {-\tan \left (x+\frac {\pi }{2}\right )}}dx}{\sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 3081

\(\displaystyle \frac {\cos (x) \int \sec (x) \sqrt {-\sin (x)}dx}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\cos (x) \int \frac {\sqrt {-\sin (x)}}{\cos (x)}dx}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 3044

\(\displaystyle -\frac {\cos (x) \int \frac {\sqrt {-\sin (x)}}{1-\sin ^2(x)}d(-\sin (x))}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 266

\(\displaystyle -\frac {2 \cos (x) \int \frac {\sin ^2(x)}{1-\sin ^4(x)}d\sqrt {-\sin (x)}}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 827

\(\displaystyle -\frac {2 \cos (x) \left (\frac {1}{2} \int \frac {1}{1-\sin ^2(x)}d\sqrt {-\sin (x)}-\frac {1}{2} \int \frac {1}{\sin ^2(x)+1}d\sqrt {-\sin (x)}\right )}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 216

\(\displaystyle -\frac {2 \cos (x) \left (\frac {1}{2} \int \frac {1}{1-\sin ^2(x)}d\sqrt {-\sin (x)}+\frac {1}{2} \arctan (\sin (x))\right )}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {2 \cos (x) \left (\frac {1}{2} \arctan (\sin (x))-\frac {1}{2} \text {arctanh}(\sin (x))\right )}{\sqrt {-\sin (x)} \sqrt {\cos (x) \cot (x)}}\)

Input:

Int[1/Sqrt[Csc[x] - Sin[x]],x]
 

Output:

(-2*(ArcTan[Sin[x]]/2 - ArcTanh[Sin[x]]/2)*Cos[x])/(Sqrt[Cos[x]*Cot[x]]*Sq 
rt[-Sin[x]])
 

Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 266
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{k = De 
nominator[m]}, Simp[k/c   Subst[Int[x^(k*(m + 1) - 1)*(a + b*(x^(2*k)/c^2)) 
^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && FractionQ[m] && I 
ntBinomialQ[a, b, c, 2, m, p, x]
 

rule 827
Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 
 2]], s = Denominator[Rt[-a/b, 2]]}, Simp[s/(2*b)   Int[1/(r + s*x^2), x], 
x] - Simp[s/(2*b)   Int[1/(r - s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !GtQ 
[a/b, 0]
 

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

rule 3044
Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_ 
Symbol] :> Simp[1/(a*f)   Subst[Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a 
*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&  !(I 
ntegerQ[(m - 1)/2] && LtQ[0, m, n])
 

rule 3081
Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[Cos[e + f*x]^n*((b*Tan[e + f*x])^n/(a*Sin[e + f*x])^ 
n)   Int[(a*Sin[e + f*x])^(m + n)/Cos[e + f*x]^n, x], x] /; FreeQ[{a, b, e, 
 f, m, n}, x] &&  !IntegerQ[n] && (ILtQ[m, 0] || (EqQ[m, 1] && EqQ[n, -2^(- 
1)]) || IntegersQ[m - 1/2, n - 1/2])
 

rule 4897
Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]
 

rule 4900
Int[(u_.)*((v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> With[{uu = ActivateTri 
g[u], vv = ActivateTrig[v], ww = ActivateTrig[w]}, Simp[(vv^m*ww^n)^FracPar 
t[p]/(vv^(m*FracPart[p])*ww^(n*FracPart[p]))   Int[uu*vv^(m*p)*ww^(n*p), x] 
, x]] /; FreeQ[{m, n, p}, x] &&  !IntegerQ[p] && ( !InertTrigFreeQ[v] ||  ! 
InertTrigFreeQ[w])
 
Maple [F]

\[\int \frac {1}{\sqrt {\csc \left (x \right )-\sin \left (x \right )}}d x\]

Input:

int(1/(csc(x)-sin(x))^(1/2),x)
 

Output:

int(1/(csc(x)-sin(x))^(1/2),x)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 126 vs. \(2 (48) = 96\).

Time = 0.10 (sec) , antiderivative size = 126, normalized size of antiderivative = 2.10 \[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=-\frac {1}{2} \, \arctan \left (-\frac {\sqrt {\frac {\cos \left (x\right )^{2}}{\sin \left (x\right )}} {\left (\cos \left (x\right ) - \sin \left (x\right ) + 1\right )}}{2 \, {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )}}\right ) + \frac {1}{4} \, \log \left (\frac {\cos \left (x\right )^{3} - 5 \, \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{2} + 6 \, \cos \left (x\right ) + 4\right )} \sin \left (x\right ) + 4 \, {\left (\cos \left (x\right )^{2} - {\left (\cos \left (x\right ) + 1\right )} \sin \left (x\right ) - 1\right )} \sqrt {\frac {\cos \left (x\right )^{2}}{\sin \left (x\right )}} - 2 \, \cos \left (x\right ) + 4}{\cos \left (x\right )^{3} + 3 \, \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{2} - 2 \, \cos \left (x\right ) - 4\right )} \sin \left (x\right ) - 2 \, \cos \left (x\right ) - 4}\right ) \] Input:

integrate(1/(csc(x)-sin(x))^(1/2),x, algorithm="fricas")
 

Output:

-1/2*arctan(-1/2*sqrt(cos(x)^2/sin(x))*(cos(x) - sin(x) + 1)/(cos(x) + sin 
(x) + 1)) + 1/4*log((cos(x)^3 - 5*cos(x)^2 - (cos(x)^2 + 6*cos(x) + 4)*sin 
(x) + 4*(cos(x)^2 - (cos(x) + 1)*sin(x) - 1)*sqrt(cos(x)^2/sin(x)) - 2*cos 
(x) + 4)/(cos(x)^3 + 3*cos(x)^2 - (cos(x)^2 - 2*cos(x) - 4)*sin(x) - 2*cos 
(x) - 4))
 

Sympy [F]

\[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\int \frac {1}{\sqrt {- \sin {\left (x \right )} + \csc {\left (x \right )}}}\, dx \] Input:

integrate(1/(csc(x)-sin(x))**(1/2),x)
 

Output:

Integral(1/sqrt(-sin(x) + csc(x)), x)
 

Maxima [F]

\[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\int { \frac {1}{\sqrt {\csc \left (x\right ) - \sin \left (x\right )}} \,d x } \] Input:

integrate(1/(csc(x)-sin(x))^(1/2),x, algorithm="maxima")
 

Output:

integrate(1/sqrt(csc(x) - sin(x)), x)
 

Giac [F]

\[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\int { \frac {1}{\sqrt {\csc \left (x\right ) - \sin \left (x\right )}} \,d x } \] Input:

integrate(1/(csc(x)-sin(x))^(1/2),x, algorithm="giac")
 

Output:

integrate(1/sqrt(csc(x) - sin(x)), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\int \frac {1}{\sqrt {\frac {1}{\sin \left (x\right )}-\sin \left (x\right )}} \,d x \] Input:

int(1/(1/sin(x) - sin(x))^(1/2),x)
 

Output:

int(1/(1/sin(x) - sin(x))^(1/2), x)
 

Reduce [F]

\[ \int \frac {1}{\sqrt {\csc (x)-\sin (x)}} \, dx=\int \frac {\sqrt {\csc \left (x \right )-\sin \left (x \right )}}{\csc \left (x \right )-\sin \left (x \right )}d x \] Input:

int(1/(csc(x)-sin(x))^(1/2),x)
 

Output:

int(sqrt(csc(x) - sin(x))/(csc(x) - sin(x)),x)