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]
________________________________________________________________________________________
Rubi [A] time = 0.0523432, 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, Rules used = {4397, 2706, 2606, 30, 2611, 3770} \[ -\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]
[Out]
Rule 4397
Rule 2706
Rule 2606
Rule 30
Rule 2611
Rule 3770
Rubi steps
\begin{align*} \int \frac{1}{\sin (x)+\tan (x)} \, dx &=\int \frac{\cot (x)}{1+\cos (x)} \, dx\\ &=-\int \cot ^2(x) \csc (x) \, dx+\int \cot (x) \csc ^2(x) \, dx\\ &=\frac{1}{2} \cot (x) \csc (x)+\frac{1}{2} \int \csc (x) \, dx-\operatorname{Subst}(\int x \, dx,x,\csc (x))\\ &=-\frac{1}{2} \tanh ^{-1}(\cos (x))+\frac{1}{2} \cot (x) \csc (x)-\frac{\csc ^2(x)}{2}\\ \end{align*}
Mathematica [A] time = 0.020161, 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]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.036, size = 24, normalized size = 1. \begin{align*} -{\frac{1}{2\,\cos \left ( x \right ) +2}}-{\frac{\ln \left ( \cos \left ( x \right ) +1 \right ) }{4}}+{\frac{\ln \left ( \cos \left ( x \right ) -1 \right ) }{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.95352, size = 34, normalized size = 1.42 \begin{align*} -\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.31762, size = 132, normalized size = 5.5 \begin{align*} -\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 )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\sin{\left (x \right )} + \tan{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06748, size = 38, normalized size = 1.58 \begin{align*} \frac{\cos \left (x\right ) - 1}{4 \,{\left (\cos \left (x\right ) + 1\right )}} + \frac{1}{4} \, \log \left (-\frac{\cos \left (x\right ) - 1}{\cos \left (x\right ) + 1}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]