3.330 \(\int \frac{1}{(-\cos (x)+\sec (x))^5} \, dx\)

Optimal. Leaf size=25 \[ -\frac{1}{9} \csc ^9(x)+\frac{2 \csc ^7(x)}{7}-\frac{\csc ^5(x)}{5} \]

[Out]

-Csc[x]^5/5 + (2*Csc[x]^7)/7 - Csc[x]^9/9

________________________________________________________________________________________

Rubi [A]  time = 0.0410418, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {4397, 2606, 270} \[ -\frac{1}{9} \csc ^9(x)+\frac{2 \csc ^7(x)}{7}-\frac{\csc ^5(x)}{5} \]

Antiderivative was successfully verified.

[In]

Int[(-Cos[x] + Sec[x])^(-5),x]

[Out]

-Csc[x]^5/5 + (2*Csc[x]^7)/7 - Csc[x]^9/9

Rule 4397

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

Rule 2606

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 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \frac{1}{(-\cos (x)+\sec (x))^5} \, dx &=\int \cot ^5(x) \csc ^5(x) \, dx\\ &=-\operatorname{Subst}\left (\int x^4 \left (-1+x^2\right )^2 \, dx,x,\csc (x)\right )\\ &=-\operatorname{Subst}\left (\int \left (x^4-2 x^6+x^8\right ) \, dx,x,\csc (x)\right )\\ &=-\frac{1}{5} \csc ^5(x)+\frac{2 \csc ^7(x)}{7}-\frac{\csc ^9(x)}{9}\\ \end{align*}

Mathematica [A]  time = 0.0117831, size = 25, normalized size = 1. \[ -\frac{1}{9} \csc ^9(x)+\frac{2 \csc ^7(x)}{7}-\frac{\csc ^5(x)}{5} \]

Antiderivative was successfully verified.

[In]

Integrate[(-Cos[x] + Sec[x])^(-5),x]

[Out]

-Csc[x]^5/5 + (2*Csc[x]^7)/7 - Csc[x]^9/9

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 20, normalized size = 0.8 \begin{align*}{\frac{2}{7\, \left ( \sin \left ( x \right ) \right ) ^{7}}}-{\frac{1}{9\, \left ( \sin \left ( x \right ) \right ) ^{9}}}-{\frac{1}{5\, \left ( \sin \left ( x \right ) \right ) ^{5}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(-cos(x)+sec(x))^5,x)

[Out]

2/7/sin(x)^7-1/9/sin(x)^9-1/5/sin(x)^5

________________________________________________________________________________________

Maxima [B]  time = 1.0162, size = 163, normalized size = 6.52 \begin{align*} \frac{{\left (\frac{45 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{252 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac{420 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac{1890 \, \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} - 35\right )}{\left (\cos \left (x\right ) + 1\right )}^{9}}{161280 \, \sin \left (x\right )^{9}} - \frac{3 \, \sin \left (x\right )}{256 \,{\left (\cos \left (x\right ) + 1\right )}} - \frac{\sin \left (x\right )^{3}}{384 \,{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac{\sin \left (x\right )^{5}}{640 \,{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac{\sin \left (x\right )^{7}}{3584 \,{\left (\cos \left (x\right ) + 1\right )}^{7}} - \frac{\sin \left (x\right )^{9}}{4608 \,{\left (\cos \left (x\right ) + 1\right )}^{9}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-cos(x)+sec(x))^5,x, algorithm="maxima")

[Out]

1/161280*(45*sin(x)^2/(cos(x) + 1)^2 + 252*sin(x)^4/(cos(x) + 1)^4 - 420*sin(x)^6/(cos(x) + 1)^6 - 1890*sin(x)
^8/(cos(x) + 1)^8 - 35)*(cos(x) + 1)^9/sin(x)^9 - 3/256*sin(x)/(cos(x) + 1) - 1/384*sin(x)^3/(cos(x) + 1)^3 +
1/640*sin(x)^5/(cos(x) + 1)^5 + 1/3584*sin(x)^7/(cos(x) + 1)^7 - 1/4608*sin(x)^9/(cos(x) + 1)^9

________________________________________________________________________________________

Fricas [B]  time = 2.45715, size = 139, normalized size = 5.56 \begin{align*} -\frac{63 \, \cos \left (x\right )^{4} - 36 \, \cos \left (x\right )^{2} + 8}{315 \,{\left (\cos \left (x\right )^{8} - 4 \, \cos \left (x\right )^{6} + 6 \, \cos \left (x\right )^{4} - 4 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-cos(x)+sec(x))^5,x, algorithm="fricas")

[Out]

-1/315*(63*cos(x)^4 - 36*cos(x)^2 + 8)/((cos(x)^8 - 4*cos(x)^6 + 6*cos(x)^4 - 4*cos(x)^2 + 1)*sin(x))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-cos(x)+sec(x))**5,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.15575, size = 27, normalized size = 1.08 \begin{align*} -\frac{63 \, \sin \left (x\right )^{4} - 90 \, \sin \left (x\right )^{2} + 35}{315 \, \sin \left (x\right )^{9}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-cos(x)+sec(x))^5,x, algorithm="giac")

[Out]

-1/315*(63*sin(x)^4 - 90*sin(x)^2 + 35)/sin(x)^9