Integrand size = 15, antiderivative size = 60 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=-\frac {2 A \text {arctanh}\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]
Time = 0.11 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.533, Rules used = {4486, 2739, 632, 212, 2800, 36, 29, 31} \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=-\frac {2 A \text {arctanh}\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} \]
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 212
Rule 632
Rule 2739
Rule 2800
Rule 4486
Rubi steps \begin{align*} \text {integral}& = \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 \text {arctanh}\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*}
Time = 1.40 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.08 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=\frac {2 A \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} \]
[In]
[Out]
Time = 0.88 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.22
method | result | size |
parts | \(\frac {2 A \,\operatorname {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}}}+\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a}-\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )}{a}\) | \(73\) |
default | \(\frac {-B \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )+\frac {2 A a \,\operatorname {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\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 183 vs. \(2 (56) = 112\).
Time = 0.29 (sec) , antiderivative size = 183, normalized size of antiderivative = 3.05 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=\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}} \]
[In]
[Out]
\[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=\int \frac {A + B \coth {\left (x \right )}}{a + b \sinh {\left (x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.77 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=-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}}} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.70 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=\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} \]
[In]
[Out]
Time = 12.32 (sec) , antiderivative size = 164, normalized size of antiderivative = 2.73 \[ \int \frac {A+B \coth (x)}{a+b \sinh (x)} \, dx=\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} \]
[In]
[Out]