Optimal. Leaf size=46 \[ \frac{2 x}{\sqrt{3}}+\log (\tan (x)+1)+\frac{2 \tan ^{-1}\left (\frac{1-2 \cos ^2(x)}{-2 \sin (x) \cos (x)+\sqrt{3}+2}\right )}{\sqrt{3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0887961, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.263, Rules used = {4342, 1863, 31, 618, 204} \[ \frac{2 x}{\sqrt{3}}+\log (\tan (x)+1)+\frac{2 \tan ^{-1}\left (\frac{1-2 \cos ^2(x)}{-2 \sin (x) \cos (x)+\sqrt{3}+2}\right )}{\sqrt{3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4342
Rule 1863
Rule 31
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\sec ^2(x) \left (2+\tan ^2(x)\right )}{1+\tan ^3(x)} \, dx &=\operatorname{Subst}\left (\int \frac{2+x^2}{1+x^3} \, dx,x,\tan (x)\right )\\ &=\operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,\tan (x)\right )+\operatorname{Subst}\left (\int \frac{1}{1-x+x^2} \, dx,x,\tan (x)\right )\\ &=\log (1+\tan (x))-2 \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,-1+2 \tan (x)\right )\\ &=\frac{2 x}{\sqrt{3}}+\frac{2 \tan ^{-1}\left (\frac{1-2 \cos ^2(x)}{2+\sqrt{3}-2 \cos (x) \sin (x)}\right )}{\sqrt{3}}+\log (1+\tan (x))\\ \end{align*}
Mathematica [A] time = 0.227092, size = 32, normalized size = 0.7 \[ -\frac{2 \tan ^{-1}\left (\frac{1-2 \tan (x)}{\sqrt{3}}\right )}{\sqrt{3}}-\log (\cos (x))+\log (\sin (x)+\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.108, size = 24, normalized size = 0.5 \begin{align*} \ln \left ( 1+\tan \left ( x \right ) \right ) +{\frac{2\,\sqrt{3}}{3}\arctan \left ({\frac{ \left ( -1+2\,\tan \left ( x \right ) \right ) \sqrt{3}}{3}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.46102, size = 31, normalized size = 0.67 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, \tan \left (x\right ) - 1\right )}\right ) + \log \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.40297, size = 174, normalized size = 3.78 \begin{align*} \frac{1}{3} \, \sqrt{3} \arctan \left (\frac{4 \, \sqrt{3} \cos \left (x\right ) \sin \left (x\right ) - \sqrt{3}}{3 \,{\left (2 \, \cos \left (x\right )^{2} - 1\right )}}\right ) - \frac{1}{2} \, \log \left (\cos \left (x\right )^{2}\right ) + \frac{1}{2} \, \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 8.21175, size = 41, normalized size = 0.89 \begin{align*} \frac{2 \sqrt{3} \left (\operatorname{atan}{\left (\frac{2 \sqrt{3} \left (\tan{\left (x \right )} - \frac{1}{2}\right )}{3} \right )} + \pi \left \lfloor{\frac{x - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{3} + \log{\left (\tan{\left (x \right )} + 1 \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10334, size = 32, normalized size = 0.7 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, \tan \left (x\right ) - 1\right )}\right ) + \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]