\(\int (-\cos (x)+\sec (x))^{3/2} \, dx\) [335]

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

Optimal result

Integrand size = 11, antiderivative size = 31 \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\frac {8}{3} \csc (x) \sqrt {\sin (x) \tan (x)}-\frac {2}{3} \sin (x) \sqrt {\sin (x) \tan (x)} \]

[Out]

8/3*csc(x)*(sin(x)*tan(x))^(1/2)-2/3*sin(x)*(sin(x)*tan(x))^(1/2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4482, 4485, 2678, 2669} \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\frac {8}{3} \csc (x) \sqrt {\sin (x) \tan (x)}-\frac {2}{3} \sin (x) \sqrt {\sin (x) \tan (x)} \]

[In]

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

[Out]

(8*Csc[x]*Sqrt[Sin[x]*Tan[x]])/3 - (2*Sin[x]*Sqrt[Sin[x]*Tan[x]])/3

Rule 2669

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 2678

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*
Tan[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 4482

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

Rule 4485

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*} \text {integral}& = \int (\sin (x) \tan (x))^{3/2} \, dx \\ & = \frac {\sqrt {\sin (x) \tan (x)} \int \sin ^{\frac {3}{2}}(x) \tan ^{\frac {3}{2}}(x) \, dx}{\sqrt {\sin (x)} \sqrt {\tan (x)}} \\ & = -\frac {2}{3} \sin (x) \sqrt {\sin (x) \tan (x)}+\frac {\left (4 \sqrt {\sin (x) \tan (x)}\right ) \int \frac {\tan ^{\frac {3}{2}}(x)}{\sqrt {\sin (x)}} \, dx}{3 \sqrt {\sin (x)} \sqrt {\tan (x)}} \\ & = \frac {8}{3} \csc (x) \sqrt {\sin (x) \tan (x)}-\frac {2}{3} \sin (x) \sqrt {\sin (x) \tan (x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\frac {2}{3} \left (-1+4 \csc ^2(x)\right ) \sin (x) \sqrt {\sin (x) \tan (x)} \]

[In]

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

[Out]

(2*(-1 + 4*Csc[x]^2)*Sin[x]*Sqrt[Sin[x]*Tan[x]])/3

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(518\) vs. \(2(23)=46\).

Time = 2.21 (sec) , antiderivative size = 519, normalized size of antiderivative = 16.74

method result size
default \(\text {Expression too large to display}\) \(519\)

[In]

int((-cos(x)+sec(x))^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/6*(3*cos(x)^3*ln((2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))
*(-cos(x)/(cos(x)+1)^2)^(3/2)-3*cos(x)^3*ln(2*(2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+1)^2)^
(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)+9*ln((2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x
)/(cos(x)+1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)*cos(x)^2-9*ln(2*(2*cos(x)*(-cos(x)/(c
os(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)*cos(x)^2+9
*cos(x)*ln((2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x
)/(cos(x)+1)^2)^(3/2)-9*cos(x)*ln(2*(2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+1)^2)^(1/2)-cos(
x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)+3*ln((2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2*(-cos(x)/(cos(x)+
1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)-3*ln(2*(2*cos(x)*(-cos(x)/(cos(x)+1)^2)^(1/2)+2
*(-cos(x)/(cos(x)+1)^2)^(1/2)-cos(x)+1)/(cos(x)+1))*(-cos(x)/(cos(x)+1)^2)^(3/2)-4*cos(x)^3-12*cos(x))*(sin(x)
*tan(x))^(1/2)*tan(x)/(cos(x)^2-1)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\frac {2 \, {\left (\cos \left (x\right )^{2} + 3\right )} \sqrt {-\frac {\cos \left (x\right )^{2} - 1}{\cos \left (x\right )}}}{3 \, \sin \left (x\right )} \]

[In]

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

[Out]

2/3*(cos(x)^2 + 3)*sqrt(-(cos(x)^2 - 1)/cos(x))/sin(x)

Sympy [F]

\[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\int \left (- \cos {\left (x \right )} + \sec {\left (x \right )}\right )^{\frac {3}{2}}\, dx \]

[In]

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

[Out]

Integral((-cos(x) + sec(x))**(3/2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (23) = 46\).

Time = 0.31 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.84 \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=-\frac {8 \, {\left (\frac {\sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - 1\right )}}{3 \, {\left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}^{\frac {3}{2}} {\left (-\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}^{\frac {3}{2}} {\left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}^{\frac {3}{2}}} \]

[In]

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

[Out]

-8/3*(sin(x)^6/(cos(x) + 1)^6 - 1)/((sin(x)/(cos(x) + 1) + 1)^(3/2)*(-sin(x)/(cos(x) + 1) + 1)^(3/2)*(sin(x)^2
/(cos(x) + 1)^2 + 1)^(3/2))

Giac [F]

\[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\int { {\left (-\cos \left (x\right ) + \sec \left (x\right )\right )}^{\frac {3}{2}} \,d x } \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int (-\cos (x)+\sec (x))^{3/2} \, dx=\int {\left (\frac {1}{\cos \left (x\right )}-\cos \left (x\right )\right )}^{3/2} \,d x \]

[In]

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

[Out]

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