3.3.52 \(\int \frac {A+B \text {csch}(x)}{a+b \sinh (x)} \, dx\) [252]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {2907, 3080, 3855, 2739, 632, 212} \begin {gather*} -\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2}}-\frac {B \tanh ^{-1}(\cosh (x))}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 212

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

Rule 632

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 2739

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 2907

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> In
t[(a + b*Sin[e + f*x])^m*((d + c*Sin[e + f*x])^n/Sin[e + f*x]^n), x] /; FreeQ[{a, b, c, d, e, f, m}, x] && Int
egerQ[n]

Rule 3080

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)])), x_Symbol] :> Dist[(A*b - a*B)/(b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] + Dist[(B*c - A
*d)/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {A+B \text {csch}(x)}{a+b \sinh (x)} \, dx &=-\left (i \int \frac {\text {csch}(x) (i B+i A \sinh (x))}{a+b \sinh (x)} \, dx\right )\\ &=\frac {B \int \text {csch}(x) \, dx}{a}+\frac {(a A-b B) \int \frac {1}{a+b \sinh (x)} \, dx}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}+\frac {(2 (a A-b B)) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}-\frac {(4 (a A-b B)) \text {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 )}{a}\\ &=-\frac {B \tanh ^{-1}(\cosh (x))}{a}-\frac {2 (a A-b B) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 67, normalized size = 1.16 \begin {gather*} \frac {\frac {2 (a A-b B) \text {ArcTan}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+B \log \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.56, size = 58, normalized size = 1.00

method result size
default \(\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a}-\frac {\left (-2 A a +2 B b \right ) \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}}}\) \(58\)
risch \(\frac {B \ln \left ({\mathrm e}^{x}-1\right )}{a}-\frac {B \ln \left ({\mathrm e}^{x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) A}{\sqrt {a^{2}+b^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) B b}{\sqrt {a^{2}+b^{2}}\, a}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) A}{\sqrt {a^{2}+b^{2}}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) B b}{\sqrt {a^{2}+b^{2}}\, a}\) \(225\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*csch(x))/(a+b*sinh(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (54) = 108\).
time = 0.49, size = 141, normalized size = 2.43 \begin {gather*} -B {\left (\frac {b \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}} 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}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (54) = 108\).
time = 0.69, size = 172, normalized size = 2.97 \begin {gather*} -\frac {{\left (A a - B b\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) - b}\right ) + {\left (B a^{2} + B b^{2}\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (B a^{2} + B b^{2}\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{3} + a b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((A*a - B*b)*sqrt(a^2 + b^2)*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(cosh(x) + sinh(x) + 1) - (B*a^2 + B*b^2)*log(cosh(x) + si
nh(x) - 1))/(a^3 + a*b^2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 2.18, size = 539, normalized size = 9.29 \begin {gather*} \frac {B\,\ln \left ({\mathrm {e}}^x-1\right )}{a}-\frac {B\,\ln \left ({\mathrm {e}}^x+1\right )}{a}-\frac {\ln \left (\frac {\left (A\,a-B\,b\right )\,\left (\frac {32\,\left (A^2\,a^2\,b-2\,A\,B\,a\,b^2-4\,{\mathrm {e}}^x\,B^2\,a^3+2\,B^2\,a^2\,b-3\,{\mathrm {e}}^x\,B^2\,a\,b^2+2\,B^2\,b^3\right )}{b^5}-\frac {\left (A\,a-B\,b\right )\,\left (\frac {32\,a^2\,\left (2\,B\,b^2+4\,A\,a^2\,{\mathrm {e}}^x+A\,b^2\,{\mathrm {e}}^x-2\,A\,a\,b-3\,B\,a\,b\,{\mathrm {e}}^x\right )}{b^5}+\frac {32\,a\,\left (A\,a-B\,b\right )\,\left (-4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2+2\,b^3\right )}{b^5\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}+\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (A\,b\,{\mathrm {e}}^x-2\,B\,b+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}\right )\,\left (A\,a-B\,b\right )\,\sqrt {a^2+b^2}}{a^3+a\,b^2}+\frac {\ln \left (\frac {32\,B\,\left (A\,a-B\,b\right )\,\left (A\,b\,{\mathrm {e}}^x-2\,B\,b+4\,B\,a\,{\mathrm {e}}^x\right )}{b^5}-\frac {\left (A\,a-B\,b\right )\,\left (\frac {32\,\left (A^2\,a^2\,b-2\,A\,B\,a\,b^2-4\,{\mathrm {e}}^x\,B^2\,a^3+2\,B^2\,a^2\,b-3\,{\mathrm {e}}^x\,B^2\,a\,b^2+2\,B^2\,b^3\right )}{b^5}+\frac {\left (A\,a-B\,b\right )\,\left (\frac {32\,a^2\,\left (2\,B\,b^2+4\,A\,a^2\,{\mathrm {e}}^x+A\,b^2\,{\mathrm {e}}^x-2\,A\,a\,b-3\,B\,a\,b\,{\mathrm {e}}^x\right )}{b^5}-\frac {32\,a\,\left (A\,a-B\,b\right )\,\left (-4\,{\mathrm {e}}^x\,a^3+3\,a^2\,b-3\,{\mathrm {e}}^x\,a\,b^2+2\,b^3\right )}{b^5\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )}{a\,\sqrt {a^2+b^2}}\right )\,\left (A\,a-B\,b\right )\,\sqrt {a^2+b^2}}{a^3+a\,b^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(B*log(exp(x) - 1))/a - (B*log(exp(x) + 1))/a - (log(((A*a - B*b)*((32*(2*B^2*b^3 + A^2*a^2*b + 2*B^2*a^2*b -
4*B^2*a^3*exp(x) - 3*B^2*a*b^2*exp(x) - 2*A*B*a*b^2))/b^5 - ((A*a - B*b)*((32*a^2*(2*B*b^2 + 4*A*a^2*exp(x) +
A*b^2*exp(x) - 2*A*a*b - 3*B*a*b*exp(x)))/b^5 + (32*a*(A*a - B*b)*(3*a^2*b + 2*b^3 - 4*a^3*exp(x) - 3*a*b^2*ex
p(x)))/(b^5*(a^2 + b^2)^(1/2))))/(a*(a^2 + b^2)^(1/2))))/(a*(a^2 + b^2)^(1/2)) + (32*B*(A*a - B*b)*(A*b*exp(x)
 - 2*B*b + 4*B*a*exp(x)))/b^5)*(A*a - B*b)*(a^2 + b^2)^(1/2))/(a*b^2 + a^3) + (log((32*B*(A*a - B*b)*(A*b*exp(
x) - 2*B*b + 4*B*a*exp(x)))/b^5 - ((A*a - B*b)*((32*(2*B^2*b^3 + A^2*a^2*b + 2*B^2*a^2*b - 4*B^2*a^3*exp(x) -
3*B^2*a*b^2*exp(x) - 2*A*B*a*b^2))/b^5 + ((A*a - B*b)*((32*a^2*(2*B*b^2 + 4*A*a^2*exp(x) + A*b^2*exp(x) - 2*A*
a*b - 3*B*a*b*exp(x)))/b^5 - (32*a*(A*a - B*b)*(3*a^2*b + 2*b^3 - 4*a^3*exp(x) - 3*a*b^2*exp(x)))/(b^5*(a^2 +
b^2)^(1/2))))/(a*(a^2 + b^2)^(1/2))))/(a*(a^2 + b^2)^(1/2)))*(A*a - B*b)*(a^2 + b^2)^(1/2))/(a*b^2 + a^3)

________________________________________________________________________________________