Optimal. Leaf size=82 \[ -\frac{x \left (a^2-2 b^2\right )}{2 a^3}+\frac{2 b \sqrt{a-b} \sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^3}-\frac{\sinh (x) (2 b-a \cosh (x))}{2 a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.212117, antiderivative size = 82, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3872, 2865, 2735, 2659, 205} \[ -\frac{x \left (a^2-2 b^2\right )}{2 a^3}+\frac{2 b \sqrt{a-b} \sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^3}-\frac{\sinh (x) (2 b-a \cosh (x))}{2 a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3872
Rule 2865
Rule 2735
Rule 2659
Rule 205
Rubi steps
\begin{align*} \int \frac{\sinh ^2(x)}{a+b \text{sech}(x)} \, dx &=-\int \frac{\cosh (x) \sinh ^2(x)}{-b-a \cosh (x)} \, dx\\ &=-\frac{(2 b-a \cosh (x)) \sinh (x)}{2 a^2}+\frac{\int \frac{-a b+\left (a^2-2 b^2\right ) \cosh (x)}{-b-a \cosh (x)} \, dx}{2 a^2}\\ &=-\frac{\left (a^2-2 b^2\right ) x}{2 a^3}-\frac{(2 b-a \cosh (x)) \sinh (x)}{2 a^2}-\frac{\left (b \left (a^2-b^2\right )\right ) \int \frac{1}{-b-a \cosh (x)} \, dx}{a^3}\\ &=-\frac{\left (a^2-2 b^2\right ) x}{2 a^3}-\frac{(2 b-a \cosh (x)) \sinh (x)}{2 a^2}-\frac{\left (2 b \left (a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-a-b-(a-b) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{a^3}\\ &=-\frac{\left (a^2-2 b^2\right ) x}{2 a^3}+\frac{2 \sqrt{a-b} b \sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a^3}-\frac{(2 b-a \cosh (x)) \sinh (x)}{2 a^2}\\ \end{align*}
Mathematica [A] time = 0.153419, size = 76, normalized size = 0.93 \[ \frac{-8 b \sqrt{a^2-b^2} \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )-2 a^2 x+a^2 \sinh (2 x)-4 a b \sinh (x)+4 b^2 x}{4 a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.027, size = 213, normalized size = 2.6 \begin{align*} -{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}+{\frac{b}{{a}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{1}{2\,a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{{b}^{2}}{{a}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+{\frac{1}{2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{b}{{a}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{1}{2\,a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{{b}^{2}}{{a}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+2\,{\frac{b}{a\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }-2\,{\frac{{b}^{3}}{{a}^{3}\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \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 = 2.75851, size = 1500, normalized size = 18.29 \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{\sinh ^{2}{\left (x \right )}}{a + b \operatorname{sech}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14827, size = 135, normalized size = 1.65 \begin{align*} \frac{a e^{\left (2 \, x\right )} - 4 \, b e^{x}}{8 \, a^{2}} - \frac{{\left (a^{2} - 2 \, b^{2}\right )} x}{2 \, a^{3}} + \frac{{\left (4 \, a b e^{x} - a^{2}\right )} e^{\left (-2 \, x\right )}}{8 \, a^{3}} + \frac{2 \,{\left (a^{2} b - b^{3}\right )} \arctan \left (\frac{a e^{x} + b}{\sqrt{a^{2} - b^{2}}}\right )}{\sqrt{a^{2} - b^{2}} a^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]