Optimal. Leaf size=38 \[ \frac {\cos ^3(x)}{3}+\frac {3 \cos ^2(x)}{2}+2 \cos (x)+\frac {\sec ^2(x)}{2}+3 \sec (x)-2 \log (\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4397, 2707, 75} \[ \frac {\cos ^3(x)}{3}+\frac {3 \cos ^2(x)}{2}+2 \cos (x)+\frac {\sec ^2(x)}{2}+3 \sec (x)-2 \log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 75
Rule 2707
Rule 4397
Rubi steps
\begin {align*} \int (\sin (x)+\tan (x))^3 \, dx &=\int (1+\cos (x))^3 \tan ^3(x) \, dx\\ &=-\operatorname {Subst}\left (\int \frac {(1-x) (1+x)^4}{x^3} \, dx,x,\cos (x)\right )\\ &=-\operatorname {Subst}\left (\int \left (-2+\frac {1}{x^3}+\frac {3}{x^2}+\frac {2}{x}-3 x-x^2\right ) \, dx,x,\cos (x)\right )\\ &=2 \cos (x)+\frac {3 \cos ^2(x)}{2}+\frac {\cos ^3(x)}{3}-2 \log (\cos (x))+3 \sec (x)+\frac {\sec ^2(x)}{2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 40, normalized size = 1.05 \[ \frac {9 \cos (x)}{4}+\frac {3}{4} \cos (2 x)+\frac {1}{12} \cos (3 x)+\frac {\sec ^2(x)}{2}+3 \sec (x)-2 \log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 2.02, size = 47, normalized size = 1.24 \[ \frac {4 \, \cos \relax (x)^{5} + 18 \, \cos \relax (x)^{4} + 24 \, \cos \relax (x)^{3} - 24 \, \cos \relax (x)^{2} \log \left (-\cos \relax (x)\right ) - 9 \, \cos \relax (x)^{2} + 36 \, \cos \relax (x) + 6}{12 \, \cos \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.45, size = 173, normalized size = 4.55 \[ \frac {\tan \left (\frac {1}{2} \, x\right )^{4} \tan \relax (x)^{4} - 2 \, \log \left (\frac {4}{\tan \relax (x)^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{4} \tan \relax (x)^{2} - 10 \, \tan \left (\frac {1}{2} \, x\right )^{4} \tan \relax (x)^{2} - 2 \, \log \left (\frac {4}{\tan \relax (x)^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{4} - 8 \, \tan \left (\frac {1}{2} \, x\right )^{4} - 3 \, \tan \left (\frac {1}{2} \, x\right )^{2} \tan \relax (x)^{2} - \tan \relax (x)^{4} + 2 \, \log \left (\frac {4}{\tan \relax (x)^{2} + 1}\right ) \tan \relax (x)^{2} - 3 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 11 \, \tan \relax (x)^{2} + 2 \, \log \left (\frac {4}{\tan \relax (x)^{2} + 1}\right ) - 13}{2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{4} \tan \relax (x)^{2} + \tan \left (\frac {1}{2} \, x\right )^{4} - \tan \relax (x)^{2} - 1\right )}} + \frac {1}{12} \, \cos \left (3 \, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 39, normalized size = 1.03 \[ \frac {8 \left (2+\sin ^{2}\relax (x )\right ) \cos \relax (x )}{3}-\frac {3 \left (\sin ^{2}\relax (x )\right )}{2}-2 \ln \left (\cos \relax (x )\right )+\frac {3 \left (\sin ^{4}\relax (x )\right )}{\cos \relax (x )}+\frac {\left (\tan ^{2}\relax (x )\right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 42, normalized size = 1.11 \[ \frac {1}{3} \, \cos \relax (x)^{3} - \frac {3}{2} \, \sin \relax (x)^{2} - \frac {1}{2 \, {\left (\sin \relax (x)^{2} - 1\right )}} + \frac {3}{\cos \relax (x)} + 2 \, \cos \relax (x) - \log \left (\sin \relax (x)^{2} - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.45, size = 65, normalized size = 1.71 \[ 4\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2\right )+\frac {-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+\frac {20\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}{3}+\frac {20\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}+\frac {32}{3}}{{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^2\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 5.99, size = 46, normalized size = 1.21 \[ - 3 \log {\left (\cos {\relax (x )} \right )} - \frac {\log {\left (\sec ^{2}{\relax (x )} \right )}}{2} + \frac {\cos ^{3}{\relax (x )}}{3} + \frac {3 \cos ^{2}{\relax (x )}}{2} + 2 \cos {\relax (x )} + \frac {\sec ^{2}{\relax (x )}}{2} + \frac {3}{\cos {\relax (x )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________