3.817 \(\int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx\)

Optimal. Leaf size=19 \[ \sqrt {2} \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )-x \]

[Out]

-x+arctanh(2^(1/2)*tanh(x))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {1093, 207} \[ \sqrt {2} \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )-x \]

Antiderivative was successfully verified.

[In]

Int[(Sech[x]^2 - Tanh[x]^2)^(-1),x]

[Out]

-x + Sqrt[2]*ArcTanh[Sqrt[2]*Tanh[x]]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 1093

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/(b/
2 - q/2 + c*x^2), x], x] - Dist[c/q, Int[1/(b/2 + q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*
a*c, 0] && PosQ[b^2 - 4*a*c]

Rubi steps

\begin {align*} \int \frac {1}{\text {sech}^2(x)-\tanh ^2(x)} \, dx &=\operatorname {Subst}\left (\int \frac {1}{1-3 x^2+2 x^4} \, dx,x,\tanh (x)\right )\\ &=2 \operatorname {Subst}\left (\int \frac {1}{-2+2 x^2} \, dx,x,\tanh (x)\right )-2 \operatorname {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\tanh (x)\right )\\ &=-x+\sqrt {2} \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 19, normalized size = 1.00 \[ \sqrt {2} \tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )-x \]

Antiderivative was successfully verified.

[In]

Integrate[(Sech[x]^2 - Tanh[x]^2)^(-1),x]

[Out]

-x + Sqrt[2]*ArcTanh[Sqrt[2]*Tanh[x]]

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 70, normalized size = 3.68 \[ \frac {1}{2} \, \sqrt {2} \log \left (-\frac {3 \, {\left (2 \, \sqrt {2} - 3\right )} \cosh \relax (x)^{2} - 4 \, {\left (3 \, \sqrt {2} - 4\right )} \cosh \relax (x) \sinh \relax (x) + 3 \, {\left (2 \, \sqrt {2} - 3\right )} \sinh \relax (x)^{2} - 2 \, \sqrt {2} + 3}{\cosh \relax (x)^{2} + \sinh \relax (x)^{2} - 3}\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)^2-tanh(x)^2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*log(-(3*(2*sqrt(2) - 3)*cosh(x)^2 - 4*(3*sqrt(2) - 4)*cosh(x)*sinh(x) + 3*(2*sqrt(2) - 3)*sinh(x)^
2 - 2*sqrt(2) + 3)/(cosh(x)^2 + sinh(x)^2 - 3)) - x

________________________________________________________________________________________

giac [B]  time = 0.14, size = 41, normalized size = 2.16 \[ -\frac {1}{2} \, \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 \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)^2-tanh(x)^2),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*log(abs(-4*sqrt(2) + 2*e^(2*x) - 6)/abs(4*sqrt(2) + 2*e^(2*x) - 6)) - x

________________________________________________________________________________________

maple [B]  time = 0.22, size = 54, normalized size = 2.84 \[ \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-2\right ) \sqrt {2}}{4}\right )+\sqrt {2}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )+2\right ) \sqrt {2}}{4}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sech(x)^2-tanh(x)^2),x)

[Out]

ln(tanh(1/2*x)-1)-ln(tanh(1/2*x)+1)+2^(1/2)*arctanh(1/4*(2*tanh(1/2*x)-2)*2^(1/2))+2^(1/2)*arctanh(1/4*(2*tanh
(1/2*x)+2)*2^(1/2))

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 64, normalized size = 3.37 \[ \frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} + 1}{\sqrt {2} + e^{\left (-x\right )} - 1}\right ) - \frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - e^{\left (-x\right )} - 1}{\sqrt {2} + e^{\left (-x\right )} + 1}\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)^2-tanh(x)^2),x, algorithm="maxima")

[Out]

1/2*sqrt(2)*log(-(sqrt(2) - e^(-x) + 1)/(sqrt(2) + e^(-x) - 1)) - 1/2*sqrt(2)*log(-(sqrt(2) - e^(-x) - 1)/(sqr
t(2) + e^(-x) + 1)) - x

________________________________________________________________________________________

mupad [B]  time = 0.17, size = 56, normalized size = 2.95 \[ \frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}+\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{2}\right )}{2}-\frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}-4\right )}{2}\right )}{2}-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1/cosh(x)^2 - tanh(x)^2),x)

[Out]

(2^(1/2)*log(8*exp(2*x) + (2^(1/2)*(12*exp(2*x) - 4))/2))/2 - (2^(1/2)*log(8*exp(2*x) - (2^(1/2)*(12*exp(2*x)
- 4))/2))/2 - x

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{\left (- \tanh {\relax (x )} + \operatorname {sech}{\relax (x )}\right ) \left (\tanh {\relax (x )} + \operatorname {sech}{\relax (x )}\right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sech(x)**2-tanh(x)**2),x)

[Out]

Integral(1/((-tanh(x) + sech(x))*(tanh(x) + sech(x))), x)

________________________________________________________________________________________