Optimal. Leaf size=13 \[ -\frac {x^2}{2}-x \cot (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {6874, 3556,
3801, 30} \begin {gather*} -\frac {x^2}{2}-x \cot (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3556
Rule 3801
Rule 6874
Rubi steps
\begin {align*} \int \cot ^2(x) (x-\tan (x)) \, dx &=\int \left (-\cot (x)+x \cot ^2(x)\right ) \, dx\\ &=-\int \cot (x) \, dx+\int x \cot ^2(x) \, dx\\ &=-x \cot (x)-\log (\sin (x))-\int x \, dx+\int \cot (x) \, dx\\ &=-\frac {x^2}{2}-x \cot (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 13, normalized size = 1.00 \begin {gather*} -\frac {x^2}{2}-x \cot (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [A]
time = 1.68, size = 11, normalized size = 0.85 \begin {gather*} -\frac {x \left (x+\frac {2}{\text {Tan}\left [x\right ]}\right )}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 17, normalized size = 1.31
method | result | size |
norman | \(\frac {-x -\frac {x^{2} \tan \left (x \right )}{2}}{\tan \left (x \right )}\) | \(17\) |
risch | \(-\frac {x^{2}}{2}-i x -\frac {2 i x}{{\mathrm e}^{2 i x}-1}\) | \(24\) |
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. 144 vs.
\(2 (11) = 22\).
time = 0.26, size = 144, normalized size = 11.08 \begin {gather*} -\frac {x^{2} \cos \left (2 \, x\right )^{2} + x^{2} \sin \left (2 \, x\right )^{2} - 2 \, x^{2} \cos \left (2 \, x\right ) + x^{2} - {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) + 4 \, x \sin \left (2 \, x\right )}{2 \, {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right )}} - \log \left (\sin \left (x\right )\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.33, size = 16, normalized size = 1.23 \begin {gather*} -\frac {x^{2} \tan \left (x\right ) + 2 \, x}{2 \, \tan \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 10, normalized size = 0.77 \begin {gather*} - \frac {x^{2}}{2} - \frac {x}{\tan {\left (x \right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 18, normalized size = 1.38 \begin {gather*} \frac {-x^{2} \tan x-2 x}{2 \tan x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.06, size = 11, normalized size = 0.85 \begin {gather*} -x\,\mathrm {cot}\left (x\right )-\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________