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

Optimal. Leaf size=61 \[ -\frac{a \log (\tanh (x))}{a^2+b^2}-\frac{b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac{b^2 \log (a+b \text{csch}(x))}{a \left (a^2+b^2\right )}+\frac{\log (\sinh (x))}{a} \]

[Out]

-((b*ArcTan[Sinh[x]])/(a^2 + b^2)) + (b^2*Log[a + b*Csch[x]])/(a*(a^2 + b^2)) + Log[Sinh[x]]/a - (a*Log[Tanh[x
]])/(a^2 + b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0994827, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {3885, 894, 635, 203, 260} \[ -\frac{a \log (\tanh (x))}{a^2+b^2}-\frac{b \tan ^{-1}(\sinh (x))}{a^2+b^2}+\frac{b^2 \log (a+b \text{csch}(x))}{a \left (a^2+b^2\right )}+\frac{\log (\sinh (x))}{a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-((b*ArcTan[Sinh[x]])/(a^2 + b^2)) + (b^2*Log[a + b*Csch[x]])/(a*(a^2 + b^2)) + Log[Sinh[x]]/a - (a*Log[Tanh[x
]])/(a^2 + b^2)

Rule 3885

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> -Dist[(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[((b^2 - x^2)^((m - 1)/2)*(a + x)^n)/x, x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

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

Mathematica [C]  time = 0.0587164, size = 63, normalized size = 1.03 \[ \frac{2 b^2 \log (a \sinh (x)+b)+a (a+i b) \log (-\sinh (x)+i)+a (a-i b) \log (\sinh (x)+i)}{2 a \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 108, normalized size = 1.8 \begin{align*} -{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{{b}^{2}}{a \left ({a}^{2}+{b}^{2} \right ) }\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b-2\,a\tanh \left ( x/2 \right ) -b \right ) }-{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+4\,{\frac{a\ln \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) }{4\,{a}^{2}+4\,{b}^{2}}}-8\,{\frac{b\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{4\,{a}^{2}+4\,{b}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.22835, size = 120, normalized size = 1.97 \begin{align*} \frac{b^{2} \log \left ({\left | -a{\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, b \right |}\right )}{a^{3} + a b^{2}} - \frac{{\left (\pi + 2 \, \arctan \left (\frac{1}{2} \,{\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} b}{2 \,{\left (a^{2} + b^{2}\right )}} + \frac{a \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}{2 \,{\left (a^{2} + b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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