Optimal. Leaf size=47 \[ -\frac {x}{\sqrt {2}}+x-\frac {\tan (x)}{\tan ^2(x)+2}+\frac {\tan ^{-1}\left (\frac {\sin (x) \cos (x)}{\cos ^2(x)+\sqrt {2}+1}\right )}{\sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 47, 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 = {470, 12, 391, 203} \[ -\frac {x}{\sqrt {2}}+x-\frac {\tan (x)}{\tan ^2(x)+2}+\frac {\tan ^{-1}\left (\frac {\sin (x) \cos (x)}{\cos ^2(x)+\sqrt {2}+1}\right )}{\sqrt {2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 203
Rule 391
Rule 470
Rubi steps
\begin {align*} \int \frac {1}{\left (\cot ^2(x)+\csc ^2(x)\right )^2} \, dx &=\operatorname {Subst}\left (\int \frac {x^4}{\left (1+x^2\right ) \left (2+x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=-\frac {\tan (x)}{2+\tan ^2(x)}+\frac {1}{2} \operatorname {Subst}\left (\int \frac {2}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac {\tan (x)}{2+\tan ^2(x)}+\operatorname {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac {\tan (x)}{2+\tan ^2(x)}+\operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )-\operatorname {Subst}\left (\int \frac {1}{2+x^2} \, dx,x,\tan (x)\right )\\ &=x-\frac {x}{\sqrt {2}}+\frac {\tan ^{-1}\left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\cos ^2(x)}\right )}{\sqrt {2}}-\frac {\tan (x)}{2+\tan ^2(x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 64, normalized size = 1.36 \[ \frac {(\cos (2 x)+3) \csc ^4(x) \left (6 x-2 \sin (2 x)+2 x \cos (2 x)-\sqrt {2} (\cos (2 x)+3) \tan ^{-1}\left (\frac {\tan (x)}{\sqrt {2}}\right )\right )}{8 \left (\cot ^2(x)+\csc ^2(x)\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.07, size = 66, normalized size = 1.40 \[ \frac {4 \, x \cos \relax (x)^{2} + {\left (\sqrt {2} \cos \relax (x)^{2} + \sqrt {2}\right )} \arctan \left (\frac {3 \, \sqrt {2} \cos \relax (x)^{2} - \sqrt {2}}{4 \, \cos \relax (x) \sin \relax (x)}\right ) - 4 \, \cos \relax (x) \sin \relax (x) + 4 \, x}{4 \, {\left (\cos \relax (x)^{2} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 60, normalized size = 1.28 \[ -\frac {1}{2} \, \sqrt {2} {\left (x + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )}{\sqrt {2} \cos \left (2 \, x\right ) + \sqrt {2} - \cos \left (2 \, x\right ) + 1}\right )\right )} + x - \frac {\tan \relax (x)}{\tan \relax (x)^{2} + 2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.18, size = 28, normalized size = 0.60 \[ -\frac {\tan \relax (x )}{2+\tan ^{2}\relax (x )}-\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \tan \relax (x )}{2}\right )}{2}+x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 27, normalized size = 0.57 \[ -\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \relax (x)\right ) + x - \frac {\tan \relax (x)}{\tan \relax (x)^{2} + 2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.69, size = 27, normalized size = 0.57 \[ x-\frac {\mathrm {tan}\relax (x)}{{\mathrm {tan}\relax (x)}^2+2}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\mathrm {tan}\relax (x)}{2}\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{\left (\cot ^{2}{\relax (x )} + \csc ^{2}{\relax (x )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________