Optimal. Leaf size=26 \[ \log (\tanh (x)+1)-\frac{2 \tan ^{-1}\left (\frac{1-2 \tanh (x)}{\sqrt{3}}\right )}{\sqrt{3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0906898, antiderivative size = 26, 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} \[ \log (\tanh (x)+1)-\frac{2 \tan ^{-1}\left (\frac{1-2 \tanh (x)}{\sqrt{3}}\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{\text{sech}^2(x) \left (2+\tanh ^2(x)\right )}{1+\tanh ^3(x)} \, dx &=\operatorname{Subst}\left (\int \frac{2+x^2}{1+x^3} \, dx,x,\tanh (x)\right )\\ &=\operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,\tanh (x)\right )+\operatorname{Subst}\left (\int \frac{1}{1-x+x^2} \, dx,x,\tanh (x)\right )\\ &=\log (1+\tanh (x))-2 \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,-1+2 \tanh (x)\right )\\ &=-\frac{2 \tan ^{-1}\left (\frac{1-2 \tanh (x)}{\sqrt{3}}\right )}{\sqrt{3}}+\log (1+\tanh (x))\\ \end{align*}
Mathematica [A] time = 0.218905, size = 27, normalized size = 1.04 \[ x+\frac{2 \tan ^{-1}\left (\frac{2 \tanh (x)-1}{\sqrt{3}}\right )}{\sqrt{3}}-\log (\cosh (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.075, size = 78, normalized size = 3. \begin{align*} 2\,\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) +{\frac{i}{3}}\sqrt{3}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+ \left ( -i\sqrt{3}-1 \right ) \tanh \left ({\frac{x}{2}} \right ) +1 \right ) -{\frac{i}{3}}\sqrt{3}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+ \left ( i\sqrt{3}-1 \right ) \tanh \left ({\frac{x}{2}} \right ) +1 \right ) -\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.62797, size = 165, normalized size = 6.35 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{6} \cdot 3^{\frac{3}{4}} \sqrt{2}{\left (2 \, \sqrt{3} e^{\left (-x\right )} + 3^{\frac{1}{4}} \sqrt{2}\right )}\right ) - \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{6} \cdot 3^{\frac{3}{4}} \sqrt{2}{\left (2 \, \sqrt{3} e^{\left (-x\right )} - 3^{\frac{1}{4}} \sqrt{2}\right )}\right ) + \frac{1}{3} \, \log \left (\tanh \left (x\right )^{3} + 1\right ) - \frac{1}{3} \, \log \left (3^{\frac{1}{4}} \sqrt{2} e^{\left (-x\right )} + \sqrt{3} e^{\left (-2 \, x\right )} + 1\right ) - \frac{1}{3} \, \log \left (-3^{\frac{1}{4}} \sqrt{2} e^{\left (-x\right )} + \sqrt{3} e^{\left (-2 \, x\right )} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.441, size = 170, normalized size = 6.54 \begin{align*} -\frac{2}{3} \, \sqrt{3} \arctan \left (-\frac{\sqrt{3} \cosh \left (x\right ) + \sqrt{3} \sinh \left (x\right )}{3 \,{\left (\cosh \left (x\right ) - \sinh \left (x\right )\right )}}\right ) + 2 \, x - \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\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 \frac{\left (\tanh ^{2}{\left (x \right )} + 2\right ) \operatorname{sech}^{2}{\left (x \right )}}{\left (\tanh{\left (x \right )} + 1\right ) \left (\tanh ^{2}{\left (x \right )} - \tanh{\left (x \right )} + 1\right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22031, size = 38, normalized size = 1.46 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3} e^{\left (2 \, x\right )}\right ) + 2 \, x - \log \left (e^{\left (2 \, x\right )} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]