3.85 \(\int \frac{\text{csch}^2(x)}{a+b \tanh (x)} \, dx\)

Optimal. Leaf size=29 \[ -\frac{b \log (\tanh (x))}{a^2}+\frac{b \log (a+b \tanh (x))}{a^2}-\frac{\coth (x)}{a} \]

[Out]

-(Coth[x]/a) - (b*Log[Tanh[x]])/a^2 + (b*Log[a + b*Tanh[x]])/a^2

________________________________________________________________________________________

Rubi [A]  time = 0.0541423, antiderivative size = 29, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3516, 44} \[ -\frac{b \log (\tanh (x))}{a^2}+\frac{b \log (a+b \tanh (x))}{a^2}-\frac{\coth (x)}{a} \]

Antiderivative was successfully verified.

[In]

Int[Csch[x]^2/(a + b*Tanh[x]),x]

[Out]

-(Coth[x]/a) - (b*Log[Tanh[x]])/a^2 + (b*Log[a + b*Tanh[x]])/a^2

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{\text{csch}^2(x)}{a+b \tanh (x)} \, dx &=b \operatorname{Subst}\left (\int \frac{1}{x^2 (a+x)} \, dx,x,b \tanh (x)\right )\\ &=b \operatorname{Subst}\left (\int \left (\frac{1}{a x^2}-\frac{1}{a^2 x}+\frac{1}{a^2 (a+x)}\right ) \, dx,x,b \tanh (x)\right )\\ &=-\frac{\coth (x)}{a}-\frac{b \log (\tanh (x))}{a^2}+\frac{b \log (a+b \tanh (x))}{a^2}\\ \end{align*}

Mathematica [A]  time = 0.0834297, size = 28, normalized size = 0.97 \[ -\frac{-b \log (a \cosh (x)+b \sinh (x))+a \coth (x)+b \log (\sinh (x))}{a^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Csch[x]^2/(a + b*Tanh[x]),x]

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csch(x)^2/(a+b*tanh(x)),x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(x)^2/(a+b*tanh(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.25994, size = 360, normalized size = 12.41 \begin{align*} \frac{{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} - b\right )} \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 (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} - b\right )} \log \left (\frac{2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - 2 \, a}{a^{2} \cosh \left (x\right )^{2} + 2 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a^{2} \sinh \left (x\right )^{2} - a^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(x)^2/(a+b*tanh(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(x)**2/(a+b*tanh(x)),x)

[Out]

Integral(csch(x)**2/(a + b*tanh(x)), x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csch(x)^2/(a+b*tanh(x)),x, algorithm="giac")

[Out]

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