Optimal. Leaf size=33 \[ x-\tan ^{-1}\left (\frac{-2 \cos ^2(x)+\sin (x) \cos (x)+1}{\cos ^2(x)+2 \sin (x) \cos (x)+2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0422412, antiderivative size = 33, 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 = {4342, 617, 204} \[ x-\tan ^{-1}\left (\frac{-2 \cos ^2(x)+\sin (x) \cos (x)+1}{\cos ^2(x)+2 \sin (x) \cos (x)+2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4342
Rule 617
Rule 204
Rubi steps
\begin{align*} \int \frac{\sec ^2(x)}{2+2 \tan (x)+\tan ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{2+2 x+x^2} \, dx,x,\tan (x)\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\tan (x)\right )\\ &=x-\tan ^{-1}\left (\frac{1-2 \cos ^2(x)+\cos (x) \sin (x)}{2+\cos ^2(x)+2 \cos (x) \sin (x)}\right )\\ \end{align*}
Mathematica [A] time = 0.0438872, size = 31, normalized size = 0.94 \[ 2 \left (\frac{1}{4} \tan ^{-1}(\sec (x) (\sin (x)+\cos (x)))-\frac{1}{4} \tan ^{-1}\left (\frac{\cos (x)}{\sin (x)+\cos (x)}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.06, size = 6, normalized size = 0.2 \begin{align*} \arctan \left ( 1+\tan \left ( x \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.44625, size = 7, normalized size = 0.21 \begin{align*} \arctan \left (\tan \left (x\right ) + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.04943, size = 117, normalized size = 3.55 \begin{align*} -\frac{1}{2} \, \arctan \left (-\frac{3 \, \cos \left (x\right )^{2} + 6 \, \cos \left (x\right ) \sin \left (x\right ) + 1}{2 \,{\left (2 \, \cos \left (x\right )^{2} - \cos \left (x\right ) \sin \left (x\right ) - 1\right )}}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{2}{\left (x \right )}}{\tan ^{2}{\left (x \right )} + 2 \tan{\left (x \right )} + 2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09298, size = 7, normalized size = 0.21 \begin{align*} \arctan \left (\tan \left (x\right ) + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]