3.333 \(\int (-\cos (x)+\sec (x))^{7/2} \, dx\)

Optimal. Leaf size=73 \[ -\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{8}{7} \sin (x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{256}{35} \csc (x) \sqrt{\sin (x) \tan (x)}+\frac{64}{35} \tan (x) \sec (x) \sqrt{\sin (x) \tan (x)} \]

[Out]

(-256*Csc[x]*Sqrt[Sin[x]*Tan[x]])/35 + (64*Sec[x]*Tan[x]*Sqrt[Sin[x]*Tan[x]])/35 - (8*Sin[x]*Tan[x]^2*Sqrt[Sin
[x]*Tan[x]])/7 - (2*Sin[x]^3*Tan[x]^2*Sqrt[Sin[x]*Tan[x]])/7

________________________________________________________________________________________

Rubi [A]  time = 0.112532, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {4397, 4400, 2598, 2594, 2589} \[ -\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{8}{7} \sin (x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{256}{35} \csc (x) \sqrt{\sin (x) \tan (x)}+\frac{64}{35} \tan (x) \sec (x) \sqrt{\sin (x) \tan (x)} \]

Antiderivative was successfully verified.

[In]

Int[(-Cos[x] + Sec[x])^(7/2),x]

[Out]

(-256*Csc[x]*Sqrt[Sin[x]*Tan[x]])/35 + (64*Sec[x]*Tan[x]*Sqrt[Sin[x]*Tan[x]])/35 - (8*Sin[x]*Tan[x]^2*Sqrt[Sin
[x]*Tan[x]])/7 - (2*Sin[x]^3*Tan[x]^2*Sqrt[Sin[x]*Tan[x]])/7

Rule 4397

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

Rule 4400

Int[(u_.)*((v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> With[{uu = ActivateTrig[u], vv = ActivateTrig[v], ww = Ac
tivateTrig[w]}, Dist[(vv^m*ww^n)^FracPart[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])

Rule 2598

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

Rule 2594

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

Rule 2589

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

Rubi steps

\begin{align*} \int (-\cos (x)+\sec (x))^{7/2} \, dx &=\int (\sin (x) \tan (x))^{7/2} \, dx\\ &=\frac{\sqrt{\sin (x) \tan (x)} \int \sin ^{\frac{7}{2}}(x) \tan ^{\frac{7}{2}}(x) \, dx}{\sqrt{\sin (x)} \sqrt{\tan (x)}}\\ &=-\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}+\frac{\left (12 \sqrt{\sin (x) \tan (x)}\right ) \int \sin ^{\frac{3}{2}}(x) \tan ^{\frac{7}{2}}(x) \, dx}{7 \sqrt{\sin (x)} \sqrt{\tan (x)}}\\ &=-\frac{8}{7} \sin (x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}+\frac{\left (32 \sqrt{\sin (x) \tan (x)}\right ) \int \frac{\tan ^{\frac{7}{2}}(x)}{\sqrt{\sin (x)}} \, dx}{7 \sqrt{\sin (x)} \sqrt{\tan (x)}}\\ &=\frac{64}{35} \sec (x) \tan (x) \sqrt{\sin (x) \tan (x)}-\frac{8}{7} \sin (x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{\left (128 \sqrt{\sin (x) \tan (x)}\right ) \int \frac{\tan ^{\frac{3}{2}}(x)}{\sqrt{\sin (x)}} \, dx}{35 \sqrt{\sin (x)} \sqrt{\tan (x)}}\\ &=-\frac{256}{35} \csc (x) \sqrt{\sin (x) \tan (x)}+\frac{64}{35} \sec (x) \tan (x) \sqrt{\sin (x) \tan (x)}-\frac{8}{7} \sin (x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}-\frac{2}{7} \sin ^3(x) \tan ^2(x) \sqrt{\sin (x) \tan (x)}\\ \end{align*}

Mathematica [A]  time = 0.204435, size = 37, normalized size = 0.51 \[ \frac{1}{70} \sec (x) \sqrt{\sin (x) \tan (x)} (28 \tan (x)-512 \cot (x)-5 (\sin (3 x)-23 \sin (x)) \cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[(-Cos[x] + Sec[x])^(7/2),x]

[Out]

(Sec[x]*Sqrt[Sin[x]*Tan[x]]*(-512*Cot[x] - 5*Cos[x]*(-23*Sin[x] + Sin[3*x]) + 28*Tan[x]))/70

________________________________________________________________________________________

Maple [B]  time = 0.235, size = 603, normalized size = 8.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-cos(x)+sec(x))^(7/2),x)

[Out]

1/70*(-1+cos(x))^2*(-105*cos(x)^4*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-2*(2*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-
cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)-1)/sin(x)^2)+105*cos(x)^4*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-(2
*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)-1)/sin(x)^2)-315*cos(x
)^3*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-2*(2*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(
1+cos(x))^2)^(1/2)-1)/sin(x)^2)+315*cos(x)^3*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-(2*cos(x)^2*(-cos(x)/(1+cos(x))^
2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)-1)/sin(x)^2)+20*cos(x)^6-315*cos(x)^2*(-cos(x)/(1+co
s(x))^2)^(3/2)*ln(-2*(2*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)
-1)/sin(x)^2)+315*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-(2*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+
2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)-1)/sin(x)^2)-105*cos(x)*(-cos(x)/(1+cos(x))^2)^(3/2)*ln(-2*(2*cos(x)^2
*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^(1/2)-1)/sin(x)^2)+105*cos(x)*(-cos(x
)/(1+cos(x))^2)^(3/2)*ln(-(2*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(1/2)-cos(x)^2+2*cos(x)-2*(-cos(x)/(1+cos(x))^2)^
(1/2)-1)/sin(x)^2)-140*cos(x)^4-420*cos(x)^2+28)*cos(x)*(1+cos(x))^2*(-(-1+cos(x)^2)/cos(x))^(7/2)/sin(x)^11

