3.250 \(\int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx\)

Optimal. Leaf size=60 \[ -\frac {2 A \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}-\frac {B \log (a+b \sinh (x))}{a}+\frac {B \log (\sinh (x))}{a} \]

[Out]

B*ln(sinh(x))/a-B*ln(a+b*sinh(x))/a-2*A*arctanh((b-a*tanh(1/2*x))/(a^2+b^2)^(1/2))/(a^2+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.533, Rules used = {4401, 2660, 618, 206, 2721, 36, 29, 31} \[ -\frac {2 A \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}-\frac {B \log (a+b \sinh (x))}{a}+\frac {B \log (\sinh (x))}{a} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Coth[x])/(a + b*Sinh[x]),x]

[Out]

(-2*A*ArcTanh[(b - a*Tanh[x/2])/Sqrt[a^2 + b^2]])/Sqrt[a^2 + b^2] + (B*Log[Sinh[x]])/a - (B*Log[a + b*Sinh[x]]
)/a

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

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

Rule 36

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

Rule 206

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

Rule 618

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

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2721

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]

Rule 4401

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.17, size = 65, normalized size = 1.08 \[ \frac {2 A \tan ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+\frac {B (\log (\sinh (x))-\log (a+b \sinh (x)))}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Coth[x])/(a + b*Sinh[x]),x]

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 1.63, size = 183, normalized size = 3.05 \[ \frac {\sqrt {a^{2} + b^{2}} A a \log \left (\frac {b^{2} \cosh \relax (x)^{2} + b^{2} \sinh \relax (x)^{2} + 2 \, a b \cosh \relax (x) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \relax (x) + a b\right )} \sinh \relax (x) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \relax (x) + b \sinh \relax (x) + a\right )}}{b \cosh \relax (x)^{2} + b \sinh \relax (x)^{2} + 2 \, a \cosh \relax (x) + 2 \, {\left (b \cosh \relax (x) + a\right )} \sinh \relax (x) - b}\right ) - {\left (B a^{2} + B b^{2}\right )} \log \left (\frac {2 \, {\left (b \sinh \relax (x) + a\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + {\left (B a^{2} + B b^{2}\right )} \log \left (\frac {2 \, \sinh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right )}{a^{3} + a b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*coth(x))/(a+b*sinh(x)),x, algorithm="fricas")

[Out]

(sqrt(a^2 + b^2)*A*a*log((b^2*cosh(x)^2 + b^2*sinh(x)^2 + 2*a*b*cosh(x) + 2*a^2 + b^2 + 2*(b^2*cosh(x) + a*b)*
sinh(x) - 2*sqrt(a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a))/(b*cosh(x)^2 + b*sinh(x)^2 + 2*a*cosh(x) + 2*(b*cosh(
x) + a)*sinh(x) - b)) - (B*a^2 + B*b^2)*log(2*(b*sinh(x) + a)/(cosh(x) - sinh(x))) + (B*a^2 + B*b^2)*log(2*sin
h(x)/(cosh(x) - sinh(x))))/(a^3 + a*b^2)

________________________________________________________________________________________

giac [A]  time = 0.36, size = 102, normalized size = 1.70 \[ \frac {A \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}}} + \frac {B \log \left (e^{x} + 1\right )}{a} - \frac {B \log \left ({\left | b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b \right |}\right )}{a} + \frac {B \log \left ({\left | e^{x} - 1 \right |}\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*coth(x))/(a+b*sinh(x)),x, algorithm="giac")

[Out]

A*log(abs(2*b*e^x + 2*a - 2*sqrt(a^2 + b^2))/abs(2*b*e^x + 2*a + 2*sqrt(a^2 + b^2)))/sqrt(a^2 + b^2) + B*log(e
^x + 1)/a - B*log(abs(b*e^(2*x) + 2*a*e^x - b))/a + B*log(abs(e^x - 1))/a

________________________________________________________________________________________

maple [A]  time = 0.06, size = 73, normalized size = 1.22 \[ -\frac {B \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 \tanh \left (\frac {x}{2}\right ) b -a \right )}{a}+\frac {2 \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right ) A}{\sqrt {a^{2}+b^{2}}}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*coth(x))/(a+b*sinh(x)),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.48, size = 106, normalized size = 1.77 \[ -B {\left (\frac {\log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a} - \frac {\log \left (e^{\left (-x\right )} + 1\right )}{a} - \frac {\log \left (e^{\left (-x\right )} - 1\right )}{a}\right )} + \frac {A \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*coth(x))/(a+b*sinh(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 11.21, size = 164, normalized size = 2.73 \[ \frac {B\,\ln \left (16\,B^2\,a^2+16\,B^2\,b^2-16\,B^2\,a^2\,{\mathrm {e}}^{2\,x}-16\,B^2\,b^2\,{\mathrm {e}}^{2\,x}\right )}{a}-\frac {2\,\mathrm {atan}\left (\frac {A^2\,b^2\,{\mathrm {e}}^x\,\sqrt {-a^2-b^2}+A^2\,a\,b\,\sqrt {-a^2-b^2}}{A\,b\,\sqrt {A^2}\,\left (a^2+b^2\right )}\right )\,\sqrt {A^2}}{\sqrt {-a^2-b^2}}-\frac {B\,\ln \left (32\,B^2\,a\,{\mathrm {e}}^x-16\,B^2\,b+16\,B^2\,b\,{\mathrm {e}}^{2\,x}\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*coth(x))/(a + b*sinh(x)),x)

[Out]

(B*log(16*B^2*a^2 + 16*B^2*b^2 - 16*B^2*a^2*exp(2*x) - 16*B^2*b^2*exp(2*x)))/a - (2*atan((A^2*b^2*exp(x)*(- a^
2 - b^2)^(1/2) + A^2*a*b*(- a^2 - b^2)^(1/2))/(A*b*(A^2)^(1/2)*(a^2 + b^2)))*(A^2)^(1/2))/(- a^2 - b^2)^(1/2)
- (B*log(32*B^2*a*exp(x) - 16*B^2*b + 16*B^2*b*exp(2*x)))/a

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {A + B \coth {\relax (x )}}{a + b \sinh {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*coth(x))/(a+b*sinh(x)),x)

[Out]

Integral((A + B*coth(x))/(a + b*sinh(x)), x)

________________________________________________________________________________________