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

   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 = 17 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=-\frac {1}{3} \sec ^3(x)+\frac {\sec ^5(x)}{5} \]

[Out]

-1/3*sec(x)^3+1/5*sec(x)^5

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4482, 2686, 14} \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=\frac {\sec ^5(x)}{5}-\frac {\sec ^3(x)}{3} \]

[In]

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

[Out]

-1/3*Sec[x]^3 + Sec[x]^5/5

Rule 14

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 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 ^3(x) \tan ^3(x) \, dx \\ & = \text {Subst}\left (\int x^2 \left (-1+x^2\right ) \, dx,x,\sec (x)\right ) \\ & = \text {Subst}\left (\int \left (-x^2+x^4\right ) \, dx,x,\sec (x)\right ) \\ & = -\frac {1}{3} \sec ^3(x)+\frac {\sec ^5(x)}{5} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=-\frac {1}{3} \sec ^3(x)+\frac {\sec ^5(x)}{5} \]

[In]

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

[Out]

-1/3*Sec[x]^3 + Sec[x]^5/5

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82

method result size
default \(-\frac {1}{3 \cos \left (x \right )^{3}}+\frac {1}{5 \cos \left (x \right )^{5}}\) \(14\)
parallelrisch \(\frac {4}{15}-\frac {\sec \left (x \right )^{3}}{3}+\frac {\sec \left (x \right )^{5}}{5}\) \(15\)
risch \(-\frac {8 \left (5 \,{\mathrm e}^{7 i x}-2 \,{\mathrm e}^{5 i x}+5 \,{\mathrm e}^{3 i x}\right )}{15 \left ({\mathrm e}^{2 i x}+1\right )^{5}}\) \(34\)
norman \(\frac {-4 \tan \left (\frac {x}{2}\right )^{6}-\frac {4 \tan \left (\frac {x}{2}\right )^{4}}{3}-\frac {4 \tan \left (\frac {x}{2}\right )^{2}}{3}+\frac {4}{15}}{\left (\tan \left (\frac {x}{2}\right )^{2}-1\right )^{5}}\) \(38\)

[In]

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

[Out]

-1/3/cos(x)^3+1/5/cos(x)^5

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=-\frac {5 \, \cos \left (x\right )^{2} - 3}{15 \, \cos \left (x\right )^{5}} \]

[In]

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

[Out]

-1/15*(5*cos(x)^2 - 3)/cos(x)^5

Sympy [F]

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

[In]

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

[Out]

Integral((-sin(x) + csc(x))**(-3), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 103 vs. \(2 (13) = 26\).

Time = 0.23 (sec) , antiderivative size = 103, normalized size of antiderivative = 6.06 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=-\frac {4 \, {\left (\frac {5 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {5 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {15 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - 1\right )}}{15 \, {\left (\frac {5 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {10 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {10 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {5 \, \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} + \frac {\sin \left (x\right )^{10}}{{\left (\cos \left (x\right ) + 1\right )}^{10}} - 1\right )}} \]

[In]

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

[Out]

-4/15*(5*sin(x)^2/(cos(x) + 1)^2 + 5*sin(x)^4/(cos(x) + 1)^4 + 15*sin(x)^6/(cos(x) + 1)^6 - 1)/(5*sin(x)^2/(co
s(x) + 1)^2 - 10*sin(x)^4/(cos(x) + 1)^4 + 10*sin(x)^6/(cos(x) + 1)^6 - 5*sin(x)^8/(cos(x) + 1)^8 + sin(x)^10/
(cos(x) + 1)^10 - 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (13) = 26\).

Time = 0.27 (sec) , antiderivative size = 59, normalized size of antiderivative = 3.47 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=-\frac {4 \, {\left (\frac {5 \, {\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} - \frac {5 \, {\left (\cos \left (x\right ) - 1\right )}^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {15 \, {\left (\cos \left (x\right ) - 1\right )}^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + 1\right )}}{15 \, {\left (\frac {\cos \left (x\right ) - 1}{\cos \left (x\right ) + 1} + 1\right )}^{5}} \]

[In]

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

[Out]

-4/15*(5*(cos(x) - 1)/(cos(x) + 1) - 5*(cos(x) - 1)^2/(cos(x) + 1)^2 + 15*(cos(x) - 1)^3/(cos(x) + 1)^3 + 1)/(
(cos(x) - 1)/(cos(x) + 1) + 1)^5

Mupad [B] (verification not implemented)

Time = 28.04 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.76 \[ \int \frac {1}{(\csc (x)-\sin (x))^3} \, dx=\frac {1}{5\,{\cos \left (x\right )}^5}-\frac {1}{3\,{\cos \left (x\right )}^3} \]

[In]

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

[Out]

1/(5*cos(x)^5) - 1/(3*cos(x)^3)