3.7.48 \(\int (a \coth (x)+b \text {csch}(x)) \, dx\) [648]

Optimal. Leaf size=12 \[ -b \tanh ^{-1}(\cosh (x))+a \log (\sinh (x)) \]

[Out]

-b*arctanh(cosh(x))+a*ln(sinh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3556, 3855} \begin {gather*} a \log (\sinh (x))-b \tanh ^{-1}(\cosh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[a*Coth[x] + b*Csch[x],x]

[Out]

-(b*ArcTanh[Cosh[x]]) + a*Log[Sinh[x]]

Rule 3556

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

Rule 3855

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

Rubi steps

\begin {align*} \int (a \coth (x)+b \text {csch}(x)) \, dx &=a \int \coth (x) \, dx+b \int \text {csch}(x) \, dx\\ &=-b \tanh ^{-1}(\cosh (x))+a \log (\sinh (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 15, normalized size = 1.25 \begin {gather*} a \log (\sinh (x))+b \log \left (\tanh \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[a*Coth[x] + b*Csch[x],x]

[Out]

a*Log[Sinh[x]] + b*Log[Tanh[x/2]]

________________________________________________________________________________________

Maple [A]
time = 0.45, size = 14, normalized size = 1.17

method result size
default \(a \ln \left (\sinh \left (x \right )\right )+b \ln \left (\tanh \left (\frac {x}{2}\right )\right )\) \(14\)
risch \(-a x +a \ln \left ({\mathrm e}^{2 x}-1\right )-b \ln \left ({\mathrm e}^{x}+1\right )+b \ln \left ({\mathrm e}^{x}-1\right )\) \(30\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*coth(x)+b*csch(x),x,method=_RETURNVERBOSE)

[Out]

a*ln(sinh(x))+b*ln(tanh(1/2*x))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 13, normalized size = 1.08 \begin {gather*} a \log \left (\sinh \left (x\right )\right ) + b \log \left (\tanh \left (\frac {1}{2} \, x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*coth(x)+b*csch(x),x, algorithm="maxima")

[Out]

a*log(sinh(x)) + b*log(tanh(1/2*x))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (12) = 24\).
time = 0.39, size = 29, normalized size = 2.42 \begin {gather*} -a x + {\left (a - b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) + {\left (a + b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*coth(x)+b*csch(x),x, algorithm="fricas")

[Out]

-a*x + (a - b)*log(cosh(x) + sinh(x) + 1) + (a + b)*log(cosh(x) + sinh(x) - 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \coth {\left (x \right )} + b \operatorname {csch}{\left (x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*coth(x)+b*csch(x),x)

[Out]

Integral(a*coth(x) + b*csch(x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (12) = 24\).
time = 0.40, size = 33, normalized size = 2.75 \begin {gather*} -a {\left (x - \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )\right )} - b {\left (\log \left (e^{x} + 1\right ) - \log \left ({\left | e^{x} - 1 \right |}\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*coth(x)+b*csch(x),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 35, normalized size = 2.92 \begin {gather*} \ln \left (-2\,b-2\,b\,{\mathrm {e}}^x\right )\,\left (a-b\right )-a\,x+\ln \left (2\,b-2\,b\,{\mathrm {e}}^x\right )\,\left (a+b\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(b/sinh(x) + a*coth(x),x)

[Out]

log(- 2*b - 2*b*exp(x))*(a - b) - a*x + log(2*b - 2*b*exp(x))*(a + b)

________________________________________________________________________________________