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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (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 = 33 \[ \int \frac {\coth (x)}{a+a \cosh (x)} \, dx=-\frac {\text {arctanh}(\cosh (x))}{2 a}-\frac {\coth (x) \text {csch}(x)}{2 a}+\frac {\text {csch}^2(x)}{2 a} \]

[Out]

-1/2*arctanh(cosh(x))/a-1/2*coth(x)*csch(x)/a+1/2*csch(x)^2/a

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {2785, 2686, 30, 2691, 3855} \[ \int \frac {\coth (x)}{a+a \cosh (x)} \, dx=-\frac {\text {arctanh}(\cosh (x))}{2 a}+\frac {\text {csch}^2(x)}{2 a}-\frac {\coth (x) \text {csch}(x)}{2 a} \]

[In]

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

[Out]

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

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]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \coth ^2(x) \text {csch}(x) \, dx}{a}-\frac {\int \coth (x) \text {csch}^2(x) \, dx}{a} \\ & = -\frac {\coth (x) \text {csch}(x)}{2 a}+\frac {\int \text {csch}(x) \, dx}{2 a}-\frac {\text {Subst}(\int x \, dx,x,-i \text {csch}(x))}{a} \\ & = -\frac {\text {arctanh}(\cosh (x))}{2 a}-\frac {\coth (x) \text {csch}(x)}{2 a}+\frac {\text {csch}^2(x)}{2 a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.27 \[ \int \frac {\coth (x)}{a+a \cosh (x)} \, dx=-\frac {1+2 \cosh ^2\left (\frac {x}{2}\right ) \left (\log \left (\cosh \left (\frac {x}{2}\right )\right )-\log \left (\sinh \left (\frac {x}{2}\right )\right )\right )}{2 a (1+\cosh (x))} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.61

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

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 103 vs. \(2 (27) = 54\).

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

[In]

integrate(coth(x)/(a+a*cosh(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))/(
a*cosh(x)^2 + a*sinh(x)^2 + 2*a*cosh(x) + 2*(a*cosh(x) + a)*sinh(x) + a)

Sympy [F]

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

[In]

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

[Out]

Integral(coth(x)/(cosh(x) + 1), x)/a

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.58 \[ \int \frac {\coth (x)}{a+a \cosh (x)} \, dx=-\frac {\log \left (e^{\left (-x\right )} + e^{x} + 2\right )}{4 \, a} + \frac {\log \left (e^{\left (-x\right )} + e^{x} - 2\right )}{4 \, a} + \frac {e^{\left (-x\right )} + e^{x} - 2}{4 \, a {\left (e^{\left (-x\right )} + e^{x} + 2\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.65 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.55 \[ \int \frac {\coth (x)}{a+a \cosh (x)} \, dx=\frac {1}{a\,\left ({\mathrm {e}}^{2\,x}+2\,{\mathrm {e}}^x+1\right )}-\frac {1}{a\,\left ({\mathrm {e}}^x+1\right )}-\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\sqrt {-a^2}}{a}\right )}{\sqrt {-a^2}} \]

[In]

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

[Out]

1/(a*(exp(2*x) + 2*exp(x) + 1)) - 1/(a*(exp(x) + 1)) - atan((exp(x)*(-a^2)^(1/2))/a)/(-a^2)^(1/2)