Optimal. Leaf size=26 \[ -\frac {2 \text {ArcTan}\left (\frac {1-2 \tanh (x)}{\sqrt {3}}\right )}{\sqrt {3}}+\log (1+\tanh (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 26, 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 = {4427, 1877, 31,
632, 210} \begin {gather*} \log (\tanh (x)+1)-\frac {2 \text {ArcTan}\left (\frac {1-2 \tanh (x)}{\sqrt {3}}\right )}{\sqrt {3}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 210
Rule 632
Rule 1877
Rule 4427
Rubi steps
\begin {align*} \int \frac {\text {sech}^2(x) \left (2+\tanh ^2(x)\right )}{1+\tanh ^3(x)} \, dx &=\text {Subst}\left (\int \frac {2+x^2}{1+x^3} \, dx,x,\tanh (x)\right )\\ &=\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\tanh (x)\right )+\text {Subst}\left (\int \frac {1}{1-x+x^2} \, dx,x,\tanh (x)\right )\\ &=\log (1+\tanh (x))-2 \text {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.16, size = 27, normalized size = 1.04 \begin {gather*} x+\frac {2 \text {ArcTan}\left (\frac {-1+2 \tanh (x)}{\sqrt {3}}\right )}{\sqrt {3}}-\log (\cosh (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains complex when optimal does not.
time = 1.13, size = 78, normalized size = 3.00
method | result | size |
risch | \(2 x -\ln \left (1+{\mathrm e}^{2 x}\right )+\frac {i \sqrt {3}\, \ln \left ({\mathrm e}^{2 x}+i \sqrt {3}\right )}{3}-\frac {i \sqrt {3}\, \ln \left ({\mathrm e}^{2 x}-i \sqrt {3}\right )}{3}\) | \(50\) |
default | \(\frac {i \sqrt {3}\, \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+\left (-i \sqrt {3}-1\right ) \tanh \left (\frac {x}{2}\right )+1\right )}{3}-\frac {i \sqrt {3}\, \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+\left (i \sqrt {3}-1\right ) \tanh \left (\frac {x}{2}\right )+1\right )}{3}-\ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )+2 \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )\) | \(78\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 122 vs.
\(2 (23) = 46\).
time = 0.47, size = 122, normalized size = 4.69 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 50 vs.
\(2 (23) = 46\).
time = 0.35, size = 50, normalized size = 1.92 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 28, normalized size = 1.08 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.50, size = 47, normalized size = 1.81 \begin {gather*} 2\,x-\ln \left (768\,{\mathrm {e}}^{2\,x}+768\right )-\frac {2\,\sqrt {3}\,\mathrm {atan}\left (\frac {\frac {640\,\sqrt {3}}{3}-\frac {128\,\sqrt {3}\,{\mathrm {e}}^{2\,x}}{3}}{\frac {640\,{\mathrm {e}}^{2\,x}}{3}+128}\right )}{3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________