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*ln(a+b*csch(x))/a/(a^2+b^2)+ln(sinh(x))/a-a*ln(tanh(x))/(a^2+b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 61, normalized size of antiderivative = 1.00, 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 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]

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 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 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]

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.06, 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))

________________________________________________________________________________________

fricas [A]  time = 1.26, size = 75, normalized size = 1.23 \[ -\frac {2 \, a b \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) - b^{2} \log \left (\frac {2 \, {\left (a \sinh \relax (x) + b\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) - a^{2} \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) + {\left (a^{2} + b^{2}\right )} x}{a^{3} + a b^{2}} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 89, normalized size = 1.46 \[ \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 )}} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.18, size = 108, normalized size = 1.77 \[ -\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}+\frac {b^{2} \ln \left (\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -2 a \tanh \left (\frac {x}{2}\right )-b \right )}{a \left (a^{2}+b^{2}\right )}+\frac {4 a \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{4 a^{2}+4 b^{2}}-\frac {8 b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{4 a^{2}+4 b^{2}} \]

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)-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)+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 = 0.41, size = 74, normalized size = 1.21 \[ \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} \]

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

________________________________________________________________________________________

mupad [B]  time = 2.53, size = 132, normalized size = 2.16 \[ \frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{a-b\,1{}\mathrm {i}}-\frac {x}{a}+\frac {b^2\,\ln \left (a^5\,{\mathrm {e}}^{2\,x}-a\,b^4-a^5+a^3\,b^2+2\,b^5\,{\mathrm {e}}^x-a^3\,b^2\,{\mathrm {e}}^{2\,x}+2\,a^4\,b\,{\mathrm {e}}^x+a\,b^4\,{\mathrm {e}}^{2\,x}-2\,a^2\,b^3\,{\mathrm {e}}^x\right )}{a^3+a\,b^2}+\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-b+a\,1{}\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x)/(a + b/sinh(x)),x)

[Out]

log(exp(x)*1i + 1)/(a - b*1i) + (log(exp(x) + 1i)*1i)/(a*1i - b) - x/a + (b^2*log(a^5*exp(2*x) - a*b^4 - a^5 +
 a^3*b^2 + 2*b^5*exp(x) - a^3*b^2*exp(2*x) + 2*a^4*b*exp(x) + a*b^4*exp(2*x) - 2*a^2*b^3*exp(x)))/(a*b^2 + a^3
)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tanh {\relax (x )}}{a + b \operatorname {csch}{\relax (x )}}\, dx \]

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)

________________________________________________________________________________________