\(\int \frac {\coth (x)}{a+b \cosh (x)} \, dx\) [183]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 54 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=\frac {\log (1-\cosh (x))}{2 (a+b)}+\frac {\log (1+\cosh (x))}{2 (a-b)}-\frac {a \log (a+b \cosh (x))}{a^2-b^2} \]

[Out]

1/2*ln(1-cosh(x))/(a+b)+1/2*ln(1+cosh(x))/(a-b)-a*ln(a+b*cosh(x))/(a^2-b^2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {2800, 815} \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=-\frac {a \log (a+b \cosh (x))}{a^2-b^2}+\frac {\log (1-\cosh (x))}{2 (a+b)}+\frac {\log (\cosh (x)+1)}{2 (a-b)} \]

[In]

Int[Coth[x]/(a + b*Cosh[x]),x]

[Out]

Log[1 - Cosh[x]]/(2*(a + b)) + Log[1 + Cosh[x]]/(2*(a - b)) - (a*Log[a + b*Cosh[x]])/(a^2 - b^2)

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {x}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \cosh (x)\right ) \\ & = -\text {Subst}\left (\int \left (\frac {1}{2 (a+b) (b-x)}+\frac {a}{(a-b) (a+b) (a+x)}-\frac {1}{2 (a-b) (b+x)}\right ) \, dx,x,b \cosh (x)\right ) \\ & = \frac {\log (1-\cosh (x))}{2 (a+b)}+\frac {\log (1+\cosh (x))}{2 (a-b)}-\frac {a \log (a+b \cosh (x))}{a^2-b^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.93 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=\frac {\log \left (\cosh \left (\frac {x}{2}\right )\right )}{a-b}-\frac {a \log (a+b \cosh (x))}{a^2-b^2}+\frac {\log \left (\sinh \left (\frac {x}{2}\right )\right )}{a+b} \]

[In]

Integrate[Coth[x]/(a + b*Cosh[x]),x]

[Out]

Log[Cosh[x/2]]/(a - b) - (a*Log[a + b*Cosh[x]])/(a^2 - b^2) + Log[Sinh[x/2]]/(a + b)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.98

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.11 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=-\frac {a \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\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 )}{a^{2} - b^{2}} \]

[In]

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

[Out]

-(a*log(2*(b*cosh(x) + a)/(cosh(x) - sinh(x))) - (a + b)*log(cosh(x) + sinh(x) + 1) - (a - b)*log(cosh(x) + si
nh(x) - 1))/(a^2 - b^2)

Sympy [F]

\[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=\int \frac {\coth {\left (x \right )}}{a + b \cosh {\left (x \right )}}\, dx \]

[In]

integrate(coth(x)/(a+b*cosh(x)),x)

[Out]

Integral(coth(x)/(a + b*cosh(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.09 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=-\frac {a \log \left (2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} + b\right )}{a^{2} - b^{2}} + \frac {\log \left (e^{\left (-x\right )} + 1\right )}{a - b} + \frac {\log \left (e^{\left (-x\right )} - 1\right )}{a + b} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.24 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=-\frac {a b \log \left ({\left | b {\left (e^{\left (-x\right )} + e^{x}\right )} + 2 \, a \right |}\right )}{a^{2} b - b^{3}} + \frac {\log \left (e^{\left (-x\right )} + e^{x} + 2\right )}{2 \, {\left (a - b\right )}} + \frac {\log \left (e^{\left (-x\right )} + e^{x} - 2\right )}{2 \, {\left (a + b\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.45 (sec) , antiderivative size = 148, normalized size of antiderivative = 2.74 \[ \int \frac {\coth (x)}{a+b \cosh (x)} \, dx=\frac {\ln \left (128\,a\,b-128\,a^2-32\,b^2+128\,a^2\,{\mathrm {e}}^x+32\,b^2\,{\mathrm {e}}^x-128\,a\,b\,{\mathrm {e}}^x\right )}{a+b}+\frac {\ln \left (-128\,a\,b-128\,a^2-32\,b^2-128\,a^2\,{\mathrm {e}}^x-32\,b^2\,{\mathrm {e}}^x-128\,a\,b\,{\mathrm {e}}^x\right )}{a-b}-\frac {a\,\ln \left (16\,a^2\,b-4\,b^3\,{\mathrm {e}}^{2\,x}-4\,b^3+32\,a^3\,{\mathrm {e}}^x-8\,a\,b^2\,{\mathrm {e}}^x+16\,a^2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^2-b^2} \]

[In]

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

[Out]

log(128*a*b - 128*a^2 - 32*b^2 + 128*a^2*exp(x) + 32*b^2*exp(x) - 128*a*b*exp(x))/(a + b) + log(- 128*a*b - 12
8*a^2 - 32*b^2 - 128*a^2*exp(x) - 32*b^2*exp(x) - 128*a*b*exp(x))/(a - b) - (a*log(16*a^2*b - 4*b^3*exp(2*x) -
 4*b^3 + 32*a^3*exp(x) - 8*a*b^2*exp(x) + 16*a^2*b*exp(2*x)))/(a^2 - b^2)