3.7.87 \(\int \frac {1}{\sinh (x)-\tanh (x)} \, dx\) [687]

Optimal. Leaf size=20 \[ -\frac {1}{2} \tanh ^{-1}(\cosh (x))+\frac {1}{2 (1-\cosh (x))} \]

[Out]

-1/2*arctanh(cosh(x))+1/2/(1-cosh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 24, normalized size of antiderivative = 1.20, number of steps used = 6, number of rules used = 6, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {4482, 2785, 2686, 30, 2691, 3855} \begin {gather*} -\frac {1}{2} \text {csch}^2(x)-\frac {1}{2} \tanh ^{-1}(\cosh (x))-\frac {1}{2} \coth (x) \text {csch}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sinh[x] - Tanh[x])^(-1),x]

[Out]

-1/2*ArcTanh[Cosh[x]] - (Coth[x]*Csch[x])/2 - Csch[x]^2/2

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2785

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps

\begin {align*} \int \frac {1}{\sinh (x)-\tanh (x)} \, dx &=-\left (i \int \frac {\coth (x)}{i-i \cosh (x)} \, dx\right )\\ &=\int \coth ^2(x) \text {csch}(x) \, dx+\int \coth (x) \text {csch}^2(x) \, dx\\ &=-\frac {1}{2} \coth (x) \text {csch}(x)+\frac {1}{2} \int \text {csch}(x) \, dx+\text {Subst}(\int x \, dx,x,-i \text {csch}(x))\\ &=-\frac {1}{2} \tanh ^{-1}(\cosh (x))-\frac {1}{2} \coth (x) \text {csch}(x)-\frac {\text {csch}^2(x)}{2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(50\) vs. \(2(20)=40\).
time = 0.04, size = 50, normalized size = 2.50 \begin {gather*} -\frac {1}{4} \text {csch}^2\left (\frac {x}{2}\right ) \left (1-\log \left (\cosh \left (\frac {x}{2}\right )\right )+\cosh (x) \left (\log \left (\cosh \left (\frac {x}{2}\right )\right )-\log \left (\sinh \left (\frac {x}{2}\right )\right )\right )+\log \left (\sinh \left (\frac {x}{2}\right )\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sinh[x] - Tanh[x])^(-1),x]

[Out]

-1/4*(Csch[x/2]^2*(1 - Log[Cosh[x/2]] + Cosh[x]*(Log[Cosh[x/2]] - Log[Sinh[x/2]]) + Log[Sinh[x/2]]))

________________________________________________________________________________________

Maple [A]
time = 1.10, size = 17, normalized size = 0.85

method result size
default \(-\frac {1}{4 \tanh \left (\frac {x}{2}\right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )\right )}{2}\) \(17\)
risch \(-\frac {{\mathrm e}^{x}}{\left ({\mathrm e}^{x}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{x}+1\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}-1\right )}{2}\) \(26\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sinh(x)-tanh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (14) = 28\).
time = 0.26, size = 40, normalized size = 2.00 \begin {gather*} \frac {e^{\left (-x\right )}}{2 \, e^{\left (-x\right )} - e^{\left (-2 \, x\right )} - 1} - \frac {1}{2} \, \log \left (e^{\left (-x\right )} + 1\right ) + \frac {1}{2} \, \log \left (e^{\left (-x\right )} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sinh(x)-tanh(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 96 vs. \(2 (14) = 28\).
time = 0.39, size = 96, normalized size = 4.80 \begin {gather*} -\frac {{\left (\cosh \left (x\right )^{2} + 2 \, {\left (\cosh \left (x\right ) - 1\right )} \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) + 1\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (\cosh \left (x\right )^{2} + 2 \, {\left (\cosh \left (x\right ) - 1\right )} \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) + 1\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) + 2 \, \cosh \left (x\right ) + 2 \, \sinh \left (x\right )}{2 \, {\left (\cosh \left (x\right )^{2} + 2 \, {\left (\cosh \left (x\right ) - 1\right )} \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sinh(x)-tanh(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sinh {\left (x \right )} - \tanh {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sinh(x)-tanh(x)),x)

[Out]

Integral(1/(sinh(x) - tanh(x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (14) = 28\).
time = 0.41, size = 43, normalized size = 2.15 \begin {gather*} -\frac {e^{\left (-x\right )} + e^{x} + 2}{4 \, {\left (e^{\left (-x\right )} + e^{x} - 2\right )}} - \frac {1}{4} \, \log \left (e^{\left (-x\right )} + e^{x} + 2\right ) + \frac {1}{4} \, \log \left (e^{\left (-x\right )} + e^{x} - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sinh(x)-tanh(x)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 41, normalized size = 2.05 \begin {gather*} \frac {\ln \left (1-{\mathrm {e}}^x\right )}{2}-\frac {\ln \left (-{\mathrm {e}}^x-1\right )}{2}-\frac {1}{{\mathrm {e}}^{2\,x}-2\,{\mathrm {e}}^x+1}-\frac {1}{{\mathrm {e}}^x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sinh(x) - tanh(x)),x)

[Out]

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

________________________________________________________________________________________