Integrand size = 13, antiderivative size = 62 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3979, 4136, 3855, 4004, 3916, 2738, 211} \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b}+\frac {x}{a}-\frac {\arctan (\sinh (x))}{b} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 3855
Rule 3916
Rule 3979
Rule 4004
Rule 4136
Rubi steps \begin{align*} \text {integral}& = -\int \frac {-1+\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx \\ & = -\frac {\int \text {sech}(x) \, dx}{b}-\frac {\int \frac {-b-a \text {sech}(x)}{a+b \text {sech}(x)} \, dx}{b} \\ & = \frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\left (\frac {a}{b}-\frac {b}{a}\right ) \int \frac {\text {sech}(x)}{a+b \text {sech}(x)} \, dx \\ & = \frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\frac {\left (\frac {a}{b}-\frac {b}{a}\right ) \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{b} \\ & = \frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\frac {\left (2 \left (\frac {a}{b}-\frac {b}{a}\right )\right ) \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} \\ & = \frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \\ \end{align*}
Time = 0.13 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {b x-2 a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )-2 \sqrt {a^2-b^2} \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a b} \]
[In]
[Out]
Time = 0.30 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.35
method | result | size |
default | \(-\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}+\frac {2 \left (a +b \right ) \left (a -b \right ) \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a b \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(84\) |
risch | \(\frac {x}{a}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{b a}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{b a}+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{b}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{b}\) | \(113\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 193, normalized size of antiderivative = 3.11 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\left [\frac {b x - 2 \, a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + \sqrt {-a^{2} + b^{2}} \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 )}{a b}, \frac {b x - 2 \, a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - 2 \, \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cosh \left (x\right ) + a \sinh \left (x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )}{a b}\right ] \]
[In]
[Out]
\[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\tanh ^{2}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.84 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a} - \frac {2 \, \arctan \left (e^{x}\right )}{b} + \frac {2 \, \sqrt {a^{2} - b^{2}} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{a b} \]
[In]
[Out]
Time = 4.47 (sec) , antiderivative size = 273, normalized size of antiderivative = 4.40 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\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 {\ln \left (2\,a\,b^3-2\,a^3\,b+a^3\,\sqrt {b^2-a^2}+a^4\,{\mathrm {e}}^x+4\,b^4\,{\mathrm {e}}^x-2\,a\,b^2\,\sqrt {b^2-a^2}-4\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-5\,a^2\,b^2\,{\mathrm {e}}^x+3\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )\,\sqrt {b^2-a^2}-\ln \left (2\,a\,b^3-2\,a^3\,b-a^3\,\sqrt {b^2-a^2}+a^4\,{\mathrm {e}}^x+4\,b^4\,{\mathrm {e}}^x+2\,a\,b^2\,\sqrt {b^2-a^2}+4\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-5\,a^2\,b^2\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )\,\sqrt {b^2-a^2}+b\,x}{a\,b} \]
[In]
[Out]