Optimal. Leaf size=50 \[ \frac {\text {ArcTan}(\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}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 50, normalized size of antiderivative = 1.00, 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 = {3599, 3189,
3855, 3153, 212} \begin {gather*} \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 {\text {ArcTan}(\sinh (x))}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 3153
Rule 3189
Rule 3599
Rule 3855
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 \text {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.08, size = 60, normalized size = 1.20 \begin {gather*} \frac {2 \left (\text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-\frac {b \text {ArcTan}\left (\frac {a+b \tanh \left (\frac {x}{2}\right )}{\sqrt {-a+b} \sqrt {a+b}}\right )}{\sqrt {-a+b} \sqrt {a+b}}\right )}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.80, size = 54, normalized size = 1.08
method | result | size |
default | \(-\frac {2 b \arctan \left (\frac {2 \tanh \left (\frac {x}{2}\right ) b +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a \sqrt {-a^{2}+b^{2}}}+\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a}\) | \(54\) |
risch | \(\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{a}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{a}+\frac {b \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, a}-\frac {b \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, a}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 200, normalized size = 4.00 \begin {gather*} \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 {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 {\operatorname {sech}{\left (x \right )}}{a + b \coth {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 48, normalized size = 0.96 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.22, size = 164, normalized size = 3.28 \begin {gather*} \frac {b\,\ln \left (32\,a\,b^2\,{\mathrm {e}}^x+32\,a^2\,b\,{\mathrm {e}}^x+32\,a\,b\,\sqrt {a^2-b^2}\right )}{a\,\sqrt {a^2-b^2}}-\frac {b\,\ln \left (32\,a\,b^2\,{\mathrm {e}}^x+32\,a^2\,b\,{\mathrm {e}}^x-32\,a\,b\,\sqrt {a^2-b^2}\right )}{a\,\sqrt {a^2-b^2}}+\frac {\ln \left (32\,a\,b\,{\mathrm {e}}^x-32\,a^2\,{\mathrm {e}}^x+a\,b\,32{}\mathrm {i}-a^2\,32{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}-\frac {\ln \left (32\,a^2\,{\mathrm {e}}^x-32\,a\,b\,{\mathrm {e}}^x+a\,b\,32{}\mathrm {i}-a^2\,32{}\mathrm {i}\right )\,1{}\mathrm {i}}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________