Optimal. Leaf size=54 \[ -x+\frac {7 \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{4 \sqrt {2}}+\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2}-\frac {\tanh (x)}{4 \left (1-2 \tanh ^2(x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 54, 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, 541, 536,
212} \begin {gather*} -x+\frac {7 \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{4 \sqrt {2}}-\frac {\tanh (x)}{4 \left (1-2 \tanh ^2(x)\right )}+\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 425
Rule 536
Rule 541
Rubi steps
\begin {align*} \int \frac {1}{\left (\text {sech}^2(x)-\tanh ^2(x)\right )^3} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1-2 x^2\right )^3 \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2}+\frac {1}{4} \text {Subst}\left (\int \frac {2-6 x^2}{\left (1-2 x^2\right )^2 \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2}-\frac {\tanh (x)}{4 \left (1-2 \tanh ^2(x)\right )}+\frac {1}{8} \text {Subst}\left (\int \frac {6+2 x^2}{\left (1-2 x^2\right ) \left (1-x^2\right )} \, dx,x,\tanh (x)\right )\\ &=\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2}-\frac {\tanh (x)}{4 \left (1-2 \tanh ^2(x)\right )}+\frac {7}{4} \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 {7 \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{4 \sqrt {2}}+\frac {\tanh (x)}{2 \left (1-2 \tanh ^2(x)\right )^2}-\frac {\tanh (x)}{4 \left (1-2 \tanh ^2(x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 66, normalized size = 1.22 \begin {gather*} \frac {-76 x+7 \sqrt {2} \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right ) (-3+\cosh (2 x))^2+48 x \cosh (2 x)-4 x \cosh (4 x)-2 \sinh (2 x)+3 \sinh (4 x)}{8 (-3+\cosh (2 x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(139\) vs.
\(2(44)=88\).
time = 1.23, size = 140, normalized size = 2.59
method | result | size |
risch | \(-x +\frac {17 \,{\mathrm e}^{6 x}-57 \,{\mathrm e}^{4 x}+19 \,{\mathrm e}^{2 x}-3}{2 \left ({\mathrm e}^{4 x}-6 \,{\mathrm e}^{2 x}+1\right )^{2}}+\frac {7 \sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-3+2 \sqrt {2}\right )}{16}-\frac {7 \sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-3-2 \sqrt {2}\right )}{16}\) | \(75\) |
default | \(\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )-\frac {2 \left (-\frac {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{8}+\frac {\left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}{8}-\frac {5 \tanh \left (\frac {x}{2}\right )}{8}+\frac {1}{8}\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )+2 \tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {7 \sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )+2\right ) \sqrt {2}}{4}\right )}{8}-\frac {2 \left (-\frac {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{8}-\frac {\left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}{8}-\frac {5 \tanh \left (\frac {x}{2}\right )}{8}-\frac {1}{8}\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )-2 \tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {7 \sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-2\right ) \sqrt {2}}{4}\right )}{8}\) | \(140\) |
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. 114 vs.
\(2 (44) = 88\).
time = 0.48, size = 114, normalized size = 2.11 \begin {gather*} \frac {7}{16} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} + 1}{\sqrt {2} + e^{\left (-x\right )} - 1}\right ) - \frac {7}{16} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} - 1}{\sqrt {2} + e^{\left (-x\right )} + 1}\right ) - x + \frac {19 \, e^{\left (-2 \, x\right )} - 57 \, e^{\left (-4 \, x\right )} + 17 \, e^{\left (-6 \, x\right )} - 3}{2 \, {\left (12 \, e^{\left (-2 \, x\right )} - 38 \, e^{\left (-4 \, x\right )} + 12 \, e^{\left (-6 \, x\right )} - e^{\left (-8 \, 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. 717 vs.
\(2 (44) = 88\).
time = 0.42, size = 717, normalized size = 13.28 \begin {gather*} -\frac {16 \, x \cosh \left (x\right )^{8} + 128 \, x \cosh \left (x\right ) \sinh \left (x\right )^{7} + 16 \, x \sinh \left (x\right )^{8} - 8 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )^{6} + 8 \, {\left (56 \, x \cosh \left (x\right )^{2} - 24 \, x - 17\right )} \sinh \left (x\right )^{6} + 16 \, {\left (56 \, x \cosh \left (x\right )^{3} - 3 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{5} + 152 \, {\left (4 \, x + 3\right )} \cosh \left (x\right )^{4} + 8 \, {\left (140 \, x \cosh \left (x\right )^{4} - 15 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )^{2} + 76 \, x + 57\right )} \sinh \left (x\right )^{4} + 32 \, {\left (28 \, x \cosh \left (x\right )^{5} - 5 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )^{3} + 19 \, {\left (4 \, x + 3\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 8 \, {\left (24 \, x + 19\right )} \cosh \left (x\right )^{2} + 8 \, {\left (56 \, x \cosh \left (x\right )^{6} - 15 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )^{4} + 114 \, {\left (4 \, x + 3\right )} \cosh \left (x\right )^{2} - 24 \, x - 19\right )} \sinh \left (x\right )^{2} - 7 \, {\left (\sqrt {2} \cosh \left (x\right )^{8} + 8 \, \sqrt {2} \cosh \left (x\right ) \sinh \left (x\right )^{7} + \sqrt {2} \sinh \left (x\right )^{8} + 4 \, {\left (7 \, \sqrt {2} \cosh \left (x\right )^{2} - 3 \, \sqrt {2}\right )} \sinh \left (x\right )^{6} - 12 \, \sqrt {2} \cosh \left (x\right )^{6} + 8 \, {\left (7 \, \sqrt {2} \cosh \left (x\right )^{3} - 9 \, \sqrt {2} \cosh \left (x\right )\right )} \sinh \left (x\right )^{5} + 2 \, {\left (35 \, \sqrt {2} \cosh \left (x\right )^{4} - 90 \, \sqrt {2} \cosh \left (x\right )^{2} + 19 \, \sqrt {2}\right )} \sinh \left (x\right )^{4} + 38 \, \sqrt {2} \cosh \left (x\right )^{4} + 8 \, {\left (7 \, \sqrt {2} \cosh \left (x\right )^{5} - 30 \, \sqrt {2} \cosh \left (x\right )^{3} + 19 \, \sqrt {2} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + 4 \, {\left (7 \, \sqrt {2} \cosh \left (x\right )^{6} - 45 \, \sqrt {2} \cosh \left (x\right )^{4} + 57 \, \sqrt {2} \cosh \left (x\right )^{2} - 3 \, \sqrt {2}\right )} \sinh \left (x\right )^{2} - 12 \, \sqrt {2} \cosh \left (x\right )^{2} + 8 \, {\left (\sqrt {2} \cosh \left (x\right )^{7} - 9 \, \sqrt {2} \cosh \left (x\right )^{5} + 19 \, \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 (8 \, x \cosh \left (x\right )^{7} - 3 \, {\left (24 \, x + 17\right )} \cosh \left (x\right )^{5} + 38 \, {\left (4 \, x + 3\right )} \cosh \left (x\right )^{3} - {\left (24 \, x + 19\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 16 \, x + 24}{16 \, {\left (\cosh \left (x\right )^{8} + 8 \, \cosh \left (x\right ) \sinh \left (x\right )^{7} + \sinh \left (x\right )^{8} + 4 \, {\left (7 \, \cosh \left (x\right )^{2} - 3\right )} \sinh \left (x\right )^{6} - 12 \, \cosh \left (x\right )^{6} + 8 \, {\left (7 \, \cosh \left (x\right )^{3} - 9 \, \cosh \left (x\right )\right )} \sinh \left (x\right )^{5} + 2 \, {\left (35 \, \cosh \left (x\right )^{4} - 90 \, \cosh \left (x\right )^{2} + 19\right )} \sinh \left (x\right )^{4} + 38 \, \cosh \left (x\right )^{4} + 8 \, {\left (7 \, \cosh \left (x\right )^{5} - 30 \, \cosh \left (x\right )^{3} + 19 \, \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + 4 \, {\left (7 \, \cosh \left (x\right )^{6} - 45 \, \cosh \left (x\right )^{4} + 57 \, \cosh \left (x\right )^{2} - 3\right )} \sinh \left (x\right )^{2} - 12 \, \cosh \left (x\right )^{2} + 8 \, {\left (\cosh \left (x\right )^{7} - 9 \, \cosh \left (x\right )^{5} + 19 \, \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 )^{3} \left (\tanh {\left (x \right )} + \operatorname {sech}{\left (x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 77, normalized size = 1.43 \begin {gather*} -\frac {7}{16} \, \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 {17 \, e^{\left (6 \, x\right )} - 57 \, e^{\left (4 \, x\right )} + 19 \, e^{\left (2 \, x\right )} - 3}{2 \, {\left (e^{\left (4 \, x\right )} - 6 \, e^{\left (2 \, x\right )} + 1\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 114, normalized size = 2.11 \begin {gather*} \frac {136\,{\mathrm {e}}^{2\,x}-24}{38\,{\mathrm {e}}^{4\,x}-12\,{\mathrm {e}}^{2\,x}-12\,{\mathrm {e}}^{6\,x}+{\mathrm {e}}^{8\,x}+1}-x-\frac {7\,\sqrt {2}\,\ln \left (7\,{\mathrm {e}}^{2\,x}-\frac {7\,\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{16}\right )}{16}+\frac {7\,\sqrt {2}\,\ln \left (7\,{\mathrm {e}}^{2\,x}+\frac {7\,\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{16}\right )}{16}+\frac {\frac {17\,{\mathrm {e}}^{2\,x}}{2}+\frac {45}{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]
________________________________________________________________________________________