Optimal. Leaf size=113 \[ e^x+\frac{e^x}{e^{4 x}+1}+\frac{\log \left (-\sqrt{2} e^x+e^{2 x}+1\right )}{4 \sqrt{2}}-\frac{\log \left (\sqrt{2} e^x+e^{2 x}+1\right )}{4 \sqrt{2}}+\frac{\tan ^{-1}\left (1-\sqrt{2} e^x\right )}{2 \sqrt{2}}-\frac{\tan ^{-1}\left (\sqrt{2} e^x+1\right )}{2 \sqrt{2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0871351, antiderivative size = 113, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 9, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.9, Rules used = {2282, 390, 288, 211, 1165, 628, 1162, 617, 204} \[ e^x+\frac{e^x}{e^{4 x}+1}+\frac{\log \left (-\sqrt{2} e^x+e^{2 x}+1\right )}{4 \sqrt{2}}-\frac{\log \left (\sqrt{2} e^x+e^{2 x}+1\right )}{4 \sqrt{2}}+\frac{\tan ^{-1}\left (1-\sqrt{2} e^x\right )}{2 \sqrt{2}}-\frac{\tan ^{-1}\left (\sqrt{2} e^x+1\right )}{2 \sqrt{2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2282
Rule 390
Rule 288
Rule 211
Rule 1165
Rule 628
Rule 1162
Rule 617
Rule 204
Rubi steps
\begin{align*} \int e^x \tanh ^2(2 x) \, dx &=\operatorname{Subst}\left (\int \frac{\left (1-x^4\right )^2}{\left (1+x^4\right )^2} \, dx,x,e^x\right )\\ &=\operatorname{Subst}\left (\int \left (1-\frac{4 x^4}{\left (1+x^4\right )^2}\right ) \, dx,x,e^x\right )\\ &=e^x-4 \operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^4\right )^2} \, dx,x,e^x\right )\\ &=e^x+\frac{e^x}{1+e^{4 x}}-\operatorname{Subst}\left (\int \frac{1}{1+x^4} \, dx,x,e^x\right )\\ &=e^x+\frac{e^x}{1+e^{4 x}}-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1-x^2}{1+x^4} \, dx,x,e^x\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1+x^2}{1+x^4} \, dx,x,e^x\right )\\ &=e^x+\frac{e^x}{1+e^{4 x}}-\frac{1}{4} \operatorname{Subst}\left (\int \frac{1}{1-\sqrt{2} x+x^2} \, dx,x,e^x\right )-\frac{1}{4} \operatorname{Subst}\left (\int \frac{1}{1+\sqrt{2} x+x^2} \, dx,x,e^x\right )+\frac{\operatorname{Subst}\left (\int \frac{\sqrt{2}+2 x}{-1-\sqrt{2} x-x^2} \, dx,x,e^x\right )}{4 \sqrt{2}}+\frac{\operatorname{Subst}\left (\int \frac{\sqrt{2}-2 x}{-1+\sqrt{2} x-x^2} \, dx,x,e^x\right )}{4 \sqrt{2}}\\ &=e^x+\frac{e^x}{1+e^{4 x}}+\frac{\log \left (1-\sqrt{2} e^x+e^{2 x}\right )}{4 \sqrt{2}}-\frac{\log \left (1+\sqrt{2} e^x+e^{2 x}\right )}{4 \sqrt{2}}-\frac{\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-\sqrt{2} e^x\right )}{2 \sqrt{2}}+\frac{\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\sqrt{2} e^x\right )}{2 \sqrt{2}}\\ &=e^x+\frac{e^x}{1+e^{4 x}}+\frac{\tan ^{-1}\left (1-\sqrt{2} e^x\right )}{2 \sqrt{2}}-\frac{\tan ^{-1}\left (1+\sqrt{2} e^x\right )}{2 \sqrt{2}}+\frac{\log \left (1-\sqrt{2} e^x+e^{2 x}\right )}{4 \sqrt{2}}-\frac{\log \left (1+\sqrt{2} e^x+e^{2 x}\right )}{4 \sqrt{2}}\\ \end{align*}
Mathematica [C] time = 0.0428853, size = 48, normalized size = 0.42 \[ \frac{1}{4} \text{RootSum}\left [\text{$\#$1}^4+1\& ,\frac{x-\log \left (e^x-\text{$\#$1}\right )}{\text{$\#$1}^3}\& \right ]+e^x+\frac{e^x}{e^{4 x}+1} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.059, size = 35, normalized size = 0.3 \begin{align*}{{\rm e}^{x}}+{\frac{{{\rm e}^{x}}}{1+{{\rm e}^{4\,x}}}}+\sum _{{\it \_R}={\it RootOf} \left ( 256\,{{\it \_Z}}^{4}+1 \right ) }{\it \_R}\,\ln \left ({{\rm e}^{x}}-4\,{\it \_R} \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.57587, size = 120, normalized size = 1.06 \begin{align*} -\frac{1}{4} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} + 2 \, e^{x}\right )}\right ) - \frac{1}{4} \, \sqrt{2} \arctan \left (-\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} - 2 \, e^{x}\right )}\right ) - \frac{1}{8} \, \sqrt{2} \log \left (\sqrt{2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac{1}{8} \, \sqrt{2} \log \left (-\sqrt{2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac{e^{x}}{e^{\left (4 \, x\right )} + 1} + e^{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.29514, size = 510, normalized size = 4.51 \begin{align*} \frac{4 \,{\left (\sqrt{2} e^{\left (4 \, x\right )} + \sqrt{2}\right )} \arctan \left (-\sqrt{2} e^{x} + \sqrt{2} \sqrt{\sqrt{2} e^{x} + e^{\left (2 \, x\right )} + 1} - 1\right ) + 4 \,{\left (\sqrt{2} e^{\left (4 \, x\right )} + \sqrt{2}\right )} \arctan \left (-\sqrt{2} e^{x} + \frac{1}{2} \, \sqrt{2} \sqrt{-4 \, \sqrt{2} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4} + 1\right ) -{\left (\sqrt{2} e^{\left (4 \, x\right )} + \sqrt{2}\right )} \log \left (4 \, \sqrt{2} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4\right ) +{\left (\sqrt{2} e^{\left (4 \, x\right )} + \sqrt{2}\right )} \log \left (-4 \, \sqrt{2} e^{x} + 4 \, e^{\left (2 \, x\right )} + 4\right ) + 8 \, e^{\left (5 \, x\right )} + 16 \, e^{x}}{8 \,{\left (e^{\left (4 \, x\right )} + 1\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 e^{x} \tanh ^{2}{\left (2 x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.2077, size = 120, normalized size = 1.06 \begin{align*} -\frac{1}{4} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} + 2 \, e^{x}\right )}\right ) - \frac{1}{4} \, \sqrt{2} \arctan \left (-\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} - 2 \, e^{x}\right )}\right ) - \frac{1}{8} \, \sqrt{2} \log \left (\sqrt{2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac{1}{8} \, \sqrt{2} \log \left (-\sqrt{2} e^{x} + e^{\left (2 \, x\right )} + 1\right ) + \frac{e^{x}}{e^{\left (4 \, x\right )} + 1} + e^{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]