Integrand size = 11, antiderivative size = 50 \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\frac {\arctan (\sinh (x))}{a}+\frac {b \text {arctanh}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}} \]
[Out]
Time = 0.10 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {3599, 3189, 3855, 3153, 212} \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\frac {b \text {arctanh}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}}+\frac {\arctan (\sinh (x))}{a} \]
[In]
[Out]
Rule 212
Rule 3153
Rule 3189
Rule 3599
Rule 3855
Rubi steps \begin{align*} \text {integral}& = -\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 {\arctan (\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 {\arctan (\sinh (x))}{a}+\frac {b \text {arctanh}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{a \sqrt {a^2-b^2}} \\ \end{align*}
Time = 0.24 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.20 \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\frac {2 \left (\arctan \left (\tanh \left (\frac {x}{2}\right )\right )-\frac {b \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} \]
[In]
[Out]
Time = 0.44 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.08
method | result | size |
default | \(-\frac {2 b \arctan \left (\frac {2 b \tanh \left (\frac {x}{2}\right )+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 {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}+\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{a}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{a}\) | \(102\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 200, normalized size of antiderivative = 4.00 \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\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 ] \]
[In]
[Out]
\[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\int \frac {\operatorname {sech}{\left (x \right )}}{a + b \coth {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.96 \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=-\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} \]
[In]
[Out]
Time = 4.15 (sec) , antiderivative size = 164, normalized size of antiderivative = 3.28 \[ \int \frac {\text {sech}(x)}{a+b \coth (x)} \, dx=\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} \]
[In]
[Out]