Optimal. Leaf size=50 \[ \frac{b \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a \sqrt{a^2-b^2}}+\frac{\tan ^{-1}(\sinh (x))}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.138412, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {3518, 3110, 3770, 3074, 206} \[ \frac{b \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a \sqrt{a^2-b^2}}+\frac{\tan ^{-1}(\sinh (x))}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3110
Rule 3770
Rule 3074
Rule 206
Rubi steps
\begin{align*} \int \frac{\text{sech}(x)}{a+b \coth (x)} \, dx &=-\left (i \int \frac{\tanh (x)}{-i b \cosh (x)-i a \sinh (x)} \, dx\right )\\ &=-\int \left (-\frac{\text{sech}(x)}{a}+\frac{i b}{a (i b \cosh (x)+i a \sinh (x))}\right ) \, dx\\ &=\frac{\int \text{sech}(x) \, dx}{a}-\frac{(i b) \int \frac{1}{i b \cosh (x)+i a \sinh (x)} \, dx}{a}\\ &=\frac{\tan ^{-1}(\sinh (x))}{a}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a^2-b^2-x^2} \, dx,x,a \cosh (x)+b \sinh (x)\right )}{a}\\ &=\frac{\tan ^{-1}(\sinh (x))}{a}+\frac{b \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a \sqrt{a^2-b^2}}\\ \end{align*}
Mathematica [A] time = 0.112744, size = 60, normalized size = 1.2 \[ \frac{2 \left (\tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )-\frac{b \tan ^{-1}\left (\frac{a+b \tanh \left (\frac{x}{2}\right )}{\sqrt{b-a} \sqrt{a+b}}\right )}{\sqrt{b-a} \sqrt{a+b}}\right )}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.033, size = 54, normalized size = 1.1 \begin{align*} 2\,{\frac{\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{a}}-2\,{\frac{b}{a\sqrt{-{a}^{2}+{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,\tanh \left ( x/2 \right ) b+2\,a}{\sqrt{-{a}^{2}+{b}^{2}}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.863, size = 564, normalized size = 11.28 \begin{align*} \left [\frac{\sqrt{a^{2} - b^{2}} b \log \left (\frac{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )^{2} + 2 \, \sqrt{a^{2} - b^{2}}{\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} + a - b}{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )^{2} - a + b}\right ) + 2 \,{\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{a^{3} - a b^{2}}, -\frac{2 \,{\left (\sqrt{-a^{2} + b^{2}} b \arctan \left (\frac{\sqrt{-a^{2} + b^{2}}}{{\left (a + b\right )} \cosh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )}\right ) -{\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{a^{3} - a b^{2}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\operatorname{sech}{\left (x \right )}}{a + b \coth{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14499, size = 65, normalized size = 1.3 \begin{align*} -\frac{2 \, b \arctan \left (\frac{a e^{x} + b e^{x}}{\sqrt{-a^{2} + b^{2}}}\right )}{\sqrt{-a^{2} + b^{2}} a} + \frac{2 \, \arctan \left (e^{x}\right )}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]