Optimal. Leaf size=12 \[ -x-\cot \left (\frac{x}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0304232, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {12, 453, 203} \[ -x-\cot \left (\frac{x}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 453
Rule 203
Rubi steps
\begin{align*} \int \cot \left (\frac{x}{2}\right ) \cot (x) \, dx &=2 \operatorname{Subst}\left (\int \frac{1-x^2}{2 x^2 \left (1+x^2\right )} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=\operatorname{Subst}\left (\int \frac{1-x^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-\cot \left (\frac{x}{2}\right )-2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-x-\cot \left (\frac{x}{2}\right )\\ \end{align*}
Mathematica [A] time = 0.0128978, size = 12, normalized size = 1. \[ -x-\cot \left (\frac{x}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.044, size = 11, normalized size = 0.9 \begin{align*} -x-\cot \left ({\frac{x}{2}} \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 0.951178, size = 55, normalized size = 4.58 \begin{align*} -\frac{x \cos \left (x\right )^{2} + x \sin \left (x\right )^{2} - 2 \, x \cos \left (x\right ) + x + 2 \, \sin \left (x\right )}{\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.70271, size = 43, normalized size = 3.58 \begin{align*} -\frac{x \tan \left (\frac{1}{2} \, x\right ) + 1}{\tan \left (\frac{1}{2} \, x\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{\cos{\left (x \right )}}{\sin{\left (x \right )} \tan{\left (\frac{x}{2} \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.11236, size = 24, normalized size = 2. \begin{align*} -x - \frac{1}{2 \, \tan \left (\frac{1}{4} \, x\right )} + \frac{1}{2} \, \tan \left (\frac{1}{4} \, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]