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/35*csc(x)*(sin(x)*tan(x))^(1/2)+64/35*sec(x)*(sin(x)*tan(x))^(1/2)*tan(x)-8/7*sin(x)*(sin(x)*tan(x))^(1/2
)*tan(x)^2-2/7*sin(x)^3*(sin(x)*tan(x))^(1/2)*tan(x)^2

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 73, normalized size of antiderivative = 1.00, 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 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]

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 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 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])

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.21, 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

________________________________________________________________________________________

fricas [A]  time = 0.99, size = 44, normalized size = 0.60 \[ \frac {2 \, {\left (5 \, \cos \relax (x)^{6} - 35 \, \cos \relax (x)^{4} - 105 \, \cos \relax (x)^{2} + 7\right )} \sqrt {-\frac {\cos \relax (x)^{2} - 1}{\cos \relax (x)}}}{35 \, \cos \relax (x)^{2} \sin \relax (x)} \]

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))

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (-\cos \relax (x) + \sec \relax (x)\right )}^{\frac {7}{2}}\,{d x} \]

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)

________________________________________________________________________________________

maple [B]  time = 0.41, size = 603, normalized size = 8.26 \[ \text {result too large to display} \]

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*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)*(-cos(x)/(1+cos(x))^2)^(3/2)+315*cos(x)^3*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)*(-cos(x)/(1+cos(x))^2)^(3/2)+20*cos(x)^6-315*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)*cos(x)^2*(-cos(x)/(1+cos
(x))^2)^(3/2)+315*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)*cos(x)^2*(-cos(x)/(1+cos(x))^2)^(3/2)-105*cos(x)*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)*(-cos(x)/(1+cos(x))^2)^(3/2)+105*cos(x)*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)*(-cos(x)/(
1+cos(x))^2)^(3/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 = 0.44, size = 82, normalized size = 1.12 \[ \frac {128 \, {\left (\frac {7 \, \sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}} - \frac {7 \, \sin \relax (x)^{10}}{{\left (\cos \relax (x) + 1\right )}^{10}} + \frac {2 \, \sin \relax (x)^{14}}{{\left (\cos \relax (x) + 1\right )}^{14}} - 2\right )}}{35 \, {\left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}^{\frac {7}{2}} {\left (-\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}^{\frac {7}{2}} {\left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1\right )}^{\frac {7}{2}}} \]

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))

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (\frac {1}{\cos \relax (x)}-\cos \relax (x)\right )}^{7/2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/cos(x) - cos(x))^(7/2),x)

[Out]

int((1/cos(x) - cos(x))^(7/2), x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________