Optimal. Leaf size=29 \[ -a b \cosh (x)-\text {sech}(x) (b-a \sinh (x)) (a+b \sinh (x))+b^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4391, 2691, 2638} \[ -a b \cosh (x)-\text {sech}(x) (b-a \sinh (x)) (a+b \sinh (x))+b^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 2691
Rule 4391
Rubi steps
\begin {align*} \int (a \text {sech}(x)+b \tanh (x))^2 \, dx &=\int \text {sech}^2(x) (a+b \sinh (x))^2 \, dx\\ &=-\text {sech}(x) (b-a \sinh (x)) (a+b \sinh (x))-\int \left (-b^2+a b \sinh (x)\right ) \, dx\\ &=b^2 x-\text {sech}(x) (b-a \sinh (x)) (a+b \sinh (x))-(a b) \int \sinh (x) \, dx\\ &=b^2 x-a b \cosh (x)-\text {sech}(x) (b-a \sinh (x)) (a+b \sinh (x))\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 26, normalized size = 0.90 \[ \left (a^2-b^2\right ) \tanh (x)-2 a b \text {sech}(x)+b^2 \tanh ^{-1}(\tanh (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.39, size = 42, normalized size = 1.45 \[ -\frac {2 \, a b - {\left (b^{2} x - a^{2} + b^{2}\right )} \cosh \relax (x) - {\left (a^{2} - b^{2}\right )} \sinh \relax (x)}{\cosh \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 31, normalized size = 1.07 \[ b^{2} x - \frac {2 \, {\left (2 \, a b e^{x} + a^{2} - b^{2}\right )}}{e^{\left (2 \, x\right )} + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.35, size = 26, normalized size = 0.90 \[ a^{2} \tanh \relax (x )-\frac {2 a b}{\cosh \relax (x )}+b^{2} \left (x -\tanh \relax (x )\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 43, normalized size = 1.48 \[ b^{2} {\left (x - \frac {2}{e^{\left (-2 \, x\right )} + 1}\right )} - \frac {4 \, a b}{e^{\left (-x\right )} + e^{x}} + \frac {2 \, a^{2}}{e^{\left (-2 \, x\right )} + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.57, size = 33, normalized size = 1.14 \[ b^2\,x-\frac {2\,a^2+4\,{\mathrm {e}}^x\,a\,b-2\,b^2}{{\mathrm {e}}^{2\,x}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \operatorname {sech}{\relax (x )} + b \tanh {\relax (x )}\right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________