Optimal. Leaf size=22 \[ -\frac{3 x}{2}-\frac{3 \cot (x)}{2}+\frac{1}{2} \cos ^2(x) \cot (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0238772, antiderivative size = 22, 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 = {290, 325, 203} \[ -\frac{3 x}{2}-\frac{3 \cot (x)}{2}+\frac{1}{2} \cos ^2(x) \cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 290
Rule 325
Rule 203
Rubi steps
\begin{align*} \int (\csc (x)-\sin (x))^2 \, dx &=\operatorname{Subst}\left (\int \frac{1}{x^2 \left (1+x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=\frac{1}{2} \cos ^2(x) \cot (x)+\frac{3}{2} \operatorname{Subst}\left (\int \frac{1}{x^2 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac{3 \cot (x)}{2}+\frac{1}{2} \cos ^2(x) \cot (x)-\frac{3}{2} \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=-\frac{3 x}{2}-\frac{3 \cot (x)}{2}+\frac{1}{2} \cos ^2(x) \cot (x)\\ \end{align*}
Mathematica [A] time = 0.0157032, size = 18, normalized size = 0.82 \[ -\frac{3 x}{2}-\frac{1}{4} \sin (2 x)-\cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.016, size = 15, normalized size = 0.7 \begin{align*} -{\frac{\cos \left ( x \right ) \sin \left ( x \right ) }{2}}-{\frac{3\,x}{2}}-\cot \left ( x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.994337, size = 22, normalized size = 1. \begin{align*} -\frac{3}{2} \, x - \frac{1}{\tan \left (x\right )} - \frac{1}{4} \, \sin \left (2 \, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.11598, size = 63, normalized size = 2.86 \begin{align*} \frac{\cos \left (x\right )^{3} - 3 \, x \sin \left (x\right ) - 3 \, \cos \left (x\right )}{2 \, \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.9787, size = 15, normalized size = 0.68 \begin{align*} - \frac{3 x}{2} - \frac{\sin{\left (2 x \right )}}{4} - \cot{\left (x \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14499, size = 31, normalized size = 1.41 \begin{align*} -\frac{3}{2} \, x - \frac{3 \, \tan \left (x\right )^{2} + 2}{2 \,{\left (\tan \left (x\right )^{3} + \tan \left (x\right )\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]