Optimal. Leaf size=83 \[ -\frac{b^2 \tan ^{-1}(\sinh (x))}{a^3}+\frac{b \sqrt{a^2-b^2} \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a^3}-\frac{b \text{sech}(x)}{a^2}+\frac{\tan ^{-1}(\sinh (x))}{2 a}+\frac{\tanh (x) \text{sech}(x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.237053, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.538, Rules used = {3518, 3110, 3768, 3770, 3104, 3074, 206} \[ -\frac{b^2 \tan ^{-1}(\sinh (x))}{a^3}+\frac{b \sqrt{a^2-b^2} \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a^3}-\frac{b \text{sech}(x)}{a^2}+\frac{\tan ^{-1}(\sinh (x))}{2 a}+\frac{\tanh (x) \text{sech}(x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3110
Rule 3768
Rule 3770
Rule 3104
Rule 3074
Rule 206
Rubi steps
\begin{align*} \int \frac{\text{sech}^3(x)}{a+b \coth (x)} \, dx &=-\left (i \int \frac{\text{sech}^2(x) \tanh (x)}{-i b \cosh (x)-i a \sinh (x)} \, dx\right )\\ &=-\int \left (-\frac{\text{sech}^3(x)}{a}+\frac{i b \text{sech}^2(x)}{a (i b \cosh (x)+i a \sinh (x))}\right ) \, dx\\ &=\frac{\int \text{sech}^3(x) \, dx}{a}-\frac{(i b) \int \frac{\text{sech}^2(x)}{i b \cosh (x)+i a \sinh (x)} \, dx}{a}\\ &=-\frac{b \text{sech}(x)}{a^2}+\frac{\text{sech}(x) \tanh (x)}{2 a}+\frac{\int \text{sech}(x) \, dx}{2 a}-\frac{b^2 \int \text{sech}(x) \, dx}{a^3}-\frac{\left (i b \left (a^2-b^2\right )\right ) \int \frac{1}{i b \cosh (x)+i a \sinh (x)} \, dx}{a^3}\\ &=\frac{\tan ^{-1}(\sinh (x))}{2 a}-\frac{b^2 \tan ^{-1}(\sinh (x))}{a^3}-\frac{b \text{sech}(x)}{a^2}+\frac{\text{sech}(x) \tanh (x)}{2 a}+\frac{\left (b \left (a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a^2-b^2-x^2} \, dx,x,a \cosh (x)+b \sinh (x)\right )}{a^3}\\ &=\frac{\tan ^{-1}(\sinh (x))}{2 a}-\frac{b^2 \tan ^{-1}(\sinh (x))}{a^3}+\frac{b \sqrt{a^2-b^2} \tanh ^{-1}\left (\frac{a \cosh (x)+b \sinh (x)}{\sqrt{a^2-b^2}}\right )}{a^3}-\frac{b \text{sech}(x)}{a^2}+\frac{\text{sech}(x) \tanh (x)}{2 a}\\ \end{align*}
Mathematica [A] time = 0.182099, size = 85, normalized size = 1.02 \[ \frac{2 \left (a^2-2 b^2\right ) \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )+4 b \sqrt{b-a} \sqrt{a+b} \tan ^{-1}\left (\frac{a+b \tanh \left (\frac{x}{2}\right )}{\sqrt{b-a} \sqrt{a+b}}\right )+a \text{sech}(x) (a \tanh (x)-2 b)}{2 a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.047, size = 187, normalized size = 2.3 \begin{align*} -{\frac{1}{a} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{3} \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{2}b}{{a}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{a}\tanh \left ({\frac{x}{2}} \right ) \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-2}}-2\,{\frac{b}{{a}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{a}\arctan \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }-2\,{\frac{\arctan \left ( \tanh \left ( x/2 \right ) \right ){b}^{2}}{{a}^{3}}}-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 ) }+2\,{\frac{{b}^{3}}{{a}^{3}\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 [B] time = 3.13031, size = 2423, normalized size = 29.19 \begin{align*} \text{result too large to display} \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}^{3}{\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.15398, size = 138, normalized size = 1.66 \begin{align*} \frac{{\left (a^{2} - 2 \, b^{2}\right )} \arctan \left (e^{x}\right )}{a^{3}} - \frac{2 \,{\left (a^{2} b - b^{3}\right )} \arctan \left (\frac{a e^{x} + b e^{x}}{\sqrt{-a^{2} + b^{2}}}\right )}{\sqrt{-a^{2} + b^{2}} a^{3}} + \frac{a e^{\left (3 \, x\right )} - 2 \, b e^{\left (3 \, x\right )} - a e^{x} - 2 \, b e^{x}}{a^{2}{\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]