Integrand size = 15, antiderivative size = 89 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\frac {a B \arctan (\sinh (x))}{a^2+b^2}-\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 B \log (\cosh (x))}{a^2+b^2}+\frac {b B \log (a+b \sinh (x))}{a^2+b^2} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.733, Rules used = {4311, 4486, 2739, 632, 212, 2747, 720, 31, 649, 210, 266} \[ \int \frac {A+B \text {sech}(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 {a B \arctan (\sinh (x))}{a^2+b^2}+\frac {b B \log (a+b \sinh (x))}{a^2+b^2}-\frac {b B \log (\cosh (x))}{a^2+b^2} \]
[In]
[Out]
Rule 31
Rule 210
Rule 212
Rule 266
Rule 632
Rule 649
Rule 720
Rule 2739
Rule 2747
Rule 4311
Rule 4486
Rubi steps \begin{align*} \text {integral}& = \int \frac {(B+A \cosh (x)) \text {sech}(x)}{a+b \sinh (x)} \, dx \\ & = \int \left (\frac {A}{a+b \sinh (x)}+\frac {B \text {sech}(x)}{a+b \sinh (x)}\right ) \, dx \\ & = A \int \frac {1}{a+b \sinh (x)} \, dx+B \int \frac {\text {sech}(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 B) \text {Subst}\left (\int \frac {1}{(a+x) \left (-b^2-x^2\right )} \, 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 B) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sinh (x)\right )}{a^2+b^2}+\frac {(b B) \text {Subst}\left (\int \frac {-a+x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2} \\ & = -\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 B \log (a+b \sinh (x))}{a^2+b^2}+\frac {(b B) \text {Subst}\left (\int \frac {x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}-\frac {(a b B) \text {Subst}\left (\int \frac {1}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2} \\ & = \frac {a B \arctan (\sinh (x))}{a^2+b^2}-\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 B \log (\cosh (x))}{a^2+b^2}+\frac {b B \log (a+b \sinh (x))}{a^2+b^2} \\ \end{align*}
Time = 0.27 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.04 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\frac {2 a B \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a^2+b^2}+\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 B (\log (\cosh (x))-\log (a+b \sinh (x)))}{a^2+b^2} \]
[In]
[Out]
Time = 1.88 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.15
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}}}+B \left (\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )}{a^{2}+b^{2}}+\frac {-b \ln \left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )+2 a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{2}+b^{2}}\right )\) | \(102\) |
default | \(\frac {b B \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -2 b \tanh \left (\frac {x}{2}\right )-a \right )-\frac {2 \left (-a^{2} A -A \,b^{2}\right ) \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^{2}+b^{2}}+\frac {2 B \left (-\frac {b \ln \left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )}{2}+a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )\right )}{a^{2}+b^{2}}\) | \(117\) |
risch | \(\frac {2 x b B}{a^{2}+b^{2}}+\frac {2 x B \,a^{2} b}{-a^{4}-2 a^{2} b^{2}-b^{4}}+\frac {2 x B \,b^{3}}{-a^{4}-2 a^{2} b^{2}-b^{4}}+\frac {i B \ln \left ({\mathrm e}^{x}+i\right ) a}{a^{2}+b^{2}}-\frac {B \ln \left ({\mathrm e}^{x}+i\right ) b}{a^{2}+b^{2}}-\frac {i B \ln \left ({\mathrm e}^{x}-i\right ) a}{a^{2}+b^{2}}-\frac {B \ln \left ({\mathrm e}^{x}-i\right ) b}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a -\sqrt {A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) B b}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a -\sqrt {A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) \sqrt {A^{2} a^{2}+A^{2} b^{2}}}{a^{2}+b^{2}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a +\sqrt {A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) B b}{a^{2}+b^{2}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {A a +\sqrt {A^{2} a^{2}+A^{2} b^{2}}}{A b}\right ) \sqrt {A^{2} a^{2}+A^{2} b^{2}}}{a^{2}+b^{2}}\) | \(362\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (85) = 170\).
Time = 1.89 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.93 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\frac {2 \, B a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + B b \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - B b \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + \sqrt {a^{2} + b^{2}} 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 )}{a^{2} + b^{2}} \]
[In]
[Out]
\[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\int \frac {A + B \operatorname {sech}{\left (x \right )}}{a + b \sinh {\left (x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.40 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=-B {\left (\frac {2 \, a \arctan \left (e^{\left (-x\right )}\right )}{a^{2} + b^{2}} - \frac {b \log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a^{2} + b^{2}} + \frac {b \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{2} + b^{2}}\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.28 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.38 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\frac {2 \, B a \arctan \left (e^{x}\right )}{a^{2} + b^{2}} - \frac {B b \log \left (e^{\left (2 \, x\right )} + 1\right )}{a^{2} + b^{2}} + \frac {B b \log \left ({\left | b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b \right |}\right )}{a^{2} + b^{2}} + \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}}} \]
[In]
[Out]
Time = 11.67 (sec) , antiderivative size = 864, normalized size of antiderivative = 9.71 \[ \int \frac {A+B \text {sech}(x)}{a+b \sinh (x)} \, dx=\frac {\ln \left (\frac {\left (A\,\sqrt {{\left (a^2+b^2\right )}^3}+B\,b^3+B\,a^2\,b\right )\,\left (b^3\,\left (32\,A^2-96\,{\mathrm {e}}^x\,A\,B+64\,B^2\right )-128\,A^2\,{\mathrm {e}}^x\,\sqrt {{\left (a^2+b^2\right )}^3}-a\,b^2\,\left (96\,{\mathrm {e}}^x\,A^2-192\,A\,B+128\,{\mathrm {e}}^x\,B^2\right )-128\,a^3\,{\mathrm {e}}^x\,\left (A^2+B^2\right )+a^2\,b\,\left (64\,A^2-384\,{\mathrm {e}}^x\,A\,B+64\,B^2\right )+\frac {32\,A\,b^6\,\left (2\,B+3\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^4\,b^2\,\left (5\,B+3\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^2\,b^4\,\left (7\,B+6\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^3\,b^3\,\left (4\,A-19\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {64\,A\,a\,b^5\,\left (A-4\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^5\,b\,\left (2\,A-11\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}\right )}{b^5\,{\left (a^2+b^2\right )}^2}-\frac {32\,B\,\left ({\mathrm {e}}^x\,A^2\,a\,b-A^2\,b^2+4\,{\mathrm {e}}^x\,A\,B\,a^2-2\,A\,B\,a\,b+{\mathrm {e}}^x\,A\,B\,b^2-4\,{\mathrm {e}}^x\,B^2\,a\,b+2\,B^2\,b^2\right )}{b^5}\right )\,\left (A\,\sqrt {{\left (a^2+b^2\right )}^3}+B\,b^3+B\,a^2\,b\right )}{a^4+2\,a^2\,b^2+b^4}-\frac {B\,\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )}{b+a\,1{}\mathrm {i}}+\frac {\ln \left (-\frac {32\,B\,\left ({\mathrm {e}}^x\,A^2\,a\,b-A^2\,b^2+4\,{\mathrm {e}}^x\,A\,B\,a^2-2\,A\,B\,a\,b+{\mathrm {e}}^x\,A\,B\,b^2-4\,{\mathrm {e}}^x\,B^2\,a\,b+2\,B^2\,b^2\right )}{b^5}-\frac {\left (B\,b^3-A\,\sqrt {{\left (a^2+b^2\right )}^3}+B\,a^2\,b\right )\,\left (a\,b^2\,\left (96\,{\mathrm {e}}^x\,A^2-192\,A\,B+128\,{\mathrm {e}}^x\,B^2\right )-128\,A^2\,{\mathrm {e}}^x\,\sqrt {{\left (a^2+b^2\right )}^3}-b^3\,\left (32\,A^2-96\,{\mathrm {e}}^x\,A\,B+64\,B^2\right )+128\,a^3\,{\mathrm {e}}^x\,\left (A^2+B^2\right )-a^2\,b\,\left (64\,A^2-384\,{\mathrm {e}}^x\,A\,B+64\,B^2\right )+\frac {32\,A\,b^6\,\left (2\,B+3\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^4\,b^2\,\left (5\,B+3\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^2\,b^4\,\left (7\,B+6\,A\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^3\,b^3\,\left (4\,A-19\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {64\,A\,a\,b^5\,\left (A-4\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}+\frac {32\,A\,a^5\,b\,\left (2\,A-11\,B\,{\mathrm {e}}^x\right )}{\sqrt {{\left (a^2+b^2\right )}^3}}\right )}{b^5\,{\left (a^2+b^2\right )}^2}\right )\,\left (B\,b^3-A\,\sqrt {{\left (a^2+b^2\right )}^3}+B\,a^2\,b\right )}{a^4+2\,a^2\,b^2+b^4}-\frac {B\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}}{a+b\,1{}\mathrm {i}} \]
[In]
[Out]