Optimal. Leaf size=24 \[ -\frac {1}{2} \tanh ^{-1}(\cos (x))+\frac {1}{2} \cot (x) \csc (x)-\frac {\csc ^2(x)}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 24, normalized size of antiderivative = 1.00, 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 = {4482, 2785,
2686, 30, 2691, 3855} \begin {gather*} -\frac {1}{2} \csc ^2(x)-\frac {1}{2} \tanh ^{-1}(\cos (x))+\frac {1}{2} \cot (x) \csc (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2686
Rule 2691
Rule 2785
Rule 3855
Rule 4482
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-\text {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.01, size = 35, normalized size = 1.46 \begin {gather*} -\frac {1}{2} \log \left (\cos \left (\frac {x}{2}\right )\right )+\frac {1}{2} \log \left (\sin \left (\frac {x}{2}\right )\right )-\frac {1}{4} \sec ^2\left (\frac {x}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 24, normalized size = 1.00
method | result | size |
default | \(-\frac {1}{2 \left (1+\cos \left (x \right )\right )}-\frac {\ln \left (1+\cos \left (x \right )\right )}{4}+\frac {\ln \left (\cos \left (x \right )-1\right )}{4}\) | \(24\) |
risch | \(-\frac {{\mathrm e}^{i x}}{\left (1+{\mathrm e}^{i x}\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2}-\frac {\ln \left (1+{\mathrm e}^{i x}\right )}{2}\) | \(38\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 25, normalized size = 1.04 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 35, normalized size = 1.46 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sin {\left (x \right )} + \tan {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 32, normalized size = 1.33 \begin {gather*} 2 \left (-\frac {1-\cos x}{\left (1+\cos x\right )\cdot 8}+\frac {\ln \left (\frac {1-\cos x}{1+\cos x}\right )}{8}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.30, size = 16, normalized size = 0.67 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{2}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________