Optimal. Leaf size=8 \[ -x-2 \cot (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0371258, antiderivative size = 8, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.235, Rules used = {3171, 3175, 3767, 8} \[ -x-2 \cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3171
Rule 3175
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int \frac{1+\cos ^2(x)}{1-\cos ^2(x)} \, dx &=-x+2 \int \frac{1}{1-\cos ^2(x)} \, dx\\ &=-x+2 \int \csc ^2(x) \, dx\\ &=-x-2 \operatorname{Subst}(\int 1 \, dx,x,\cot (x))\\ &=-x-2 \cot (x)\\ \end{align*}
Mathematica [A] time = 0.007607, size = 8, normalized size = 1. \[ -x-2 \cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.032, size = 11, normalized size = 1.4 \begin{align*} -2\, \left ( \tan \left ( x \right ) \right ) ^{-1}-x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.40983, size = 14, normalized size = 1.75 \begin{align*} -x - \frac{2}{\tan \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.15822, size = 42, normalized size = 5.25 \begin{align*} -\frac{x \sin \left (x\right ) + 2 \, \cos \left (x\right )}{\sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.31058, size = 12, normalized size = 1.5 \begin{align*} - x + \tan{\left (\frac{x}{2} \right )} - \frac{1}{\tan{\left (\frac{x}{2} \right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06638, size = 22, normalized size = 2.75 \begin{align*} -x - \frac{1}{\tan \left (\frac{1}{2} \, x\right )} + \tan \left (\frac{1}{2} \, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]