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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0788969, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {3571, 3530, 3475} \[ -\frac{b x}{a^2-b^2}+\frac{b^2 \log (a \cosh (x)+b \sinh (x))}{a \left (a^2-b^2\right )}+\frac{\log (\sinh (x))}{a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3571

Int[1/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[((a*
c - b*d)*x)/((a^2 + b^2)*(c^2 + d^2)), x] + (Dist[b^2/((b*c - a*d)*(a^2 + b^2)), Int[(b - a*Tan[e + f*x])/(a +
 b*Tan[e + f*x]), x], x] - Dist[d^2/((b*c - a*d)*(c^2 + d^2)), Int[(d - c*Tan[e + f*x])/(c + d*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[c^2 + d^2, 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]

Rule 3475

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

Rubi steps

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

Mathematica [A]  time = 0.0769372, size = 46, normalized size = 0.9 \[ \frac{\left (a^2-b^2\right ) \log (\sinh (x))+b (b \log (a \cosh (x)+b \sinh (x))-a x)}{a^3-a b^2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.039, size = 78, normalized size = 1.5 \begin{align*} -{\frac{1}{a-b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{{b}^{2}}{ \left ( a+b \right ) \left ( a-b \right ) a}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\tanh \left ( x/2 \right ) b+a \right ) }+{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }-{\frac{1}{a+b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.261, size = 88, normalized size = 1.73 \begin{align*} \frac{b^{2} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{3} - a b^{2}} + \frac{x}{a + b} + \frac{\log \left (e^{\left (-x\right )} + 1\right )}{a} + \frac{\log \left (e^{\left (-x\right )} - 1\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\coth{\left (x \right )}}{a + b \tanh{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.18033, size = 78, normalized size = 1.53 \begin{align*} \frac{b^{2} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{3} - a b^{2}} - \frac{x}{a - b} + \frac{\log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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