Optimal. Leaf size=87 \[ \frac {\left (2 a^2+b^2\right ) \text {ArcTan}(\sinh (x))}{2 b^3}-\frac {2 a^3 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^3 \sqrt {a+b}}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3936, 4167,
4083, 3855, 3916, 2738, 211} \begin {gather*} -\frac {2 a^3 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b^3 \sqrt {a-b} \sqrt {a+b}}+\frac {\left (2 a^2+b^2\right ) \text {ArcTan}(\sinh (x))}{2 b^3}-\frac {a \tanh (x)}{b^2}+\frac {\tanh (x) \text {sech}(x)}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 2738
Rule 3855
Rule 3916
Rule 3936
Rule 4083
Rule 4167
Rubi steps
\begin {align*} \int \frac {\text {sech}^4(x)}{a+b \text {sech}(x)} \, dx &=\frac {\text {sech}(x) \tanh (x)}{2 b}+\frac {\int \frac {\text {sech}(x) \left (a+b \text {sech}(x)-2 a \text {sech}^2(x)\right )}{a+b \text {sech}(x)} \, dx}{2 b}\\ &=-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}+\frac {\int \frac {\text {sech}(x) \left (a b+\left (2 a^2+b^2\right ) \text {sech}(x)\right )}{a+b \text {sech}(x)} \, dx}{2 b^2}\\ &=-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\frac {a^3 \int \frac {\text {sech}(x)}{a+b \text {sech}(x)} \, dx}{b^3}+\frac {\left (2 a^2+b^2\right ) \int \text {sech}(x) \, dx}{2 b^3}\\ &=\frac {\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\frac {a^3 \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{b^4}\\ &=\frac {\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}-\frac {\left (2 a^3\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^4}\\ &=\frac {\left (2 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 b^3}-\frac {2 a^3 \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^3 \sqrt {a+b}}-\frac {a \tanh (x)}{b^2}+\frac {\text {sech}(x) \tanh (x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 82, normalized size = 0.94 \begin {gather*} \frac {2 \left (2 a^2+b^2\right ) \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )+\frac {4 a^3 \text {ArcTan}\left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+b (-2 a+b \text {sech}(x)) \tanh (x)}{2 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.74, size = 109, normalized size = 1.25
method | result | size |
default | \(-\frac {2 a^{3} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b^{3} \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {\frac {2 \left (\left (-a b -\frac {1}{2} b^{2}\right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )+\left (-a b +\frac {1}{2} b^{2}\right ) \tanh \left (\frac {x}{2}\right )\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+\left (2 a^{2}+b^{2}\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b^{3}}\) | \(109\) |
risch | \(\frac {b \,{\mathrm e}^{3 x}+2 \,{\mathrm e}^{2 x} a -{\mathrm e}^{x} b +2 a}{\left (1+{\mathrm e}^{2 x}\right )^{2} b^{2}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right ) a^{2}}{b^{3}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{2 b}-\frac {i \ln \left ({\mathrm e}^{x}-i\right ) a^{2}}{b^{3}}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{2 b}-\frac {a^{3} \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^{3}}+\frac {a^{3} \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^{3}}\) | \(209\) |
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. 682 vs.
\(2 (73) = 146\).
time = 0.46, size = 1444, normalized size = 16.60 \begin {gather*} \text {Too large to display} \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}^{4}{\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 = 89, normalized size = 1.02 \begin {gather*} -\frac {2 \, a^{3} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} b^{3}} + \frac {{\left (2 \, a^{2} + b^{2}\right )} \arctan \left (e^{x}\right )}{b^{3}} + \frac {b e^{\left (3 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - b e^{x} + 2 \, a}{b^{2} {\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.08, size = 476, normalized size = 5.47 \begin {gather*} \frac {{\mathrm {e}}^x}{b+b\,{\mathrm {e}}^{2\,x}}-\frac {2\,{\mathrm {e}}^x}{b+2\,b\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{4\,x}}+\frac {2\,a}{b^2\,{\mathrm {e}}^{2\,x}+b^2}-\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,b}-\frac {a^2\,\left (\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{b^3}-\frac {a^3\,\ln \left (16\,a\,b^5-48\,a^5\,b-24\,a^5\,\sqrt {b^2-a^2}+32\,a^3\,b^3+24\,a^6\,{\mathrm {e}}^x+32\,b^6\,{\mathrm {e}}^x+16\,a\,b^4\,\sqrt {b^2-a^2}+40\,a^3\,b^2\,\sqrt {b^2-a^2}+32\,b^5\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+56\,a^2\,b^4\,{\mathrm {e}}^x-112\,a^4\,b^2\,{\mathrm {e}}^x+72\,a^2\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-72\,a^4\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^3\,\sqrt {b^2-a^2}}+\frac {a^3\,\ln \left (16\,a\,b^5-48\,a^5\,b+24\,a^5\,\sqrt {b^2-a^2}+32\,a^3\,b^3+24\,a^6\,{\mathrm {e}}^x+32\,b^6\,{\mathrm {e}}^x-16\,a\,b^4\,\sqrt {b^2-a^2}-40\,a^3\,b^2\,\sqrt {b^2-a^2}-32\,b^5\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+56\,a^2\,b^4\,{\mathrm {e}}^x-112\,a^4\,b^2\,{\mathrm {e}}^x-72\,a^2\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}+72\,a^4\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )}{b^3\,\sqrt {b^2-a^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________