3.3.31 \(\int \frac {\tanh (x)}{a+b \sinh (x)} \, dx\) [231]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 48, 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 = {2800, 815, 649, 209, 266} \begin {gather*} \frac {b \text {ArcTan}(\sinh (x))}{a^2+b^2}-\frac {a \log (a+b \sinh (x))}{a^2+b^2}+\frac {a \log (\cosh (x))}{a^2+b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 209

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

Rule 266

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 649

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 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 36, normalized size = 0.75 \begin {gather*} \frac {2 b \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )+a \log (\cosh (x))-a \log (a+b \sinh (x))}{a^2+b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.51, size = 73, normalized size = 1.52

method result size
default \(\frac {2 a \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )+4 b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{2 a^{2}+2 b^{2}}-\frac {2 a \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )}{2 a^{2}+2 b^{2}}\) \(73\)
risch \(\frac {i \ln \left ({\mathrm e}^{x}+i\right ) b}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}+i\right ) a}{a^{2}+b^{2}}-\frac {i \ln \left ({\mathrm e}^{x}-i\right ) b}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}-i\right ) a}{a^{2}+b^{2}}-\frac {a \ln \left ({\mathrm e}^{2 x}+\frac {2 a \,{\mathrm e}^{x}}{b}-1\right )}{a^{2}+b^{2}}\) \(101\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(x)/(a+b*sinh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 66, normalized size = 1.38 \begin {gather*} -\frac {2 \, b \arctan \left (e^{\left (-x\right )}\right )}{a^{2} + b^{2}} - \frac {a \log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a^{2} + b^{2}} + \frac {a \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{2} + b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 57, normalized size = 1.19 \begin {gather*} \frac {2 \, b \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - a \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + a \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} + b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 89, normalized size = 1.85 \begin {gather*} -\frac {a b \log \left ({\left | -b {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{a^{2} b + b^{3}} + \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 {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a*b*log(abs(-b*(e^(-x) - e^x) + 2*a))/(a^2*b + b^3) + 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)

________________________________________________________________________________________

Mupad [B]
time = 1.40, size = 95, normalized size = 1.98 \begin {gather*} \frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}{a-b\,1{}\mathrm {i}}-\frac {a\,\ln \left (b^3\,{\mathrm {e}}^{2\,x}-4\,a^2\,b-b^3+8\,a^3\,{\mathrm {e}}^x+2\,a\,b^2\,{\mathrm {e}}^x+4\,a^2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^2+b^2}+\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-b+a\,1{}\mathrm {i}} \end {gather*}

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)*1i)/(a*1i - b) + log(exp(x) + 1i)/(a - b*1i) - (a*log(b^3*exp(2*x) - 4*a^2*b - b^3 + 8*a^3
*exp(x) + 2*a*b^2*exp(x) + 4*a^2*b*exp(2*x)))/(a^2 + b^2)

________________________________________________________________________________________