3.247 \(\int \frac{1}{\sin (x)+\tan (x)} \, dx\)

Optimal. Leaf size=24 \[ -\frac{1}{2} \csc ^2(x)-\frac{1}{2} \tanh ^{-1}(\cos (x))+\frac{1}{2} \cot (x) \csc (x) \]

[Out]

-ArcTanh[Cos[x]]/2 + (Cot[x]*Csc[x])/2 - Csc[x]^2/2

_______________________________________________________________________________________

Rubi [A]  time = 0.0788112, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.857 \[ -\frac{1}{2} \csc ^2(x)-\frac{1}{2} \tanh ^{-1}(\cos (x))+\frac{1}{2} \cot (x) \csc (x) \]

Antiderivative was successfully verified.

[In]  Int[(Sin[x] + Tan[x])^(-1),x]

[Out]

-ArcTanh[Cos[x]]/2 + (Cot[x]*Csc[x])/2 - Csc[x]^2/2

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 6.87073, size = 27, normalized size = 1.12 \[ - \frac{\operatorname{atanh}{\left (\cos{\left (x \right )} \right )}}{2} + \frac{\cos{\left (x \right )}}{2 \left (- \cos ^{2}{\left (x \right )} + 1\right )} - \frac{1}{2 \left (- \cos ^{2}{\left (x \right )} + 1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(sin(x)+tan(x)),x)

[Out]

-atanh(cos(x))/2 + cos(x)/(2*(-cos(x)**2 + 1)) - 1/(2*(-cos(x)**2 + 1))

_______________________________________________________________________________________

Mathematica [A]  time = 0.0225975, size = 35, normalized size = 1.46 \[ -\frac{1}{4} \sec ^2\left (\frac{x}{2}\right )+\frac{1}{2} \log \left (\sin \left (\frac{x}{2}\right )\right )-\frac{1}{2} \log \left (\cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[(Sin[x] + Tan[x])^(-1),x]

[Out]

-Log[Cos[x/2]]/2 + Log[Sin[x/2]]/2 - Sec[x/2]^2/4

_______________________________________________________________________________________

Maple [A]  time = 0.046, size = 24, normalized size = 1. \[ -{\frac{1}{2+2\,\cos \left ( x \right ) }}-{\frac{\ln \left ( 1+\cos \left ( x \right ) \right ) }{4}}+{\frac{\ln \left ( \cos \left ( x \right ) -1 \right ) }{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(sin(x)+tan(x)),x)

[Out]

-1/2/(1+cos(x))-1/4*ln(1+cos(x))+1/4*ln(cos(x)-1)

_______________________________________________________________________________________

Maxima [A]  time = 1.39106, size = 34, normalized size = 1.42 \[ -\frac{\sin \left (x\right )^{2}}{4 \,{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{1}{2} \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sin(x) + tan(x)),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.23255, size = 47, normalized size = 1.96 \[ -\frac{{\left (\cos \left (x\right ) + 1\right )} \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) -{\left (\cos \left (x\right ) + 1\right )} \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) + 2}{4 \,{\left (\cos \left (x\right ) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sin(x) + tan(x)),x, algorithm="fricas")

[Out]

-1/4*((cos(x) + 1)*log(1/2*cos(x) + 1/2) - (cos(x) + 1)*log(-1/2*cos(x) + 1/2) +
 2)/(cos(x) + 1)

_______________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{1}{\sin{\left (x \right )} + \tan{\left (x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sin(x)+tan(x)),x)

[Out]

Integral(1/(sin(x) + tan(x)), x)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.204009, size = 38, normalized size = 1.58 \[ \frac{\cos \left (x\right ) - 1}{4 \,{\left (\cos \left (x\right ) + 1\right )}} + \frac{1}{4} \,{\rm ln}\left (-\frac{\cos \left (x\right ) - 1}{\cos \left (x\right ) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sin(x) + tan(x)),x, algorithm="giac")

[Out]

1/4*(cos(x) - 1)/(cos(x) + 1) + 1/4*ln(-(cos(x) - 1)/(cos(x) + 1))