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

3.3.31.1 Optimal result
3.3.31.2 Mathematica [C] (verified)
3.3.31.3 Rubi [A] (verified)
3.3.31.4 Maple [A] (verified)
3.3.31.5 Fricas [A] (verification not implemented)
3.3.31.6 Sympy [F]
3.3.31.7 Maxima [A] (verification not implemented)
3.3.31.8 Giac [A] (verification not implemented)
3.3.31.9 Mupad [B] (verification not implemented)

3.3.31.1 Optimal result

Integrand size = 11, antiderivative size = 48 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=\frac {b \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} \]

output
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)
 
3.3.31.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.05 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.17 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=\frac {(a-i b) \log (i-\sinh (x))+(a+i b) \log (i+\sinh (x))-2 a \log (a+b \sinh (x))}{2 \left (a^2+b^2\right )} \]

input
Integrate[Tanh[x]/(a + b*Sinh[x]),x]
 
output
((a - I*b)*Log[I - Sinh[x]] + (a + I*b)*Log[I + Sinh[x]] - 2*a*Log[a + b*S 
inh[x]])/(2*(a^2 + b^2))
 
3.3.31.3 Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.12, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.818, Rules used = {3042, 26, 3200, 25, 587, 16, 452, 216, 240}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {i \tan (i x)}{a-i b \sin (i x)}dx\)

\(\Big \downarrow \) 26

\(\displaystyle -i \int \frac {\tan (i x)}{a-i b \sin (i x)}dx\)

\(\Big \downarrow \) 3200

\(\displaystyle -\int -\frac {b \sinh (x)}{(a+b \sinh (x)) \left (\sinh ^2(x) b^2+b^2\right )}d(b \sinh (x))\)

\(\Big \downarrow \) 25

\(\displaystyle \int \frac {b \sinh (x)}{\left (b^2 \sinh ^2(x)+b^2\right ) (a+b \sinh (x))}d(b \sinh (x))\)

\(\Big \downarrow \) 587

\(\displaystyle \frac {\int \frac {b^2+a \sinh (x) b}{\sinh ^2(x) b^2+b^2}d(b \sinh (x))}{a^2+b^2}-\frac {a \int \frac {1}{a+b \sinh (x)}d(b \sinh (x))}{a^2+b^2}\)

\(\Big \downarrow \) 16

\(\displaystyle \frac {\int \frac {b^2+a \sinh (x) b}{\sinh ^2(x) b^2+b^2}d(b \sinh (x))}{a^2+b^2}-\frac {a \log (a+b \sinh (x))}{a^2+b^2}\)

\(\Big \downarrow \) 452

\(\displaystyle \frac {a \int \frac {b \sinh (x)}{\sinh ^2(x) b^2+b^2}d(b \sinh (x))+b^2 \int \frac {1}{\sinh ^2(x) b^2+b^2}d(b \sinh (x))}{a^2+b^2}-\frac {a \log (a+b \sinh (x))}{a^2+b^2}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {a \int \frac {b \sinh (x)}{\sinh ^2(x) b^2+b^2}d(b \sinh (x))+b \arctan (\sinh (x))}{a^2+b^2}-\frac {a \log (a+b \sinh (x))}{a^2+b^2}\)

\(\Big \downarrow \) 240

\(\displaystyle \frac {\frac {1}{2} a \log \left (b^2 \sinh ^2(x)+b^2\right )+b \arctan (\sinh (x))}{a^2+b^2}-\frac {a \log (a+b \sinh (x))}{a^2+b^2}\)

input
Int[Tanh[x]/(a + b*Sinh[x]),x]
 
output
-((a*Log[a + b*Sinh[x]])/(a^2 + b^2)) + (b*ArcTan[Sinh[x]] + (a*Log[b^2 + 
b^2*Sinh[x]^2])/2)/(a^2 + b^2)
 

3.3.31.3.1 Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

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

rule 240
Int[(x_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[Log[RemoveContent[a + b*x 
^2, x]]/(2*b), x] /; FreeQ[{a, b}, x]
 

rule 452
Int[((c_) + (d_.)*(x_))/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[c   Int[1/ 
(a + b*x^2), x], x] + Simp[d   Int[x/(a + b*x^2), x], x] /; FreeQ[{a, b, c, 
 d}, x] && NeQ[b*c^2 + a*d^2, 0]
 

rule 587
Int[(x_.)/(((c_) + (d_.)*(x_))*((a_) + (b_.)*(x_)^2)), x_Symbol] :> Simp[(- 
c)*(d/(b*c^2 + a*d^2))   Int[1/(c + d*x), x], x] + Simp[1/(b*c^2 + a*d^2) 
 Int[(a*d + b*c*x)/(a + b*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c 
^2 + a*d^2, 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3200
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p 
_.), x_Symbol] :> Simp[1/f   Subst[Int[(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]
 
3.3.31.4 Maple [A] (verified)

Time = 0.51 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.52

method result size
default \(-\frac {2 a \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )}{2 a^{2}+2 b^{2}}+\frac {2 a \ln \left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )+4 b \arctan \left (\tanh \left (\frac {x}{2}\right )\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\)

input
int(tanh(x)/(a+b*sinh(x)),x,method=_RETURNVERBOSE)
 
output
-2*a/(2*a^2+2*b^2)*ln(tanh(1/2*x)^2*a-2*b*tanh(1/2*x)-a)+4/(2*a^2+2*b^2)*( 
1/2*a*ln(1+tanh(1/2*x)^2)+b*arctan(tanh(1/2*x)))
 
3.3.31.5 Fricas [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.19 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=\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}} \]

input
integrate(tanh(x)/(a+b*sinh(x)),x, algorithm="fricas")
 
output
(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) - sinh(x))))/(a^2 + b^2)
 
3.3.31.6 Sympy [F]

\[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=\int \frac {\tanh {\left (x \right )}}{a + b \sinh {\left (x \right )}}\, dx \]

input
integrate(tanh(x)/(a+b*sinh(x)),x)
 
output
Integral(tanh(x)/(a + b*sinh(x)), x)
 
3.3.31.7 Maxima [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.38 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=-\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}} \]

input
integrate(tanh(x)/(a+b*sinh(x)),x, algorithm="maxima")
 
output
-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)
 
3.3.31.8 Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.85 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=-\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 )}} \]

input
integrate(tanh(x)/(a+b*sinh(x)),x, algorithm="giac")
 
output
-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)
 
3.3.31.9 Mupad [B] (verification not implemented)

Time = 2.14 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.98 \[ \int \frac {\tanh (x)}{a+b \sinh (x)} \, dx=\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}} \]

input
int(tanh(x)/(a + b*sinh(x)),x)
 
output
(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)