3.145 \(\int \frac{\coth (x)}{a+b \coth (x)} \, dx\)

Optimal. Leaf size=39 \[ \frac{a \log (a \sinh (x)+b \cosh (x))}{a^2-b^2}-\frac{b x}{a^2-b^2} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0584835, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3531, 3530} \[ \frac{a \log (a \sinh (x)+b \cosh (x))}{a^2-b^2}-\frac{b x}{a^2-b^2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{\coth (x)}{a+b \coth (x)} \, dx &=-\frac{b x}{a^2-b^2}+\frac{(i a) \int \frac{-i b-i a \coth (x)}{a+b \coth (x)} \, dx}{a^2-b^2}\\ &=-\frac{b x}{a^2-b^2}+\frac{a \log (b \cosh (x)+a \sinh (x))}{a^2-b^2}\\ \end{align*}

Mathematica [A]  time = 0.0449134, size = 29, normalized size = 0.74 \[ \frac{a \log (a \sinh (x)+b \cosh (x))-b x}{a^2-b^2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 55, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( 1+{\rm coth} \left (x\right ) \right ) }{2\,a-2\,b}}-{\frac{\ln \left ({\rm coth} \left (x\right )-1 \right ) }{2\,b+2\,a}}+{\frac{a\ln \left ( a+b{\rm coth} \left (x\right ) \right ) }{ \left ( a+b \right ) \left ( a-b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.23757, size = 49, normalized size = 1.26 \begin{align*} \frac{a \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{2} - b^{2}} + \frac{x}{a + b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.57295, size = 109, normalized size = 2.79 \begin{align*} -\frac{{\left (a + b\right )} x - a \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) + a \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} - b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 1.34243, size = 134, normalized size = 3.44 \begin{align*} \begin{cases} \tilde{\infty } x & \text{for}\: a = 0 \wedge b = 0 \\\frac{x \tanh{\left (x \right )}}{2 b \tanh{\left (x \right )} - 2 b} - \frac{x}{2 b \tanh{\left (x \right )} - 2 b} - \frac{1}{2 b \tanh{\left (x \right )} - 2 b} & \text{for}\: a = - b \\\frac{x \tanh{\left (x \right )}}{2 b \tanh{\left (x \right )} + 2 b} + \frac{x}{2 b \tanh{\left (x \right )} + 2 b} - \frac{1}{2 b \tanh{\left (x \right )} + 2 b} & \text{for}\: a = b \\\frac{x}{b} & \text{for}\: a = 0 \\\frac{a x}{a^{2} - b^{2}} - \frac{a \log{\left (\tanh{\left (x \right )} + 1 \right )}}{a^{2} - b^{2}} + \frac{a \log{\left (\tanh{\left (x \right )} + \frac{b}{a} \right )}}{a^{2} - b^{2}} - \frac{b x}{a^{2} - b^{2}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0)), (x*tanh(x)/(2*b*tanh(x) - 2*b) - x/(2*b*tanh(x) - 2*b) - 1/(2*b*tanh(x
) - 2*b), Eq(a, -b)), (x*tanh(x)/(2*b*tanh(x) + 2*b) + x/(2*b*tanh(x) + 2*b) - 1/(2*b*tanh(x) + 2*b), Eq(a, b)
), (x/b, Eq(a, 0)), (a*x/(a**2 - b**2) - a*log(tanh(x) + 1)/(a**2 - b**2) + a*log(tanh(x) + b/a)/(a**2 - b**2)
 - b*x/(a**2 - b**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.12691, size = 58, normalized size = 1.49 \begin{align*} \frac{a \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b \right |}\right )}{a^{2} - b^{2}} - \frac{x}{a - b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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