3.336 \(\int \sqrt {-\cos (x)+\sec (x)} \, dx\)

Optimal. Leaf size=13 \[ -2 \cot (x) \sqrt {\sin (x) \tan (x)} \]

[Out]

-2*cot(x)*(sin(x)*tan(x))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4397, 4400, 2589} \[ -2 \cot (x) \sqrt {\sin (x) \tan (x)} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[-Cos[x] + Sec[x]],x]

[Out]

-2*Cot[x]*Sqrt[Sin[x]*Tan[x]]

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 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 \sqrt {-\cos (x)+\sec (x)} \, dx &=\int \sqrt {\sin (x) \tan (x)} \, dx\\ &=\frac {\sqrt {\sin (x) \tan (x)} \int \sqrt {\sin (x)} \sqrt {\tan (x)} \, dx}{\sqrt {\sin (x)} \sqrt {\tan (x)}}\\ &=-2 \cot (x) \sqrt {\sin (x) \tan (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 13, normalized size = 1.00 \[ -2 \cot (x) \sqrt {\sin (x) \tan (x)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-Cos[x] + Sec[x]],x]

[Out]

-2*Cot[x]*Sqrt[Sin[x]*Tan[x]]

________________________________________________________________________________________

fricas [A]  time = 1.26, size = 22, normalized size = 1.69 \[ -\frac {2 \, \sqrt {-\frac {\cos \relax (x)^{2} - 1}{\cos \relax (x)}} \cos \relax (x)}{\sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.20, size = 46, normalized size = 3.54 \[ -\frac {4 \, \mathrm {sgn}\left (-\tan \left (\frac {1}{2} \, x\right )^{3} - \tan \left (\frac {1}{2} \, x\right )\right ) \mathrm {sgn}\left (\cos \relax (x)\right )}{\frac {\sqrt {-\tan \left (\frac {1}{2} \, x\right )^{4} + 1} - 1}{\tan \left (\frac {1}{2} \, x\right )^{2}} - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4*sgn(-tan(1/2*x)^3 - tan(1/2*x))*sgn(cos(x))/((sqrt(-tan(1/2*x)^4 + 1) - 1)/tan(1/2*x)^2 - 1)

________________________________________________________________________________________

maple [B]  time = 0.31, size = 174, normalized size = 13.38 \[ \frac {\left (-1+\cos \relax (x )\right ) \left (4 \cos \relax (x ) \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}+4 \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}+\ln \left (-\frac {2 \left (2 \left (\cos ^{2}\relax (x )\right ) \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}-\left (\cos ^{2}\relax (x )\right )+2 \cos \relax (x )-2 \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}-1\right )}{\sin \relax (x )^{2}}\right )-\ln \left (-\frac {2 \left (\cos ^{2}\relax (x )\right ) \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}-\left (\cos ^{2}\relax (x )\right )+2 \cos \relax (x )-2 \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}-1}{\sin \relax (x )^{2}}\right )\right ) \cos \relax (x ) \sqrt {-\frac {-1+\cos ^{2}\relax (x )}{\cos \relax (x )}}}{2 \sqrt {-\frac {\cos \relax (x )}{\left (1+\cos \relax (x )\right )^{2}}}\, \sin \relax (x )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(-1+cos(x))*(4*cos(x)*(-cos(x)/(1+cos(x))^2)^(1/2)+4*(-cos(x)/(1+cos(x))^2)^(1/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)-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)/cos(
x))^(1/2)/(-cos(x)/(1+cos(x))^2)^(1/2)/sin(x)^3

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 57, normalized size = 4.38 \[ \frac {2 \, {\left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - 1\right )}}{\sqrt {\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1} \sqrt {-\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1} \sqrt {\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.42, size = 20, normalized size = 1.54 \[ -\frac {2\,\sin \relax (x)}{\sqrt {\frac {1}{\cos \relax (x)}}\,\sqrt {1-{\cos \relax (x)}^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2*sin(x))/((1/cos(x))^(1/2)*(1 - cos(x)^2)^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {- \cos {\relax (x )} + \sec {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(sqrt(-cos(x) + sec(x)), x)

________________________________________________________________________________________