Optimal. Leaf size=37 \[ \sqrt{2} x-x-\sqrt{2} \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0383074, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.176, Rules used = {3171, 3181, 203} \[ \sqrt{2} x-x-\sqrt{2} \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3171
Rule 3181
Rule 203
Rubi steps
\begin{align*} \int \frac{1-\cos ^2(x)}{1+\cos ^2(x)} \, dx &=-x+2 \int \frac{1}{1+\cos ^2(x)} \, dx\\ &=-x-2 \operatorname{Subst}\left (\int \frac{1}{1+2 x^2} \, dx,x,\cot (x)\right )\\ &=-x+\sqrt{2} x-\sqrt{2} \tan ^{-1}\left (\frac{\cos (x) \sin (x)}{1+\sqrt{2}+\cos ^2(x)}\right )\\ \end{align*}
Mathematica [A] time = 0.0315964, size = 23, normalized size = 0.62 \[ 2 \left (\frac{\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right )}{\sqrt{2}}-\frac{x}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.03, size = 17, normalized size = 0.5 \begin{align*} \sqrt{2}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{2}}{2}} \right ) -x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48758, size = 22, normalized size = 0.59 \begin{align*} \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} \tan \left (x\right )\right ) - x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.50551, size = 104, normalized size = 2.81 \begin{align*} -\frac{1}{2} \, \sqrt{2} \arctan \left (\frac{3 \, \sqrt{2} \cos \left (x\right )^{2} - \sqrt{2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) - x \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 5.6742, size = 61, normalized size = 1.65 \begin{align*} - x + \sqrt{2} \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} - 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right ) + \sqrt{2} \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} + 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.16333, size = 66, normalized size = 1.78 \begin{align*} \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 \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]