Optimal. Leaf size=64 \[ -\frac {a \text {ArcTan}(\sinh (x))}{b^2}+\frac {2 a^2 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b}}+\frac {\tanh (x)}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3875, 3874,
3855, 3916, 2738, 211} \begin {gather*} \frac {2 a^2 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b^2 \sqrt {a-b} \sqrt {a+b}}-\frac {a \text {ArcTan}(\sinh (x))}{b^2}+\frac {\tanh (x)}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 2738
Rule 3855
Rule 3874
Rule 3875
Rule 3916
Rubi steps
\begin {align*} \int \frac {\text {sech}^3(x)}{a+b \text {sech}(x)} \, dx &=\frac {\tanh (x)}{b}-\frac {a \int \frac {\text {sech}^2(x)}{a+b \text {sech}(x)} \, dx}{b}\\ &=\frac {\tanh (x)}{b}-\frac {a \int \text {sech}(x) \, dx}{b^2}+\frac {a^2 \int \frac {\text {sech}(x)}{a+b \text {sech}(x)} \, dx}{b^2}\\ &=-\frac {a \tan ^{-1}(\sinh (x))}{b^2}+\frac {\tanh (x)}{b}+\frac {a^2 \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{b^3}\\ &=-\frac {a \tan ^{-1}(\sinh (x))}{b^2}+\frac {\tanh (x)}{b}+\frac {\left (2 a^2\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^3}\\ &=-\frac {a \tan ^{-1}(\sinh (x))}{b^2}+\frac {2 a^2 \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b}}+\frac {\tanh (x)}{b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 63, normalized size = 0.98 \begin {gather*} \frac {-2 a \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-\frac {2 a^2 \text {ArcTan}\left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+b \tanh (x)}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.60, size = 73, normalized size = 1.14
method | result | size |
default | \(\frac {2 a^{2} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {2 \left (-\frac {b \tanh \left (\frac {x}{2}\right )}{\tanh ^{2}\left (\frac {x}{2}\right )+1}+a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )\right )}{b^{2}}\) | \(73\) |
risch | \(-\frac {2}{b \left (1+{\mathrm e}^{2 x}\right )}-\frac {a^{2} \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^{2}}+\frac {a^{2} \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^{2}}+\frac {i a \ln \left ({\mathrm e}^{x}-i\right )}{b^{2}}-\frac {i a \ln \left ({\mathrm e}^{x}+i\right )}{b^{2}}\) | \(160\) |
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 [B] Leaf count of result is larger than twice the leaf count of optimal. 211 vs.
\(2 (54) = 108\).
time = 0.41, size = 504, normalized size = 7.88 \begin {gather*} \left [-\frac {2 \, a^{2} b - 2 \, b^{3} + {\left (a^{2} \cosh \left (x\right )^{2} + 2 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a^{2} \sinh \left (x\right )^{2} + a^{2}\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 ) + 2 \, {\left (a^{3} - a b^{2} + {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{a^{2} b^{2} - b^{4} + {\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{2} b^{2} - b^{4}\right )} \sinh \left (x\right )^{2}}, -\frac {2 \, {\left (a^{2} b - b^{3} + {\left (a^{2} \cosh \left (x\right )^{2} + 2 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a^{2} \sinh \left (x\right )^{2} + a^{2}\right )} \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 ) + {\left (a^{3} - a b^{2} + {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{a^{2} b^{2} - b^{4} + {\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} b^{2} - b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{2} b^{2} - b^{4}\right )} \sinh \left (x\right )^{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}^{3}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 61, normalized size = 0.95 \begin {gather*} \frac {2 \, a^{2} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} b^{2}} - \frac {2 \, a \arctan \left (e^{x}\right )}{b^{2}} - \frac {2}{b {\left (e^{\left (2 \, x\right )} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.88, size = 294, normalized size = 4.59 \begin {gather*} \frac {a^2\,\ln \left (64\,a^3\,b-64\,a\,b^3+32\,a^3\,\sqrt {b^2-a^2}-32\,a^4\,{\mathrm {e}}^x-128\,b^4\,{\mathrm {e}}^x-64\,a\,b^2\,\sqrt {b^2-a^2}-128\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+160\,a^2\,b^2\,{\mathrm {e}}^x+96\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^2\,\sqrt {b^2-a^2}}+\frac {a\,\left (\ln \left (32\,{\mathrm {e}}^x-32{}\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left (32\,{\mathrm {e}}^x+32{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{b^2}-\frac {2}{b+b\,{\mathrm {e}}^{2\,x}}-\frac {a^2\,\ln \left (64\,a\,b^3-64\,a^3\,b+32\,a^3\,\sqrt {b^2-a^2}+32\,a^4\,{\mathrm {e}}^x+128\,b^4\,{\mathrm {e}}^x-64\,a\,b^2\,\sqrt {b^2-a^2}-128\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-160\,a^2\,b^2\,{\mathrm {e}}^x+96\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^2\,\sqrt {b^2-a^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________