3.987 \(\int \frac{\text{sech}^2(x)}{-\tanh ^2(x)+\tanh ^3(x)} \, dx\)

Optimal. Leaf size=15 \[ \coth (x)+\log (1-\tanh (x))-\log (\tanh (x)) \]

[Out]

Coth[x] + Log[1 - Tanh[x]] - Log[Tanh[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0576355, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {4342, 44} \[ \coth (x)+\log (1-\tanh (x))-\log (\tanh (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Coth[x] + Log[1 - Tanh[x]] - Log[Tanh[x]]

Rule 4342

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFactors[Tan[c*(a + b*x)], x]}, Dist[d/
(b*c), Subst[Int[SubstFor[1, Tan[c*(a + b*x)]/d, u, x], x], x, Tan[c*(a + b*x)]/d], x] /; FunctionOfQ[Tan[c*(a
 + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Sec] || EqQ[F, sec])

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.0239386, size = 11, normalized size = 0.73 \[ -x+\coth (x)-\log (\sinh (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-x + Coth[x] - Log[Sinh[x]]

________________________________________________________________________________________

Maple [B]  time = 0.05, size = 32, normalized size = 2.1 \begin{align*}{\frac{1}{2}\tanh \left ({\frac{x}{2}} \right ) }+{\frac{1}{2} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) +2\,\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(x)^2/(-tanh(x)^2+tanh(x)^3),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.03875, size = 43, normalized size = 2.87 \begin{align*} -2 \, x - \frac{2}{e^{\left (-2 \, x\right )} - 1} - \log \left (e^{\left (-x\right )} + 1\right ) - \log \left (e^{\left (-x\right )} - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.00154, size = 188, normalized size = 12.53 \begin{align*} -\frac{{\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 1\right )} \log \left (\frac{2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - 2}{\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\operatorname{sech}^{2}{\left (x \right )}}{\left (\tanh{\left (x \right )} - 1\right ) \tanh ^{2}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)**2/(-tanh(x)**2+tanh(x)**3),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.20419, size = 35, normalized size = 2.33 \begin{align*} \frac{e^{\left (2 \, x\right )} + 1}{e^{\left (2 \, x\right )} - 1} - \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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