Optimal. Leaf size=58 \[ \frac {1}{2} a \left (a^2+3 b^2\right ) \text {ArcTan}(\sinh (x))+b^3 \log (\cosh (x))-\frac {1}{2} a b^2 \sinh (x)-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2 \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.636, Rules used = {4476, 2747,
753, 788, 649, 210, 266} \begin {gather*} \frac {1}{2} a \left (a^2+3 b^2\right ) \text {ArcTan}(\sinh (x))-\frac {1}{2} a b^2 \sinh (x)-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2+b^3 \log (\cosh (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 266
Rule 649
Rule 753
Rule 788
Rule 2747
Rule 4476
Rubi steps
\begin {align*} \int (a \text {sech}(x)+b \tanh (x))^3 \, dx &=\int \text {sech}^3(x) (a+b \sinh (x))^3 \, dx\\ &=b^3 \text {Subst}\left (\int \frac {(a+x)^3}{\left (-b^2-x^2\right )^2} \, dx,x,b \sinh (x)\right )\\ &=-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2+\frac {1}{2} b \text {Subst}\left (\int \frac {(a+x) \left (-a^2-2 b^2+a x\right )}{-b^2-x^2} \, dx,x,b \sinh (x)\right )\\ &=-\frac {1}{2} a b^2 \sinh (x)-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2-\frac {1}{2} b \text {Subst}\left (\int \frac {a b^2-a \left (-a^2-2 b^2\right )+2 b^2 x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )\\ &=-\frac {1}{2} a b^2 \sinh (x)-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2-b^3 \text {Subst}\left (\int \frac {x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )-\frac {1}{2} \left (a b \left (a^2+3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-b^2-x^2} \, dx,x,b \sinh (x)\right )\\ &=\frac {1}{2} a \left (a^2+3 b^2\right ) \tan ^{-1}(\sinh (x))+b^3 \log (\cosh (x))-\frac {1}{2} a b^2 \sinh (x)-\frac {1}{2} \text {sech}^2(x) (b-a \sinh (x)) (a+b \sinh (x))^2\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(194\) vs. \(2(58)=116\).
time = 1.35, size = 194, normalized size = 3.34 \begin {gather*} \frac {1}{4} \left (\frac {b \left (\left (a^3+3 a b^2-2 \left (-b^2\right )^{3/2}\right ) \log \left (\sqrt {-b^2}-b \sinh (x)\right )-\left (a^3+3 a b^2+2 \left (-b^2\right )^{3/2}\right ) \log \left (\sqrt {-b^2}+b \sinh (x)\right )\right )}{\sqrt {-b^2}}+\frac {2 a^4 b \text {sech}^2(x)}{a^2+b^2}+\frac {a \left (2 a^4-4 a^2 b^2-7 b^4+b^4 \cosh (2 x)\right ) \text {sech}(x) \tanh (x)}{a^2+b^2}-\frac {2 b \left (-4 a^4-2 a^2 b^2+b^4+a b^3 \sinh (x)\right ) \tanh ^2(x)}{a^2+b^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains complex when optimal does not.
time = 0.97, size = 134, normalized size = 2.31
method | result | size |
risch | \(-b^{3} x +\frac {{\mathrm e}^{x} \left (a^{3} {\mathrm e}^{2 x}-3 a \,b^{2} {\mathrm e}^{2 x}-6 a^{2} b \,{\mathrm e}^{x}+2 b^{3} {\mathrm e}^{x}-a^{3}+3 a \,b^{2}\right )}{\left (1+{\mathrm e}^{2 x}\right )^{2}}+\frac {i \ln \left ({\mathrm e}^{x}+i\right ) a^{3}}{2}+\frac {3 i \ln \left ({\mathrm e}^{x}+i\right ) a \,b^{2}}{2}+\ln \left ({\mathrm e}^{x}+i\right ) b^{3}-\frac {i \ln \left ({\mathrm e}^{x}-i\right ) a^{3}}{2}-\frac {3 i \ln \left ({\mathrm e}^{x}-i\right ) a \,b^{2}}{2}+\ln \left ({\mathrm e}^{x}-i\right ) b^{3}\) | \(134\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 120 vs.
\(2 (53) = 106\).
time = 0.48, size = 120, normalized size = 2.07 \begin {gather*} \frac {3}{2} \, a^{2} b \tanh \left (x\right )^{2} + b^{3} {\left (x + \frac {2 \, e^{\left (-2 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1} + \log \left (e^{\left (-2 \, x\right )} + 1\right )\right )} - 3 \, a b^{2} {\left (\frac {e^{\left (-x\right )} - e^{\left (-3 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1} + \arctan \left (e^{\left (-x\right )}\right )\right )} + a^{3} {\left (\frac {e^{\left (-x\right )} - e^{\left (-3 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1} - \arctan \left (e^{\left (-x\right )}\right )\right )} \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. 502 vs.
\(2 (53) = 106\).
time = 0.39, size = 502, normalized size = 8.66 \begin {gather*} -\frac {b^{3} x \cosh \left (x\right )^{4} + b^{3} x \sinh \left (x\right )^{4} + b^{3} x - {\left (a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right )^{3} + {\left (4 \, b^{3} x \cosh \left (x\right ) - a^{3} + 3 \, a b^{2}\right )} \sinh \left (x\right )^{3} + 2 \, {\left (b^{3} x + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} + {\left (6 \, b^{3} x \cosh \left (x\right )^{2} + 2 \, b^{3} x + 6 \, a^{2} b - 2 \, b^{3} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - {\left ({\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{3} + 3 \, a b^{2}\right )} \sinh \left (x\right )^{4} + a^{3} + 3 \, a b^{2} + 2 \, {\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{3} + 3 \, a b^{2} + 3 \, {\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + {\left (a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right ) - {\left (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 )\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + {\left (4 \, b^{3} x \cosh \left (x\right )^{3} + a^{3} - 3 \, a b^{2} - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (b^{3} x + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 2 \, {\left (3 \, \cosh \left (x\right )^{2} + 1\right )} \sinh \left (x\right )^{2} + 2 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} + \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1} \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 \left (a \operatorname {sech}{\left (x \right )} + b \tanh {\left (x \right )}\right )^{3}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs.
\(2 (53) = 106\).
time = 0.41, size = 117, normalized size = 2.02 \begin {gather*} \frac {1}{2} \, b^{3} \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right ) + \frac {1}{4} \, {\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} {\left (a^{3} + 3 \, a b^{2}\right )} - \frac {b^{3} {\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 2 \, a^{3} {\left (e^{\left (-x\right )} - e^{x}\right )} - 6 \, a b^{2} {\left (e^{\left (-x\right )} - e^{x}\right )} + 12 \, a^{2} b}{2 \, {\left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.61, size = 233, normalized size = 4.02 \begin {gather*} \mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (a^3+3\,a\,b^2\right )}{\sqrt {a^6+6\,a^4\,b^2+9\,a^2\,b^4}}\right )\,\sqrt {a^6+6\,a^4\,b^2+9\,a^2\,b^4}+\frac {{\mathrm {e}}^x\,\left (6\,a\,b^2-2\,a^3\right )+6\,a^2\,b-2\,b^3}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}+b^3\,\ln \left (\left (a^3\,{\mathrm {e}}^x-2\,\sqrt {-\frac {a^6}{4}-\frac {3\,a^4\,b^2}{2}-\frac {9\,a^2\,b^4}{4}}+3\,a\,b^2\,{\mathrm {e}}^x\right )\,\left (2\,\sqrt {-\frac {a^6}{4}-\frac {3\,a^4\,b^2}{2}-\frac {9\,a^2\,b^4}{4}}+a^3\,{\mathrm {e}}^x+3\,a\,b^2\,{\mathrm {e}}^x\right )\right )-b^3\,x-\frac {{\mathrm {e}}^x\,\left (3\,a\,b^2-a^3\right )+6\,a^2\,b-2\,b^3}{{\mathrm {e}}^{2\,x}+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________