Optimal. Leaf size=31 \[ x-\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}}+\frac {\tanh (x)}{1-2 \tanh ^2(x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {425, 12, 492,
212} \begin {gather*} x-\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}}+\frac {\tanh (x)}{1-2 \tanh ^2(x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 212
Rule 425
Rule 492
Rubi steps
\begin {align*} \int \frac {1}{\left (\text {sech}^2(x)-\tanh ^2(x)\right )^2} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1-2 x^2\right )^2 \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{1-2 \tanh ^2(x)}+\frac {1}{2} \text {Subst}\left (\int -\frac {2 x^2}{\left (1-2 x^2\right ) \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{1-2 \tanh ^2(x)}-\text {Subst}\left (\int \frac {x^2}{\left (1-2 x^2\right ) \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{1-2 \tanh ^2(x)}-\text {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\tanh (x)\right )+\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (x)\right )\\ &=x-\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}}+\frac {\tanh (x)}{1-2 \tanh ^2(x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 42, normalized size = 1.35 \begin {gather*} -\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}}+\frac {-3 x+x \cosh (2 x)-\sinh (2 x)}{-3+\cosh (2 x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(107\) vs.
\(2(27)=54\).
time = 1.20, size = 108, normalized size = 3.48
method | result | size |
risch | \(x -\frac {2 \left (3 \,{\mathrm e}^{2 x}-1\right )}{{\mathrm e}^{4 x}-6 \,{\mathrm e}^{2 x}+1}+\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-3-2 \sqrt {2}\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-3+2 \sqrt {2}\right )}{4}\) | \(61\) |
default | \(\frac {2 \tanh \left (\frac {x}{2}\right )+2}{2 \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-4 \tanh \left (\frac {x}{2}\right )-2}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-2\right ) \sqrt {2}}{4}\right )}{2}-\frac {-2 \tanh \left (\frac {x}{2}\right )+2}{2 \left (\tanh ^{2}\left (\frac {x}{2}\right )+2 \tanh \left (\frac {x}{2}\right )-1\right )}-\frac {\sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )+2\right ) \sqrt {2}}{4}\right )}{2}+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )\) | \(108\) |
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. 88 vs.
\(2 (28) = 56\).
time = 0.48, size = 88, normalized size = 2.84 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} + 1}{\sqrt {2} + e^{\left (-x\right )} - 1}\right ) + \frac {1}{4} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} - 1}{\sqrt {2} + e^{\left (-x\right )} + 1}\right ) + x - \frac {2 \, {\left (3 \, e^{\left (-2 \, x\right )} - 1\right )}}{6 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} \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. 266 vs.
\(2 (28) = 56\).
time = 0.38, size = 266, normalized size = 8.58 \begin {gather*} \frac {4 \, x \cosh \left (x\right )^{4} + 16 \, x \cosh \left (x\right ) \sinh \left (x\right )^{3} + 4 \, x \sinh \left (x\right )^{4} - 24 \, {\left (x + 1\right )} \cosh \left (x\right )^{2} + 24 \, {\left (x \cosh \left (x\right )^{2} - x - 1\right )} \sinh \left (x\right )^{2} + {\left (\sqrt {2} \cosh \left (x\right )^{4} + 4 \, \sqrt {2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sqrt {2} \sinh \left (x\right )^{4} + 6 \, {\left (\sqrt {2} \cosh \left (x\right )^{2} - \sqrt {2}\right )} \sinh \left (x\right )^{2} - 6 \, \sqrt {2} \cosh \left (x\right )^{2} + 4 \, {\left (\sqrt {2} \cosh \left (x\right )^{3} - 3 \, \sqrt {2} \cosh \left (x\right )\right )} \sinh \left (x\right ) + \sqrt {2}\right )} \log \left (\frac {3 \, {\left (2 \, \sqrt {2} + 3\right )} \cosh \left (x\right )^{2} - 4 \, {\left (3 \, \sqrt {2} + 4\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 3 \, {\left (2 \, \sqrt {2} + 3\right )} \sinh \left (x\right )^{2} - 2 \, \sqrt {2} - 3}{\cosh \left (x\right )^{2} + \sinh \left (x\right )^{2} - 3}\right ) + 16 \, {\left (x \cosh \left (x\right )^{3} - 3 \, {\left (x + 1\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \, x + 8}{4 \, {\left (\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 6 \, {\left (\cosh \left (x\right )^{2} - 1\right )} \sinh \left (x\right )^{2} - 6 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} - 3 \, \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1\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 {1}{\left (- \tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right )^{2} \left (\tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 63 vs.
\(2 (28) = 56\).
time = 0.42, size = 63, normalized size = 2.03 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} + 2 \, e^{\left (2 \, x\right )} - 6 \right |}}{{\left | 4 \, \sqrt {2} + 2 \, e^{\left (2 \, x\right )} - 6 \right |}}\right ) + x - \frac {2 \, {\left (3 \, e^{\left (2 \, x\right )} - 1\right )}}{e^{\left (4 \, x\right )} - 6 \, e^{\left (2 \, x\right )} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.61, size = 78, normalized size = 2.52 \begin {gather*} x-\frac {\sqrt {2}\,\ln \left (-4\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{4}\right )}{4}+\frac {\sqrt {2}\,\ln \left (\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{4}-4\,{\mathrm {e}}^{2\,x}\right )}{4}-\frac {6\,{\mathrm {e}}^{2\,x}-2}{{\mathrm {e}}^{4\,x}-6\,{\mathrm {e}}^{2\,x}+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________