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

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

Optimal result

Integrand size = 9, antiderivative size = 2 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=\sec (x) \]

[Out]

sec(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 2, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4482, 2686, 8} \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=\sec (x) \]

[In]

Int[(Csc[x] - Sin[x])^(-1),x]

[Out]

Sec[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 4482

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

Rubi steps \begin{align*} \text {integral}& = \int \sec (x) \tan (x) \, dx \\ & = \text {Subst}(\int 1 \, dx,x,\sec (x)) \\ & = \sec (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 2, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=\sec (x) \]

[In]

Integrate[(Csc[x] - Sin[x])^(-1),x]

[Out]

Sec[x]

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 5, normalized size of antiderivative = 2.50

method result size
default \(\frac {1}{\cos \left (x \right )}\) \(5\)
parallelrisch \(1+\sec \left (x \right )\) \(5\)
norman \(-\frac {2}{\tan \left (\frac {x}{2}\right )^{2}-1}\) \(13\)
risch \(\frac {2 \,{\mathrm e}^{i x}}{{\mathrm e}^{2 i x}+1}\) \(17\)

[In]

int(1/(csc(x)-sin(x)),x,method=_RETURNVERBOSE)

[Out]

1/cos(x)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 4, normalized size of antiderivative = 2.00 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=\frac {1}{\cos \left (x\right )} \]

[In]

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

[Out]

1/cos(x)

Sympy [F]

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

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (2) = 4\).

Time = 0.23 (sec) , antiderivative size = 17, normalized size of antiderivative = 8.50 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=-\frac {2}{\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1} \]

[In]

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

[Out]

-2/(sin(x)^2/(cos(x) + 1)^2 - 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (2) = 4\).

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 8.50 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=\frac {2}{\frac {\cos \left (x\right ) - 1}{\cos \left (x\right ) + 1} + 1} \]

[In]

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

[Out]

2/((cos(x) - 1)/(cos(x) + 1) + 1)

Mupad [B] (verification not implemented)

Time = 29.31 (sec) , antiderivative size = 12, normalized size of antiderivative = 6.00 \[ \int \frac {1}{\csc (x)-\sin (x)} \, dx=-\frac {2}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2-1} \]

[In]

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

[Out]

-2/(tan(x/2)^2 - 1)