3.195 \(\int \frac {1}{\sec (x)-\tan (x)} \, dx\)

Optimal. Leaf size=9 \[ -\log (1-\sin (x)) \]

[Out]

-ln(1-sin(x))

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3159, 2667, 31} \[ -\log (1-\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[(Sec[x] - Tan[x])^(-1),x]

[Out]

-Log[1 - Sin[x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2667

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 3159

Int[((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Int[Cos[d + e*x
]/(b + a*Cos[d + e*x] + c*Sin[d + e*x]), x] /; FreeQ[{a, b, c, d, e}, x]

Rubi steps

\begin {align*} \int \frac {1}{\sec (x)-\tan (x)} \, dx &=\int \frac {\cos (x)}{1-\sin (x)} \, dx\\ &=-\operatorname {Subst}\left (\int \frac {1}{1+x} \, dx,x,-\sin (x)\right )\\ &=-\log (1-\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 18, normalized size = 2.00 \[ -2 \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[x] - Tan[x])^(-1),x]

[Out]

-2*Log[Cos[x/2] - Sin[x/2]]

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 9, normalized size = 1.00 \[ -\log \left (-\sin \relax (x) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sec(x)-tan(x)),x, algorithm="fricas")

[Out]

-log(-sin(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.17, size = 20, normalized size = 2.22 \[ \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) - 2 \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sec(x)-tan(x)),x, algorithm="giac")

[Out]

log(tan(1/2*x)^2 + 1) - 2*log(abs(tan(1/2*x) - 1))

________________________________________________________________________________________

maple [A]  time = 0.08, size = 8, normalized size = 0.89 \[ -\ln \left (\sin \relax (x )-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sec(x)-tan(x)),x)

[Out]

-ln(sin(x)-1)

________________________________________________________________________________________

maxima [B]  time = 0.34, size = 29, normalized size = 3.22 \[ -2 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) + \log \left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sec(x)-tan(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.96, size = 19, normalized size = 2.11 \[ \ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-1/(tan(x) - 1/cos(x)),x)

[Out]

log(tan(x/2)^2 + 1) - 2*log(tan(x/2) - 1)

________________________________________________________________________________________

sympy [B]  time = 0.14, size = 17, normalized size = 1.89 \[ - \log {\left (- \tan {\relax (x )} + \sec {\relax (x )} \right )} + \frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sec(x)-tan(x)),x)

[Out]

-log(-tan(x) + sec(x)) + log(tan(x)**2 + 1)/2

________________________________________________________________________________________