Optimal. Leaf size=36 \[ x-\frac {x}{\sqrt {2}}-\frac {\tan ^{-1}\left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\sin ^2(x)}\right )}{\sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3250, 3260,
209} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {\sin (x) \cos (x)}{\sin ^2(x)+\sqrt {2}+1}\right )}{\sqrt {2}}-\frac {x}{\sqrt {2}}+x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3250
Rule 3260
Rubi steps
\begin {align*} \int \frac {\sin ^2(x)}{1+\sin ^2(x)} \, dx &=x-\int \frac {1}{1+\sin ^2(x)} \, dx\\ &=x-\text {Subst}\left (\int \frac {1}{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}+\sin ^2(x)}\right )}{\sqrt {2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 18, normalized size = 0.50 \begin {gather*} x-\frac {\tan ^{-1}\left (\sqrt {2} \tan (x)\right )}{\sqrt {2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 17, normalized size = 0.47
method | result | size |
default | \(\arctan \left (\tan \left (x \right )\right )-\frac {\sqrt {2}\, \arctan \left (\tan \left (x \right ) \sqrt {2}\right )}{2}\) | \(17\) |
risch | \(x -\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}-3\right )}{4}+\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}-3\right )}{4}\) | \(41\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 1.48, size = 14, normalized size = 0.39 \begin {gather*} -\frac {1}{2} \, \sqrt {2} \arctan \left (\sqrt {2} \tan \left (x\right )\right ) + x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.06, size = 33, normalized size = 0.92 \begin {gather*} \frac {1}{4} \, \sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (x\right )^{2} - 2 \, \sqrt {2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) + x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 248 vs.
\(2 (36) = 72\).
time = 23.52, size = 248, normalized size = 6.89 \begin {gather*} \frac {31988856 \sqrt {2} x}{31988856 \sqrt {2} + 45239074} + \frac {45239074 x}{31988856 \sqrt {2} + 45239074} - \frac {77227930 \sqrt {3 - 2 \sqrt {2}} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {3 - 2 \sqrt {2}}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{31988856 \sqrt {2} + 45239074} - \frac {54608393 \sqrt {2} \sqrt {3 - 2 \sqrt {2}} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {3 - 2 \sqrt {2}}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{31988856 \sqrt {2} + 45239074} - \frac {13250218 \sqrt {2 \sqrt {2} + 3} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {2 \sqrt {2} + 3}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{31988856 \sqrt {2} + 45239074} - \frac {9369319 \sqrt {2} \sqrt {2 \sqrt {2} + 3} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {2 \sqrt {2} + 3}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{31988856 \sqrt {2} + 45239074} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 48, normalized size = 1.33 \begin {gather*} -\frac {1}{2} \, \sqrt {2} {\left (x + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt {2} \cos \left (2 \, x\right ) + \sqrt {2} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )} + x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.21, size = 26, normalized size = 0.72 \begin {gather*} x-\frac {\sqrt {2}\,\left (x-\mathrm {atan}\left (\mathrm {tan}\left (x\right )\right )\right )}{2}-\frac {\sqrt {2}\,\mathrm {atan}\left (\sqrt {2}\,\mathrm {tan}\left (x\right )\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________