Optimal. Leaf size=113 \[ e^x+\frac {2 e^x}{3 \left (e^{6 x}+1\right )}+\frac {\log \left (-\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}-\frac {\log \left (\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}-\frac {2}{9} \tan ^{-1}\left (e^x\right )+\frac {1}{9} \tan ^{-1}\left (\sqrt {3}-2 e^x\right )-\frac {1}{9} \tan ^{-1}\left (2 e^x+\sqrt {3}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 9, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.900, Rules used = {2282, 390, 288, 209, 634, 618, 204, 628, 203} \[ e^x+\frac {2 e^x}{3 \left (e^{6 x}+1\right )}+\frac {\log \left (-\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}-\frac {\log \left (\sqrt {3} e^x+e^{2 x}+1\right )}{6 \sqrt {3}}-\frac {2}{9} \tan ^{-1}\left (e^x\right )+\frac {1}{9} \tan ^{-1}\left (\sqrt {3}-2 e^x\right )-\frac {1}{9} \tan ^{-1}\left (2 e^x+\sqrt {3}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 204
Rule 209
Rule 288
Rule 390
Rule 618
Rule 628
Rule 634
Rule 2282
Rubi steps
\begin {align*} \int e^x \tanh ^2(3 x) \, dx &=\operatorname {Subst}\left (\int \frac {\left (1-x^6\right )^2}{\left (1+x^6\right )^2} \, dx,x,e^x\right )\\ &=\operatorname {Subst}\left (\int \left (1-\frac {4 x^6}{\left (1+x^6\right )^2}\right ) \, dx,x,e^x\right )\\ &=e^x-4 \operatorname {Subst}\left (\int \frac {x^6}{\left (1+x^6\right )^2} \, dx,x,e^x\right )\\ &=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2}{3} \operatorname {Subst}\left (\int \frac {1}{1+x^6} \, dx,x,e^x\right )\\ &=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2}{9} \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,e^x\right )-\frac {2}{9} \operatorname {Subst}\left (\int \frac {1-\frac {\sqrt {3} x}{2}}{1-\sqrt {3} x+x^2} \, dx,x,e^x\right )-\frac {2}{9} \operatorname {Subst}\left (\int \frac {1+\frac {\sqrt {3} x}{2}}{1+\sqrt {3} x+x^2} \, dx,x,e^x\right )\\ &=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2}{9} \tan ^{-1}\left (e^x\right )-\frac {1}{18} \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {3} x+x^2} \, dx,x,e^x\right )-\frac {1}{18} \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {3} x+x^2} \, dx,x,e^x\right )+\frac {\operatorname {Subst}\left (\int \frac {-\sqrt {3}+2 x}{1-\sqrt {3} x+x^2} \, dx,x,e^x\right )}{6 \sqrt {3}}-\frac {\operatorname {Subst}\left (\int \frac {\sqrt {3}+2 x}{1+\sqrt {3} x+x^2} \, dx,x,e^x\right )}{6 \sqrt {3}}\\ &=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2}{9} \tan ^{-1}\left (e^x\right )+\frac {\log \left (1-\sqrt {3} e^x+e^{2 x}\right )}{6 \sqrt {3}}-\frac {\log \left (1+\sqrt {3} e^x+e^{2 x}\right )}{6 \sqrt {3}}+\frac {1}{9} \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,-\sqrt {3}+2 e^x\right )+\frac {1}{9} \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\sqrt {3}+2 e^x\right )\\ &=e^x+\frac {2 e^x}{3 \left (1+e^{6 x}\right )}-\frac {2}{9} \tan ^{-1}\left (e^x\right )+\frac {1}{9} \tan ^{-1}\left (\sqrt {3}-2 e^x\right )-\frac {1}{9} \tan ^{-1}\left (\sqrt {3}+2 e^x\right )+\frac {\log \left (1-\sqrt {3} e^x+e^{2 x}\right )}{6 \sqrt {3}}-\frac {\log \left (1+\sqrt {3} e^x+e^{2 x}\right )}{6 \sqrt {3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.08, size = 97, normalized size = 0.86 \[ -\frac {1}{9} \text {RootSum}\left [\text {$\#$1}^4-\text {$\#$1}^2+1\& ,\frac {\text {$\#$1}^2 x-\text {$\#$1}^2 \log \left (e^x-\text {$\#$1}\right )+2 \log \left (e^x-\text {$\#$1}\right )-2 x}{2 \text {$\#$1}^3-\text {$\#$1}}\& \right ]+e^x+\frac {2 e^x}{3 \left (e^{6 x}+1\right )}-\frac {2}{9} \tan ^{-1}\left (e^x\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 160, normalized size = 1.42 \[ \frac {4 \, {\left (e^{\left (6 \, x\right )} + 1\right )} \arctan \left (\sqrt {3} + \sqrt {-4 \, \sqrt {3} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4} - 2 \, e^{x}\right ) + 4 \, {\left (e^{\left (6 \, x\right )} + 1\right )} \arctan \left (-\sqrt {3} + 2 \, \sqrt {\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1} - 2 \, e^{x}\right ) - 4 \, {\left (e^{\left (6 \, x\right )} + 1\right )} \arctan \left (e^{x}\right ) - {\left (\sqrt {3} e^{\left (6 \, x\right )} + \sqrt {3}\right )} \log \left (4 \, \sqrt {3} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4\right ) + {\left (\sqrt {3} e^{\left (6 \, x\right )} + \sqrt {3}\right )} \log \left (-4 \, \sqrt {3} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4\right ) + 18 \, e^{\left (7 \, x\right )} + 30 \, e^{x}}{18 \, {\left (e^{\left (6 \, x\right )} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 81, normalized size = 0.72 \[ -\frac {1}{18} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{18} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {2 \, e^{x}}{3 \, {\left (e^{\left (6 \, x\right )} + 1\right )}} - \frac {1}{9} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{9} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{9} \, \arctan \left (e^{x}\right ) + e^{x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.33, size = 59, normalized size = 0.52 \[ {\mathrm e}^{x}+\frac {2 \,{\mathrm e}^{x}}{3 \left (1+{\mathrm e}^{6 x}\right )}+\left (\munderset {\textit {\_R} =\RootOf \left (6561 \textit {\_Z}^{4}-81 \textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{x}-9 \textit {\_R} \right )\right )+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{9}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{9} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 81, normalized size = 0.72 \[ -\frac {1}{18} \, \sqrt {3} \log \left (\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{18} \, \sqrt {3} \log \left (-\sqrt {3} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac {2 \, e^{x}}{3 \, {\left (e^{\left (6 \, x\right )} + 1\right )}} - \frac {1}{9} \, \arctan \left (\sqrt {3} + 2 \, e^{x}\right ) - \frac {1}{9} \, \arctan \left (-\sqrt {3} + 2 \, e^{x}\right ) - \frac {2}{9} \, \arctan \left (e^{x}\right ) + e^{x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.32, size = 86, normalized size = 0.76 \[ {\mathrm {e}}^x-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x+\sqrt {3}\right )}{9}-\frac {\mathrm {atan}\left (2\,{\mathrm {e}}^x-\sqrt {3}\right )}{9}-\frac {2\,\mathrm {atan}\left ({\mathrm {e}}^x\right )}{9}+\frac {2\,{\mathrm {e}}^x}{3\,\left ({\mathrm {e}}^{6\,x}+1\right )}+\frac {\sqrt {3}\,\ln \left ({\left (\frac {2\,{\mathrm {e}}^x}{3}-\frac {\sqrt {3}}{3}\right )}^2+\frac {1}{9}\right )}{18}-\frac {\sqrt {3}\,\ln \left ({\left (\frac {2\,{\mathrm {e}}^x}{3}+\frac {\sqrt {3}}{3}\right )}^2+\frac {1}{9}\right )}{18} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int e^{x} \tanh ^{2}{\left (3 x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________