Optimal. Leaf size=59 \[ -\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)+a^3 \log (\sinh (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 59, 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 = {4477, 2747,
753, 788, 649, 210, 266} \begin {gather*} a^3 \log (\sinh (x))-\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} \text {csch}^2(x) (a \cosh (x)+b)^2 (a+b \cosh (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 266
Rule 649
Rule 753
Rule 788
Rule 2747
Rule 4477
Rubi steps
\begin {align*} \int (a \coth (x)+b \text {csch}(x))^3 \, dx &=i \int (i b+i a \cosh (x))^3 \text {csch}^3(x) \, dx\\ &=a^3 \text {Subst}\left (\int \frac {(i b+x)^3}{\left (-a^2-x^2\right )^2} \, dx,x,i a \cosh (x)\right )\\ &=-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)+\frac {1}{2} a \text {Subst}\left (\int \frac {(i b+x) \left (-2 a^2+b^2+i b x\right )}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)-\frac {1}{2} a \text {Subst}\left (\int \frac {i a^2 b-i b \left (-2 a^2+b^2\right )+2 a^2 x}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)-a^3 \text {Subst}\left (\int \frac {x}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )-\frac {1}{2} \left (i a b \left (3 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a^2-x^2} \, dx,x,i a \cosh (x)\right )\\ &=-\frac {1}{2} b \left (3 a^2-b^2\right ) \tanh ^{-1}(\cosh (x))+\frac {1}{2} a^2 b \cosh (x)-\frac {1}{2} (b+a \cosh (x))^2 (a+b \cosh (x)) \text {csch}^2(x)+a^3 \log (\sinh (x))\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 99, normalized size = 1.68 \begin {gather*} -\frac {1}{4} \text {csch}^2(x) \left (2 a^3+6 a b^2+2 b \left (3 a^2+b^2\right ) \cosh (x)+2 a^3 \log (\sinh (x))+3 a^2 b \log \left (\tanh \left (\frac {x}{2}\right )\right )-b^3 \log \left (\tanh \left (\frac {x}{2}\right )\right )+\cosh (2 x) \left (-2 a^3 \log (\sinh (x))+b \left (-3 a^2+b^2\right ) \log \left (\tanh \left (\frac {x}{2}\right )\right )\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(122\) vs.
\(2(53)=106\).
time = 0.80, size = 123, normalized size = 2.08
method | result | size |
risch | \(-a^{3} x -\frac {{\mathrm e}^{x} \left (3 a^{2} b \,{\mathrm e}^{2 x}+b^{3} {\mathrm e}^{2 x}+2 a^{3} {\mathrm e}^{x}+6 a \,b^{2} {\mathrm e}^{x}+3 a^{2} b +b^{3}\right )}{\left ({\mathrm e}^{2 x}-1\right )^{2}}+\ln \left ({\mathrm e}^{x}-1\right ) a^{3}+\frac {3 \ln \left ({\mathrm e}^{x}-1\right ) a^{2} b}{2}-\frac {\ln \left ({\mathrm e}^{x}-1\right ) b^{3}}{2}+\ln \left ({\mathrm e}^{x}+1\right ) a^{3}-\frac {3 \ln \left ({\mathrm e}^{x}+1\right ) a^{2} b}{2}+\frac {\ln \left ({\mathrm e}^{x}+1\right ) b^{3}}{2}\) | \(123\) |
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. 152 vs.
\(2 (53) = 106\).
time = 0.28, size = 152, normalized size = 2.58 \begin {gather*} -\frac {3}{2} \, a b^{2} \coth \left (x\right )^{2} + a^{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 (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\right )\right )} + \frac {1}{2} \, b^{3} {\left (\frac {2 \, {\left (e^{\left (-x\right )} + e^{\left (-3 \, x\right )}\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} + \log \left (e^{\left (-x\right )} + 1\right ) - \log \left (e^{\left (-x\right )} - 1\right )\right )} + \frac {3}{2} \, a^{2} b {\left (\frac {2 \, {\left (e^{\left (-x\right )} + e^{\left (-3 \, x\right )}\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} - \log \left (e^{\left (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\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. 674 vs.
\(2 (53) = 106\).
time = 0.38, size = 674, normalized size = 11.42 \begin {gather*} -\frac {2 \, a^{3} x \cosh \left (x\right )^{4} + 2 \, a^{3} x \sinh \left (x\right )^{4} + 2 \, a^{3} x + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (4 \, a^{3} x \cosh \left (x\right ) + 3 \, a^{2} b + b^{3}\right )} \sinh \left (x\right )^{3} - 4 \, {\left (a^{3} x - a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (6 \, a^{3} x \cosh \left (x\right )^{2} - 2 \, a^{3} x + 2 \, a^{3} + 6 \, a b^{2} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right ) - {\left ({\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, a^{3} - 3 \, a^{2} b + b^{3} - 2 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3} - 3 \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{3} - {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left ({\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, a^{3} + 3 \, a^{2} b - b^{3} - 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3} - 3 \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )^{3} - {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) + 2 \, {\left (4 \, a^{3} x \cosh \left (x\right )^{3} + 3 \, a^{2} b + b^{3} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2} - 4 \, {\left (a^{3} x - a^{3} - 3 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left (\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\right )}} \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 \coth {\left (x \right )} + b \operatorname {csch}{\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. 115 vs.
\(2 (53) = 106\).
time = 0.41, size = 115, normalized size = 1.95 \begin {gather*} \frac {1}{4} \, {\left (2 \, a^{3} - 3 \, a^{2} b + b^{3}\right )} \log \left (e^{\left (-x\right )} + e^{x} + 2\right ) + \frac {1}{4} \, {\left (2 \, a^{3} + 3 \, a^{2} b - b^{3}\right )} \log \left (e^{\left (-x\right )} + e^{x} - 2\right ) - \frac {a^{3} {\left (e^{\left (-x\right )} + e^{x}\right )}^{2} + 6 \, a^{2} b {\left (e^{\left (-x\right )} + e^{x}\right )} + 2 \, b^{3} {\left (e^{\left (-x\right )} + e^{x}\right )} + 12 \, a b^{2}}{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.54, size = 169, normalized size = 2.86 \begin {gather*} \ln \left (b^3-3\,a^2\,b+b^3\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\right )\,\left (a^3-\frac {3\,a^2\,b}{2}+\frac {b^3}{2}\right )-\frac {6\,a\,b^2+2\,a^3+{\mathrm {e}}^x\,\left (3\,a^2\,b+b^3\right )}{{\mathrm {e}}^{2\,x}-1}-\frac {{\mathrm {e}}^x\,\left (6\,a^2\,b+2\,b^3\right )+6\,a\,b^2+2\,a^3}{{\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1}-a^3\,x+\ln \left (3\,a^2\,b-b^3+b^3\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\right )\,\left (a^3+\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________