Optimal. Leaf size=100 \[ -\frac {4}{3} a b \left (a^2+2 b^2\right ) \cosh (x)-\frac {1}{3} b^2 \left (2 a^2+3 b^2\right ) \sinh (x) \cosh (x)+\frac {1}{3} \text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+b^4 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4391, 2691, 2861, 2734} \[ -\frac {4}{3} a b \left (a^2+2 b^2\right ) \cosh (x)-\frac {1}{3} b^2 \left (2 a^2+3 b^2\right ) \sinh (x) \cosh (x)+\frac {1}{3} \text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+b^4 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2691
Rule 2734
Rule 2861
Rule 4391
Rubi steps
\begin {align*} \int (a \text {sech}(x)+b \tanh (x))^4 \, dx &=\int \text {sech}^4(x) (a+b \sinh (x))^4 \, dx\\ &=-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3-\frac {1}{3} \int \text {sech}^2(x) (a+b \sinh (x))^2 \left (-2 a^2-3 b^2+a b \sinh (x)\right ) \, dx\\ &=-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+\frac {1}{3} \text {sech}(x) (a+b \sinh (x))^2 \left (a b+\left (2 a^2+3 b^2\right ) \sinh (x)\right )+\frac {1}{3} \int (a+b \sinh (x)) \left (-2 a b^2-2 b \left (2 a^2+3 b^2\right ) \sinh (x)\right ) \, dx\\ &=b^4 x-\frac {4}{3} a b \left (a^2+2 b^2\right ) \cosh (x)-\frac {1}{3} b^2 \left (2 a^2+3 b^2\right ) \cosh (x) \sinh (x)-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+\frac {1}{3} \text {sech}(x) (a+b \sinh (x))^2 \left (a b+\left (2 a^2+3 b^2\right ) \sinh (x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 79, normalized size = 0.79 \[ \frac {1}{3} \left (-4 a b \left (a^2-b^2\right ) \text {sech}^3(x)+2 \left (a^4+3 a^2 b^2-2 b^4\right ) \tanh (x)+\left (a^4-6 a^2 b^2+b^4\right ) \tanh (x) \text {sech}^2(x)-12 a b^3 \text {sech}(x)+3 b^4 x\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.40, size = 207, normalized size = 2.07 \[ -\frac {24 \, a b^{3} \cosh \relax (x)^{2} + 16 \, a^{3} b + 8 \, a b^{3} - {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \relax (x)^{3} - 2 \, {\left (a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )} \sinh \relax (x)^{3} + 3 \, {\left (8 \, a b^{3} - {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \relax (x)\right )} \sinh \relax (x)^{2} - 3 \, {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \relax (x) - 6 \, {\left (a^{4} - 3 \, a^{2} b^{2} + {\left (a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )} \cosh \relax (x)^{2}\right )} \sinh \relax (x)}{3 \, {\left (\cosh \relax (x)^{3} + 3 \, \cosh \relax (x) \sinh \relax (x)^{2} + 3 \, \cosh \relax (x)\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 110, normalized size = 1.10 \[ b^{4} x - \frac {4 \, {\left (6 \, a b^{3} e^{\left (5 \, x\right )} + 9 \, a^{2} b^{2} e^{\left (4 \, x\right )} - 3 \, b^{4} e^{\left (4 \, x\right )} + 8 \, a^{3} b e^{\left (3 \, x\right )} + 4 \, a b^{3} e^{\left (3 \, x\right )} + 3 \, a^{4} e^{\left (2 \, x\right )} - 3 \, b^{4} e^{\left (2 \, x\right )} + 6 \, a b^{3} e^{x} + a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )}}{3 \, {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.39, size = 94, normalized size = 0.94 \[ a^{4} \left (\frac {2}{3}+\frac {\mathrm {sech}\relax (x )^{2}}{3}\right ) \tanh \relax (x )-\frac {4 a^{3} b}{3 \cosh \relax (x )^{3}}+6 a^{2} b^{2} \left (-\frac {\sinh \relax (x )}{2 \cosh \relax (x )^{3}}+\frac {\left (\frac {2}{3}+\frac {\mathrm {sech}\relax (x )^{2}}{3}\right ) \tanh \relax (x )}{2}\right )+4 a \,b^{3} \left (-\frac {\sinh ^{2}\relax (x )}{\cosh \relax (x )^{3}}-\frac {2}{3 \cosh \relax (x )^{3}}\right )+b^{4} \left (x -\tanh \relax (x )-\frac {\left (\tanh ^{3}\relax (x )\right )}{3}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.38, size = 210, normalized size = 2.10 \[ 2 \, a^{2} b^{2} \tanh \relax (x)^{3} + \frac {1}{3} \, b^{4} {\left (3 \, x - \frac {4 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + 2\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} - \frac {8}{3} \, a b^{3} {\left (\frac {3 \, e^{\left (-x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {2 \, e^{\left (-3 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {3 \, e^{\left (-5 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} + \frac {4}{3} \, a^{4} {\left (\frac {3 \, e^{\left (-2 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {1}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} - \frac {32 \, a^{3} b}{3 \, {\left (e^{\left (-x\right )} + e^{x}\right )}^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.52, size = 145, normalized size = 1.45 \[ \frac {{\mathrm {e}}^x\,\left (\frac {32\,a\,b^3}{3}-\frac {32\,a^3\,b}{3}\right )-4\,a^4-4\,b^4+24\,a^2\,b^2}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}-\frac {12\,a^2\,b^2+8\,{\mathrm {e}}^x\,a\,b^3-4\,b^4}{{\mathrm {e}}^{2\,x}+1}+b^4\,x-\frac {{\mathrm {e}}^x\,\left (\frac {32\,a\,b^3}{3}-\frac {32\,a^3\,b}{3}\right )-\frac {8\,a^4}{3}-\frac {8\,b^4}{3}+16\,a^2\,b^2}{3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,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 )^{4}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________