Optimal. Leaf size=12 \[ -x-\cot \left (\frac {x}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 12, normalized size of antiderivative = 1.00, 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, 464, 209}
\begin {gather*} -x-\cot \left (\frac {x}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 464
Rubi steps
\begin {align*} \int \cot \left (\frac {x}{2}\right ) \cot (x) \, dx &=2 \text {Subst}\left (\int \frac {1-x^2}{2 x^2 \left (1+x^2\right )} \, dx,x,\tan \left (\frac {x}{2}\right )\right )\\ &=\text {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 \text {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.01, size = 12, normalized size = 1.00 \begin {gather*} -x-\cot \left (\frac {x}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 11, normalized size = 0.92
method | result | size |
default | \(-x -\cot \left (\frac {x}{2}\right )\) | \(11\) |
norman | \(\frac {-1-x \tan \left (\frac {x}{2}\right )}{\tan \left (\frac {x}{2}\right )}\) | \(17\) |
risch | \(-x -\frac {2 i}{{\mathrm e}^{i x}-1}\) | \(17\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 41 vs.
\(2 (10) = 20\).
time = 3.42, size = 41, normalized size = 3.42 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.50, size = 16, normalized size = 1.33 \begin {gather*} -\frac {x \tan \left (\frac {1}{2} \, x\right ) + 1}{\tan \left (\frac {1}{2} \, x\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 {\cos {\left (x \right )}}{\sin {\left (x \right )} \tan {\left (\frac {x}{2} \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.32, size = 18, normalized size = 1.50 \begin {gather*} -x - \frac {1}{2 \, \tan \left (\frac {1}{4} \, x\right )} + \frac {1}{2} \, \tan \left (\frac {1}{4} \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.18, size = 10, normalized size = 0.83 \begin {gather*} -x-\mathrm {cot}\left (\frac {x}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________