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

Optimal. Leaf size=4 \[ x+\tanh (x) \]

[Out]

x+tanh(x)

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 4, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3657, 3473, 8} \[ x+\tanh (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tanh[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 4, normalized size = 1.00 \[ x+\tanh (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tanh[x]

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 14, normalized size = 3.50 \[ \frac {{\left (x - 1\right )} \cosh \relax (x) + \sinh \relax (x)}{\cosh \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((x - 1)*cosh(x) + sinh(x))/cosh(x)

________________________________________________________________________________________

giac [B]  time = 0.13, size = 12, normalized size = 3.00 \[ x - \frac {2}{e^{\left (2 \, x\right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 2/(e^(2*x) + 1)

________________________________________________________________________________________

maple [B]  time = 0.17, size = 34, normalized size = 8.50 \[ -\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\frac {2 \tanh \left (\frac {x}{2}\right )}{\tanh ^{2}\left (\frac {x}{2}\right )+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.31, size = 12, normalized size = 3.00 \[ x + \frac {2}{e^{\left (-2 \, x\right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 2/(e^(-2*x) + 1)

________________________________________________________________________________________

mupad [B]  time = 1.66, size = 12, normalized size = 3.00 \[ x-\frac {2}{{\mathrm {e}}^{2\,x}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 2/(exp(2*x) + 1)

________________________________________________________________________________________

sympy [B]  time = 0.81, size = 29, normalized size = 7.25 \[ - \frac {x \operatorname {sech}^{2}{\relax (x )}}{\tanh ^{2}{\relax (x )} - 1} - \frac {\tanh {\relax (x )} \operatorname {sech}^{2}{\relax (x )}}{\tanh ^{2}{\relax (x )} - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________