Optimal. Leaf size=13 \[ -\frac{x^2}{2}-x \cot (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0708303, antiderivative size = 13, normalized size of antiderivative = 1., 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 = {6742, 3475, 3720, 30} \[ -\frac{x^2}{2}-x \cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 3475
Rule 3720
Rule 30
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.027623, size = 13, normalized size = 1. \[ -\frac{x^2}{2}-x \cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.014, size = 17, normalized size = 1.3 \begin{align*}{\frac{1}{\tan \left ( x \right ) } \left ( -x-{\frac{{x}^{2}\tan \left ( x \right ) }{2}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 0.978977, size = 194, normalized size = 14.92 \begin{align*} -\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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.27431, size = 43, normalized size = 3.31 \begin{align*} -\frac{x^{2} \tan \left (x\right ) + 2 \, x}{2 \, \tan \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.16311, size = 10, normalized size = 0.77 \begin{align*} - \frac{x^{2}}{2} - \frac{x}{\tan{\left (x \right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.08334, size = 22, normalized size = 1.69 \begin{align*} -\frac{x^{2} \tan \left (x\right ) + 2 \, x}{2 \, \tan \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]