Optimal. Leaf size=20 \[ \frac{x \csc (x)}{x \cos (x)-\sin (x)}-\cot (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0341266, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {4594, 3767, 8} \[ \frac{x \csc (x)}{x \cos (x)-\sin (x)}-\cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4594
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int \frac{x^2}{(x \cos (x)-\sin (x))^2} \, dx &=\frac{x \csc (x)}{x \cos (x)-\sin (x)}+\int \csc ^2(x) \, dx\\ &=\frac{x \csc (x)}{x \cos (x)-\sin (x)}-\operatorname{Subst}(\int 1 \, dx,x,\cot (x))\\ &=-\cot (x)+\frac{x \csc (x)}{x \cos (x)-\sin (x)}\\ \end{align*}
Mathematica [A] time = 0.207802, size = 19, normalized size = 0.95 \[ \frac{x \sin (x)+\cos (x)}{x \cos (x)-\sin (x)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.214, size = 37, normalized size = 1.9 \begin{align*}{ \left ( -1+ \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}-2\,x\tan \left ( x/2 \right ) \right ) \left ( x \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}-x+2\,\tan \left ( x/2 \right ) \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 0.954805, size = 93, normalized size = 4.65 \begin{align*} \frac{2 \,{\left (2 \, x \cos \left (2 \, x\right ) +{\left (x^{2} - 1\right )} \sin \left (2 \, x\right )\right )}}{{\left (x^{2} + 1\right )} \cos \left (2 \, x\right )^{2} +{\left (x^{2} + 1\right )} \sin \left (2 \, x\right )^{2} + x^{2} + 2 \,{\left (x^{2} - 1\right )} \cos \left (2 \, x\right ) - 4 \, x \sin \left (2 \, x\right ) + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.82124, size = 55, normalized size = 2.75 \begin{align*} \frac{x \sin \left (x\right ) + \cos \left (x\right )}{x \cos \left (x\right ) - \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 2.35619, size = 66, normalized size = 3.3 \begin{align*} - \frac{2 x \tan{\left (\frac{x}{2} \right )}}{x \tan ^{2}{\left (\frac{x}{2} \right )} - x + 2 \tan{\left (\frac{x}{2} \right )}} + \frac{\tan ^{2}{\left (\frac{x}{2} \right )}}{x \tan ^{2}{\left (\frac{x}{2} \right )} - x + 2 \tan{\left (\frac{x}{2} \right )}} - \frac{1}{x \tan ^{2}{\left (\frac{x}{2} \right )} - x + 2 \tan{\left (\frac{x}{2} \right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06728, size = 53, normalized size = 2.65 \begin{align*} -\frac{2 \, x \tan \left (\frac{1}{2} \, x\right ) - \tan \left (\frac{1}{2} \, x\right )^{2} + 1}{x \tan \left (\frac{1}{2} \, x\right )^{2} - x + 2 \, \tan \left (\frac{1}{2} \, x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]