Optimal. Leaf size=88 \[ \frac {b \left (3 a^2+b^2\right ) \text {ArcTan}(\sinh (x))}{2 \left (a^2+b^2\right )^2}+\frac {a^3 \log (\cosh (x))}{\left (a^2+b^2\right )^2}-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {2800, 1661,
815, 649, 209, 266} \begin {gather*} \frac {b \left (3 a^2+b^2\right ) \text {ArcTan}(\sinh (x))}{2 \left (a^2+b^2\right )^2}+\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {a^3 \log (\cosh (x))}{\left (a^2+b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 815
Rule 1661
Rule 2800
Rubi steps
\begin {align*} \int \frac {\tanh ^3(x)}{a+b \sinh (x)} \, dx &=\text {Subst}\left (\int \frac {x^3}{(a+x) \left (-b^2-x^2\right )^2} \, dx,x,b \sinh (x)\right )\\ &=\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}-\frac {\text {Subst}\left (\int \frac {\frac {a b^4}{a^2+b^2}+\frac {b^2 \left (2 a^2+b^2\right ) x}{a^2+b^2}}{(a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (x)\right )}{2 b^2}\\ &=\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}-\frac {\text {Subst}\left (\int \left (\frac {2 a^3 b^2}{\left (a^2+b^2\right )^2 (a+x)}-\frac {b^2 \left (3 a^2 b^2+b^4+2 a^3 x\right )}{\left (a^2+b^2\right )^2 \left (b^2+x^2\right )}\right ) \, dx,x,b \sinh (x)\right )}{2 b^2}\\ &=-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}+\frac {\text {Subst}\left (\int \frac {3 a^2 b^2+b^4+2 a^3 x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{2 \left (a^2+b^2\right )^2}\\ &=-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}+\frac {a^3 \text {Subst}\left (\int \frac {x}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{\left (a^2+b^2\right )^2}+\frac {\left (b^2 \left (3 a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{b^2+x^2} \, dx,x,b \sinh (x)\right )}{2 \left (a^2+b^2\right )^2}\\ &=\frac {b \left (3 a^2+b^2\right ) \tan ^{-1}(\sinh (x))}{2 \left (a^2+b^2\right )^2}+\frac {a^3 \log (\cosh (x))}{\left (a^2+b^2\right )^2}-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {\text {sech}^2(x) (a-b \sinh (x))}{2 \left (a^2+b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.14, size = 153, normalized size = 1.74 \begin {gather*} -\frac {b \text {ArcTan}(\sinh (x))}{2 \left (a^2+b^2\right )}+\frac {\left (a^3-i \left (2 a^2 b+b^3\right )\right ) \log (i-\sinh (x))}{2 \left (a^2+b^2\right )^2}+\frac {\left (a^3+i \left (2 a^2 b+b^3\right )\right ) \log (i+\sinh (x))}{2 \left (a^2+b^2\right )^2}-\frac {a^3 \log (a+b \sinh (x))}{\left (a^2+b^2\right )^2}+\frac {a \text {sech}^2(x)}{2 \left (a^2+b^2\right )}-\frac {b \text {sech}(x) \tanh (x)}{2 \left (a^2+b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.58, size = 166, normalized size = 1.89
method | result | size |
default | \(\frac {\frac {2 \left (\left (\frac {1}{2} a^{2} b +\frac {1}{2} b^{3}\right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )+\left (-a^{3}-a \,b^{2}\right ) \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+\left (-\frac {1}{2} a^{2} b -\frac {1}{2} b^{3}\right ) \tanh \left (\frac {x}{2}\right )\right )}{\left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}+a^{3} \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )+\left (3 a^{2} b +b^{3}\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {8 a^{3} \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a \right )}{8 a^{4}+16 a^{2} b^{2}+8 b^{4}}\) | \(166\) |
risch | \(\frac {{\mathrm e}^{x} \left (-b \,{\mathrm e}^{2 x}+2 a \,{\mathrm e}^{x}+b \right )}{\left (1+{\mathrm e}^{2 x}\right )^{2} \left (a^{2}+b^{2}\right )}+\frac {3 i \ln \left ({\mathrm e}^{x}+i\right ) a^{2} b}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {i \ln \left ({\mathrm e}^{x}+i\right ) b^{3}}{2 a^{4}+4 a^{2} b^{2}+2 b^{4}}+\frac {\ln \left ({\mathrm e}^{x}+i\right ) a^{3}}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {3 i \ln \left ({\mathrm e}^{x}-i\right ) a^{2} b}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {i \ln \left ({\mathrm e}^{x}-i\right ) b^{3}}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {\ln \left ({\mathrm e}^{x}-i\right ) a^{3}}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {a^{3} \ln \left ({\mathrm e}^{2 x}+\frac {2 a \,{\mathrm e}^{x}}{b}-1\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}\) | \(245\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 160, normalized size = 1.82 \begin {gather*} -\frac {a^{3} \log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {a^{3} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {{\left (3 \, a^{2} b + b^{3}\right )} \arctan \left (e^{\left (-x\right )}\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {b e^{\left (-x\right )} - 2 \, a e^{\left (-2 \, x\right )} - b e^{\left (-3 \, x\right )}}{a^{2} + b^{2} + 2 \, {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, x\right )} + {\left (a^{2} + b^{2}\right )} e^{\left (-4 \, x\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. 655 vs.
\(2 (85) = 170\).
time = 0.45, size = 655, normalized size = 7.44 \begin {gather*} -\frac {{\left (a^{2} b + b^{3}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} b + b^{3}\right )} \sinh \left (x\right )^{3} - 2 \, {\left (a^{3} + a b^{2}\right )} \cosh \left (x\right )^{2} - {\left (2 \, a^{3} + 2 \, a b^{2} - 3 \, {\left (a^{2} b + b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - {\left ({\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (3 \, a^{2} b + b^{3}\right )} \sinh \left (x\right )^{4} + 3 \, a^{2} b + b^{3} + 2 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, a^{2} b + b^{3} + 3 \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{3} + {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - {\left (a^{2} b + b^{3}\right )} \cosh \left (x\right ) + {\left (a^{3} \cosh \left (x\right )^{4} + 4 \, a^{3} \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{3} \sinh \left (x\right )^{4} + 2 \, a^{3} \cosh \left (x\right )^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \left (x\right )^{2} + a^{3}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (a^{3} \cosh \left (x\right )^{3} + a^{3} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left (a^{3} \cosh \left (x\right )^{4} + 4 \, a^{3} \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{3} \sinh \left (x\right )^{4} + 2 \, a^{3} \cosh \left (x\right )^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \left (x\right )^{2} + a^{3}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (a^{3} \cosh \left (x\right )^{3} + a^{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 (a^{2} b + b^{3} - 3 \, {\left (a^{2} b + b^{3}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (a^{3} + a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{4} + a^{4} + 2 \, a^{2} b^{2} + b^{4} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4} + 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{3} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\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 \frac {\tanh ^{3}{\left (x \right )}}{a + b \sinh {\left (x \right )}}\, 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. 211 vs.
\(2 (85) = 170\).
time = 0.42, size = 211, normalized size = 2.40 \begin {gather*} -\frac {a^{3} b \log \left ({\left | -b {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{a^{4} b + 2 \, a^{2} b^{3} + b^{5}} + \frac {a^{3} \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}} + \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} {\left (3 \, a^{2} b + b^{3}\right )}}{4 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}} - \frac {a^{3} {\left (e^{\left (-x\right )} - e^{x}\right )}^{2} - 2 \, a^{2} b {\left (e^{\left (-x\right )} - e^{x}\right )} - 2 \, b^{3} {\left (e^{\left (-x\right )} - e^{x}\right )} - 4 \, a b^{2}}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} {\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 = 2.28, size = 291, normalized size = 3.31 \begin {gather*} \frac {\frac {2\,\left (a^3+a\,b^2\right )}{{\left (a^2+b^2\right )}^2}-\frac {{\mathrm {e}}^x\,\left (a^2\,b+b^3\right )}{{\left (a^2+b^2\right )}^2}}{{\mathrm {e}}^{2\,x}+1}-\frac {\frac {2\,a}{a^2+b^2}-\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}+\frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )\,\left (2\,a+b\,1{}\mathrm {i}\right )}{2\,\left (a^2+a\,b\,2{}\mathrm {i}-b^2\right )}-\frac {a^3\,\ln \left (b^7\,{\mathrm {e}}^{2\,x}-16\,a^6\,b-b^7-6\,a^2\,b^5-9\,a^4\,b^3+32\,a^7\,{\mathrm {e}}^x+6\,a^2\,b^5\,{\mathrm {e}}^{2\,x}+9\,a^4\,b^3\,{\mathrm {e}}^{2\,x}+2\,a\,b^6\,{\mathrm {e}}^x+16\,a^6\,b\,{\mathrm {e}}^{2\,x}+12\,a^3\,b^4\,{\mathrm {e}}^x+18\,a^5\,b^2\,{\mathrm {e}}^x\right )}{a^4+2\,a^2\,b^2+b^4}+\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,\left (b+a\,2{}\mathrm {i}\right )}{2\,\left (a^2\,1{}\mathrm {i}+2\,a\,b-b^2\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________