Optimal. Leaf size=40 \[ -\frac{\left (a^2-b^2\right ) \log (a+b \tanh (x))}{b^3}+\frac{a \tanh (x)}{b^2}-\frac{\tanh ^2(x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06617, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3506, 697} \[ -\frac{\left (a^2-b^2\right ) \log (a+b \tanh (x))}{b^3}+\frac{a \tanh (x)}{b^2}-\frac{\tanh ^2(x)}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3506
Rule 697
Rubi steps
\begin{align*} \int \frac{\text{sech}^4(x)}{a+b \tanh (x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1-\frac{x^2}{b^2}}{a+x} \, dx,x,b \tanh (x)\right )}{b}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a}{b^2}-\frac{x}{b^2}+\frac{-a^2+b^2}{b^2 (a+x)}\right ) \, dx,x,b \tanh (x)\right )}{b}\\ &=-\frac{\left (a^2-b^2\right ) \log (a+b \tanh (x))}{b^3}+\frac{a \tanh (x)}{b^2}-\frac{\tanh ^2(x)}{2 b}\\ \end{align*}
Mathematica [A] time = 0.157174, size = 49, normalized size = 1.22 \[ \frac{2 \left (a^2-b^2\right ) (\log (\cosh (x))-\log (a \cosh (x)+b \sinh (x)))+2 a b \tanh (x)+b^2 \text{sech}^2(x)}{2 b^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.039, size = 143, normalized size = 3.6 \begin{align*} -{\frac{{a}^{2}}{{b}^{3}}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\tanh \left ( x/2 \right ) b+a \right ) }+{\frac{1}{b}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\tanh \left ( x/2 \right ) b+a \right ) }+2\,{\frac{a \left ( \tanh \left ( x/2 \right ) \right ) ^{3}}{{b}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{2}}{b \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+2\,{\frac{a\tanh \left ( x/2 \right ) }{{b}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{{a}^{2}}{{b}^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }-{\frac{1}{b}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.6785, size = 120, normalized size = 3. \begin{align*} \frac{2 \,{\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} + a\right )}}{2 \, b^{2} e^{\left (-2 \, x\right )} + b^{2} e^{\left (-4 \, x\right )} + b^{2}} - \frac{{\left (a^{2} - b^{2}\right )} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{b^{3}} + \frac{{\left (a^{2} - b^{2}\right )} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{b^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.43367, size = 1088, normalized size = 27.2 \begin{align*} -\frac{2 \,{\left (a b - b^{2}\right )} \cosh \left (x\right )^{2} + 4 \,{\left (a b - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 2 \,{\left (a b - b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, a b +{\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{4} + 4 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} +{\left (a^{2} - b^{2}\right )} \sinh \left (x\right )^{4} + 2 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - b^{2} + 4 \,{\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{3} +{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac{2 \,{\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) -{\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{4} + 4 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} +{\left (a^{2} - b^{2}\right )} \sinh \left (x\right )^{4} + 2 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \,{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - b^{2} + 4 \,{\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{3} +{\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{b^{3} \cosh \left (x\right )^{4} + 4 \, b^{3} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{3} \sinh \left (x\right )^{4} + 2 \, b^{3} \cosh \left (x\right )^{2} + b^{3} + 2 \,{\left (3 \, b^{3} \cosh \left (x\right )^{2} + b^{3}\right )} \sinh \left (x\right )^{2} + 4 \,{\left (b^{3} \cosh \left (x\right )^{3} + b^{3} \cosh \left (x\right )\right )} \sinh \left (x\right )} \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}^{4}{\left (x \right )}}{a + b \tanh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.20692, size = 140, normalized size = 3.5 \begin{align*} -\frac{{\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a b^{3} + b^{4}} + \frac{{\left (a^{2} - b^{2}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{b^{3}} - \frac{2 \,{\left (a b +{\left (a b - b^{2}\right )} e^{\left (2 \, x\right )}\right )}}{b^{3}{\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]