________________________________________________________________________________________

Maxima [A]  time = 1.57384, size = 111, normalized size = 1.52 \begin{align*} \frac{128 \,{\left (\frac{7 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac{7 \, \sin \left (x\right )^{10}}{{\left (\cos \left (x\right ) + 1\right )}^{10}} + \frac{2 \, \sin \left (x\right )^{14}}{{\left (\cos \left (x\right ) + 1\right )}^{14}} - 2\right )}}{35 \,{\left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}^{\frac{7}{2}}{\left (-\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}^{\frac{7}{2}}{\left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}^{\frac{7}{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sec(x))^(7/2),x, algorithm="maxima")

[Out]

128/35*(7*sin(x)^4/(cos(x) + 1)^4 - 7*sin(x)^10/(cos(x) + 1)^10 + 2*sin(x)^14/(cos(x) + 1)^14 - 2)/((sin(x)/(c
os(x) + 1) + 1)^(7/2)*(-sin(x)/(cos(x) + 1) + 1)^(7/2)*(sin(x)^2/(cos(x) + 1)^2 + 1)^(7/2))

________________________________________________________________________________________

Fricas [A]  time = 2.1244, size = 134, normalized size = 1.84 \begin{align*} \frac{2 \,{\left (5 \, \cos \left (x\right )^{6} - 35 \, \cos \left (x\right )^{4} - 105 \, \cos \left (x\right )^{2} + 7\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{\cos \left (x\right )}}}{35 \, \cos \left (x\right )^{2} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sec(x))^(7/2),x, algorithm="fricas")

[Out]

2/35*(5*cos(x)^6 - 35*cos(x)^4 - 105*cos(x)^2 + 7)*sqrt(-(cos(x)^2 - 1)/cos(x))/(cos(x)^2*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((-cos(x)+sec(x))**(7/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (-\cos \left (x\right ) + \sec \left (x\right )\right )}^{\frac{7}{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sec(x))^(7/2),x, algorithm="giac")

[Out]

integrate((-cos(x) + sec(x))^(7/2), x)