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

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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, 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 = {414, 12, 481, 206} \[ x-\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}}+\frac {\tanh (x)}{1-2 \tanh ^2(x)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x - ArcTanh[Sqrt[2]*Tanh[x]]/Sqrt[2] + Tanh[x]/(1 - 2*Tanh[x]^2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 206

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

Rule 414

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(b*x*(a + b*x^n)^(p + 1)*(
c + d*x^n)^(q + 1))/(a*n*(p + 1)*(b*c - a*d)), x] + Dist[1/(a*n*(p + 1)*(b*c - a*d)), Int[(a + b*x^n)^(p + 1)*
(c + d*x^n)^q*Simp[b*c + n*(p + 1)*(b*c - a*d) + d*b*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d,
 n, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  !( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomial
Q[a, b, c, d, n, p, q, x]

Rule 481

Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> -Dist[(a*e^n)/(b*c -
a*d), Int[(e*x)^(m - n)/(a + b*x^n), x], x] + Dist[(c*e^n)/(b*c - a*d), Int[(e*x)^(m - n)/(c + d*x^n), x], x]
/; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1]

Rubi steps

\begin {align*} \int \frac {1}{\left (\text {sech}^2(x)-\tanh ^2(x)\right )^2} \, dx &=\operatorname {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} \operatorname {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)}-\operatorname {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)}-\operatorname {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\tanh (x)\right )+\operatorname {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.12, size = 42, normalized size = 1.35 \[ \frac {-3 x-\sinh (2 x)+x \cosh (2 x)}{\cosh (2 x)-3}-\frac {\tanh ^{-1}\left (\sqrt {2} \tanh (x)\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(ArcTanh[Sqrt[2]*Tanh[x]]/Sqrt[2]) + (-3*x + x*Cosh[2*x] - Sinh[2*x])/(-3 + Cosh[2*x])

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 266, normalized size = 8.58 \[ \frac {4 \, x \cosh \relax (x)^{4} + 16 \, x \cosh \relax (x) \sinh \relax (x)^{3} + 4 \, x \sinh \relax (x)^{4} - 24 \, {\left (x + 1\right )} \cosh \relax (x)^{2} + 24 \, {\left (x \cosh \relax (x)^{2} - x - 1\right )} \sinh \relax (x)^{2} + {\left (\sqrt {2} \cosh \relax (x)^{4} + 4 \, \sqrt {2} \cosh \relax (x) \sinh \relax (x)^{3} + \sqrt {2} \sinh \relax (x)^{4} + 6 \, {\left (\sqrt {2} \cosh \relax (x)^{2} - \sqrt {2}\right )} \sinh \relax (x)^{2} - 6 \, \sqrt {2} \cosh \relax (x)^{2} + 4 \, {\left (\sqrt {2} \cosh \relax (x)^{3} - 3 \, \sqrt {2} \cosh \relax (x)\right )} \sinh \relax (x) + \sqrt {2}\right )} \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 ) + 16 \, {\left (x \cosh \relax (x)^{3} - 3 \, {\left (x + 1\right )} \cosh \relax (x)\right )} \sinh \relax (x) + 4 \, x + 8}{4 \, {\left (\cosh \relax (x)^{4} + 4 \, \cosh \relax (x) \sinh \relax (x)^{3} + \sinh \relax (x)^{4} + 6 \, {\left (\cosh \relax (x)^{2} - 1\right )} \sinh \relax (x)^{2} - 6 \, \cosh \relax (x)^{2} + 4 \, {\left (\cosh \relax (x)^{3} - 3 \, \cosh \relax (x)\right )} \sinh \relax (x) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(4*x*cosh(x)^4 + 16*x*cosh(x)*sinh(x)^3 + 4*x*sinh(x)^4 - 24*(x + 1)*cosh(x)^2 + 24*(x*cosh(x)^2 - x - 1)*
sinh(x)^2 + (sqrt(2)*cosh(x)^4 + 4*sqrt(2)*cosh(x)*sinh(x)^3 + sqrt(2)*sinh(x)^4 + 6*(sqrt(2)*cosh(x)^2 - sqrt
(2))*sinh(x)^2 - 6*sqrt(2)*cosh(x)^2 + 4*(sqrt(2)*cosh(x)^3 - 3*sqrt(2)*cosh(x))*sinh(x) + 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)/(cos
h(x)^2 + sinh(x)^2 - 3)) + 16*(x*cosh(x)^3 - 3*(x + 1)*cosh(x))*sinh(x) + 4*x + 8)/(cosh(x)^4 + 4*cosh(x)*sinh
(x)^3 + sinh(x)^4 + 6*(cosh(x)^2 - 1)*sinh(x)^2 - 6*cosh(x)^2 + 4*(cosh(x)^3 - 3*cosh(x))*sinh(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.14, size = 63, normalized size = 2.03 \[ \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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.24, size = 108, normalized size = 3.48 \[ \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}-\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )-\frac {2-2 \tanh \left (\frac {x}{2}\right )}{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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.42, size = 88, normalized size = 2.84 \[ -\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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*sqrt(2)*log(-(sqrt(2) - e^(-x) + 1)/(sqrt(2) + e^(-x) - 1)) + 1/4*sqrt(2)*log(-(sqrt(2) - e^(-x) - 1)/(sq
rt(2) + e^(-x) + 1)) + x - 2*(3*e^(-2*x) - 1)/(6*e^(-2*x) - e^(-4*x) - 1)

________________________________________________________________________________________

mupad [B]  time = 1.61, size = 78, normalized size = 2.52 \[ 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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________