Integrand size = 13, antiderivative size = 54 \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\frac {\arctan (\sinh (x))}{b}-\frac {2 a \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b}} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3874, 3855, 3916, 2738, 211} \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\frac {\arctan (\sinh (x))}{b}-\frac {2 a \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b \sqrt {a-b} \sqrt {a+b}} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 3855
Rule 3874
Rule 3916
Rubi steps \begin{align*} \text {integral}& = \frac {\int \text {sech}(x) \, dx}{b}-\frac {a \int \frac {\text {sech}(x)}{a+b \text {sech}(x)} \, dx}{b} \\ & = \frac {\arctan (\sinh (x))}{b}-\frac {a \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{b^2} \\ & = \frac {\arctan (\sinh (x))}{b}-\frac {(2 a) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}-\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2} \\ & = \frac {\arctan (\sinh (x))}{b}-\frac {2 a \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b}} \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00 \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\frac {2 \left (\arctan \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {a \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}\right )}{b} \]
[In]
[Out]
Time = 0.23 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.94
method | result | size |
default | \(-\frac {2 a \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b}\) | \(51\) |
risch | \(-\frac {a \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, b}+\frac {a \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, b}+\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{b}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{b}\) | \(141\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 219, normalized size of antiderivative = 4.06 \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\left [-\frac {\sqrt {-a^{2} + b^{2}} a \log \left (\frac {a^{2} \cosh \left (x\right )^{2} + a^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) - a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + b\right )}}{a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) + 2 \, {\left (a \cosh \left (x\right ) + b\right )} \sinh \left (x\right ) + a}\right ) - 2 \, {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{a^{2} b - b^{3}}, \frac {2 \, {\left (\sqrt {a^{2} - b^{2}} a \arctan \left (-\frac {a \cosh \left (x\right ) + a \sinh \left (x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right ) + {\left (a^{2} - b^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{a^{2} b - b^{3}}\right ] \]
[In]
[Out]
\[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\operatorname {sech}^{2}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.83 \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=-\frac {2 \, a \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} b} + \frac {2 \, \arctan \left (e^{x}\right )}{b} \]
[In]
[Out]
Time = 4.44 (sec) , antiderivative size = 286, normalized size of antiderivative = 5.30 \[ \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx=\frac {a\,\ln \left (64\,a\,b^4-64\,a^3\,b^2+128\,b^5\,{\mathrm {e}}^x-64\,a\,b^3\,\sqrt {b^2-a^2}+32\,a^3\,b\,\sqrt {b^2-a^2}+32\,a^4\,b\,{\mathrm {e}}^x-128\,b^4\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-160\,a^2\,b^3\,{\mathrm {e}}^x+96\,a^2\,b^2\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b\,\sqrt {b^2-a^2}}-\frac {\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{b}-\frac {a\,\ln \left (64\,a\,b^4-64\,a^3\,b^2+128\,b^5\,{\mathrm {e}}^x+64\,a\,b^3\,\sqrt {b^2-a^2}-32\,a^3\,b\,\sqrt {b^2-a^2}+32\,a^4\,b\,{\mathrm {e}}^x+128\,b^4\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-160\,a^2\,b^3\,{\mathrm {e}}^x-96\,a^2\,b^2\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b\,\sqrt {b^2-a^2}} \]
[In]
[Out]