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 (\sinh (x))}{a}-\frac {B \log (a+b \sinh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, 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 = {4486, 2739,
632, 212, 2800, 36, 29, 31} \begin {gather*} -\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} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 212
Rule 632
Rule 2739
Rule 2800
Rule 4486
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) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )+B \text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \sinh (x)\right )\\ &=-\left ((4 A) \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 )\right )+\frac {B \text {Subst}\left (\int \frac {1}{x} \, dx,x,b \sinh (x)\right )}{a}-\frac {B \text {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.13, size = 65, normalized size = 1.08 \begin {gather*} \frac {2 A \text {ArcTan}\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} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.63, size = 76, normalized size = 1.27
method | result | size |
default | \(\frac {-B \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )+\frac {2 A a \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}}{a}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a}\) | \(76\) |
risch | \(-\frac {2 x B}{a}-\frac {2 x \,a^{3} B}{-a^{4}-a^{2} b^{2}}-\frac {2 x B a \,b^{2}}{-a^{4}-a^{2} b^{2}}+\frac {B \ln \left ({\mathrm e}^{2 x}-1\right )}{a}-\frac {a \ln \left ({\mathrm e}^{x}+\frac {a^{2} A -\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) B}{a^{2}+b^{2}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a^{2} A -\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) B \,b^{2}}{\left (a^{2}+b^{2}\right ) a}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a^{2} A -\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) \sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{\left (a^{2}+b^{2}\right ) a}-\frac {a \ln \left ({\mathrm e}^{x}+\frac {a^{2} A +\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) B}{a^{2}+b^{2}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a^{2} A +\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) B \,b^{2}}{\left (a^{2}+b^{2}\right ) a}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a^{2} A +\sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{A a b}\right ) \sqrt {A^{2} a^{4}+A^{2} a^{2} b^{2}}}{\left (a^{2}+b^{2}\right ) a}\) | \(443\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 106, normalized size = 1.77 \begin {gather*} -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}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 183 vs.
\(2 (56) = 112\).
time = 0.43, size = 183, normalized size = 3.05 \begin {gather*} \frac {\sqrt {a^{2} + b^{2}} A a \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 (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + {\left (B a^{2} + B b^{2}\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{3} + a b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \coth {\left (x \right )}}{a + b \sinh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 102, normalized size = 1.70 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.21, size = 164, normalized size = 2.73 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________