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.09, antiderivative size = 46, normalized size of antiderivative = 1.00, 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 31
Rule 204
Rule 618
Rule 1863
Rule 4342
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.22, size = 32, normalized size = 0.70 \[ -\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]
________________________________________________________________________________________
fricas [A] time = 2.51, size = 52, normalized size = 1.13 \[ \frac {1}{3} \, \sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} \cos \relax (x) \sin \relax (x) - \sqrt {3}}{3 \, {\left (2 \, \cos \relax (x)^{2} - 1\right )}}\right ) - \frac {1}{2} \, \log \left (\cos \relax (x)^{2}\right ) + \frac {1}{2} \, \log \left (2 \, \cos \relax (x) \sin \relax (x) + 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 24, normalized size = 0.52 \[ \frac {2}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, \tan \relax (x) - 1\right )}\right ) + \log \left ({\left | \tan \relax (x) + 1 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.20, size = 24, normalized size = 0.52 \[ \frac {2 \sqrt {3}\, \arctan \left (\frac {\left (-1+2 \tan \relax (x )\right ) \sqrt {3}}{3}\right )}{3}+\ln \left (1+\tan \relax (x )\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 23, normalized size = 0.50 \[ \frac {2}{3} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, \tan \relax (x) - 1\right )}\right ) + \log \left (\tan \relax (x) + 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.97, size = 30, normalized size = 0.65 \[ \ln \left (\mathrm {tan}\relax (x)+1\right )-\frac {2\,\sqrt {3}\,\mathrm {atan}\left (\frac {\sqrt {3}-\sqrt {3}\,\mathrm {tan}\relax (x)}{\mathrm {tan}\relax (x)+1}\right )}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 9.25, size = 41, normalized size = 0.89 \[ \frac {2 \sqrt {3} \left (\operatorname {atan}{\left (\frac {2 \sqrt {3} \left (\tan {\relax (x )} - \frac {1}{2}\right )}{3} \right )} + \pi \left \lfloor {\frac {x - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{3} + \log {\left (\tan {\relax (x )} + 1 \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________