Optimal. Leaf size=124 \[ -\frac {2 a^4 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}-\frac {a^2 b \text {sech}(x)}{\left (a^2+b^2\right )^2}-\frac {b \text {sech}(x)}{a^2+b^2}+\frac {b \text {sech}^3(x)}{3 \left (a^2+b^2\right )}-\frac {a^3 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac {a \tanh ^3(x)}{3 \left (a^2+b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 9, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {2806, 2687,
30, 2686, 3852, 8, 2739, 632, 212} \begin {gather*} -\frac {a \tanh ^3(x)}{3 \left (a^2+b^2\right )}+\frac {b \text {sech}^3(x)}{3 \left (a^2+b^2\right )}-\frac {a^2 b \text {sech}(x)}{\left (a^2+b^2\right )^2}-\frac {b \text {sech}(x)}{a^2+b^2}-\frac {2 a^4 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}-\frac {a^3 \tanh (x)}{\left (a^2+b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 212
Rule 632
Rule 2686
Rule 2687
Rule 2739
Rule 2806
Rule 3852
Rubi steps
\begin {align*} \int \frac {\tanh ^4(x)}{a+b \sinh (x)} \, dx &=-\frac {a \int \text {sech}^2(x) \tanh ^2(x) \, dx}{a^2+b^2}+\frac {a^2 \int \frac {\tanh ^2(x)}{a+b \sinh (x)} \, dx}{a^2+b^2}+\frac {b \int \text {sech}(x) \tanh ^3(x) \, dx}{a^2+b^2}\\ &=-\frac {a^3 \int \text {sech}^2(x) \, dx}{\left (a^2+b^2\right )^2}+\frac {a^4 \int \frac {1}{a+b \sinh (x)} \, dx}{\left (a^2+b^2\right )^2}+\frac {\left (a^2 b\right ) \int \text {sech}(x) \tanh (x) \, dx}{\left (a^2+b^2\right )^2}-\frac {(i a) \text {Subst}\left (\int x^2 \, dx,x,i \tanh (x)\right )}{a^2+b^2}+\frac {b \text {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\text {sech}(x)\right )}{a^2+b^2}\\ &=-\frac {b \text {sech}(x)}{a^2+b^2}+\frac {b \text {sech}^3(x)}{3 \left (a^2+b^2\right )}-\frac {a \tanh ^3(x)}{3 \left (a^2+b^2\right )}-\frac {\left (i a^3\right ) \text {Subst}(\int 1 \, dx,x,-i \tanh (x))}{\left (a^2+b^2\right )^2}+\frac {\left (2 a^4\right ) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{\left (a^2+b^2\right )^2}-\frac {\left (a^2 b\right ) \text {Subst}(\int 1 \, dx,x,\text {sech}(x))}{\left (a^2+b^2\right )^2}\\ &=-\frac {a^2 b \text {sech}(x)}{\left (a^2+b^2\right )^2}-\frac {b \text {sech}(x)}{a^2+b^2}+\frac {b \text {sech}^3(x)}{3 \left (a^2+b^2\right )}-\frac {a^3 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac {a \tanh ^3(x)}{3 \left (a^2+b^2\right )}-\frac {\left (4 a^4\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{\left (a^2+b^2\right )^2}\\ &=-\frac {2 a^4 \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}-\frac {a^2 b \text {sech}(x)}{\left (a^2+b^2\right )^2}-\frac {b \text {sech}(x)}{a^2+b^2}+\frac {b \text {sech}^3(x)}{3 \left (a^2+b^2\right )}-\frac {a^3 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac {a \tanh ^3(x)}{3 \left (a^2+b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 108, normalized size = 0.87 \begin {gather*} \frac {\frac {6 a^4 \text {ArcTan}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}-3 b \left (2 a^2+b^2\right ) \text {sech}(x)+\left (a^2+b^2\right ) \text {sech}^3(x) (b+a \sinh (x))-a \left (4 a^2+b^2\right ) \tanh (x)}{3 \left (a^2+b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.53, size = 163, normalized size = 1.31
method | result | size |
default | \(\frac {-2 a^{3} \left (\tanh ^{5}\left (\frac {x}{2}\right )\right )-2 a^{2} b \left (\tanh ^{4}\left (\frac {x}{2}\right )\right )+2 \left (-\frac {10}{3} a^{3}-\frac {4}{3} a \,b^{2}\right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )+2 \left (-4 a^{2} b -2 b^{3}\right ) \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 a^{3} \tanh \left (\frac {x}{2}\right )-\frac {10 a^{2} b}{3}-\frac {4 b^{3}}{3}}{\left (a^{2}+b^{2}\right )^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}+\frac {32 a^{4} \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (16 a^{4}+32 a^{2} b^{2}+16 b^{4}\right ) \sqrt {a^{2}+b^{2}}}\) | \(163\) |
risch | \(\frac {-4 a^{2} b \,{\mathrm e}^{5 x}-2 b^{3} {\mathrm e}^{5 x}+4 a^{3} {\mathrm e}^{4 x}+2 a \,b^{2} {\mathrm e}^{4 x}-\frac {16 a^{2} b \,{\mathrm e}^{3 x}}{3}-\frac {4 b^{3} {\mathrm e}^{3 x}}{3}+4 a^{3} {\mathrm e}^{2 x}-4 a^{2} b \,{\mathrm e}^{x}-2 b^{3} {\mathrm e}^{x}+\frac {8 a^{3}}{3}+\frac {2 a \,b^{2}}{3}}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (1+{\mathrm e}^{2 x}\right )^{3}}+\frac {a^{4} \ln \left ({\mathrm e}^{x}+\frac {\left (a^{2}+b^{2}\right )^{\frac {5}{2}} a -a^{6}-3 a^{4} b^{2}-3 a^{2} b^{4}-b^{6}}{b \left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}-\frac {a^{4} \ln \left ({\mathrm e}^{x}+\frac {\left (a^{2}+b^{2}\right )^{\frac {5}{2}} a +a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}{b \left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\) | \(254\) |
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. 241 vs.
\(2 (116) = 232\).
time = 0.49, size = 241, normalized size = 1.94 \begin {gather*} \frac {a^{4} \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (6 \, a^{3} e^{\left (-2 \, x\right )} + 4 \, a^{3} + a b^{2} + 3 \, {\left (2 \, a^{2} b + b^{3}\right )} e^{\left (-x\right )} + 2 \, {\left (4 \, a^{2} b + b^{3}\right )} e^{\left (-3 \, x\right )} + 3 \, {\left (2 \, a^{3} + a b^{2}\right )} e^{\left (-4 \, x\right )} + 3 \, {\left (2 \, a^{2} b + b^{3}\right )} e^{\left (-5 \, x\right )}\right )}}{3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4} + 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} e^{\left (-2 \, x\right )} + 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} e^{\left (-4 \, x\right )} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} e^{\left (-6 \, x\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. 1199 vs.
\(2 (116) = 232\).
time = 0.35, size = 1199, normalized size = 9.67 \begin {gather*} -\frac {6 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{5} + 6 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \sinh \left (x\right )^{5} - 8 \, a^{5} - 10 \, a^{3} b^{2} - 2 \, a b^{4} - 6 \, {\left (2 \, a^{5} + 3 \, a^{3} b^{2} + a b^{4}\right )} \cosh \left (x\right )^{4} - 6 \, {\left (2 \, a^{5} + 3 \, a^{3} b^{2} + a b^{4} - 5 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{4} + 4 \, {\left (4 \, a^{4} b + 5 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{3} + 4 \, {\left (4 \, a^{4} b + 5 \, a^{2} b^{3} + b^{5} + 15 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{2} - 6 \, {\left (2 \, a^{5} + 3 \, a^{3} b^{2} + a b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 12 \, {\left (a^{5} + a^{3} b^{2}\right )} \cosh \left (x\right )^{2} - 12 \, {\left (a^{5} + a^{3} b^{2} - 5 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{3} + 3 \, {\left (2 \, a^{5} + 3 \, a^{3} b^{2} + a b^{4}\right )} \cosh \left (x\right )^{2} - {\left (4 \, a^{4} b + 5 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 3 \, {\left (a^{4} \cosh \left (x\right )^{6} + 6 \, a^{4} \cosh \left (x\right ) \sinh \left (x\right )^{5} + a^{4} \sinh \left (x\right )^{6} + 3 \, a^{4} \cosh \left (x\right )^{4} + 3 \, a^{4} \cosh \left (x\right )^{2} + 3 \, {\left (5 \, a^{4} \cosh \left (x\right )^{2} + a^{4}\right )} \sinh \left (x\right )^{4} + a^{4} + 4 \, {\left (5 \, a^{4} \cosh \left (x\right )^{3} + 3 \, a^{4} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + 3 \, {\left (5 \, a^{4} \cosh \left (x\right )^{4} + 6 \, a^{4} \cosh \left (x\right )^{2} + a^{4}\right )} \sinh \left (x\right )^{2} + 6 \, {\left (a^{4} \cosh \left (x\right )^{5} + 2 \, a^{4} \cosh \left (x\right )^{3} + a^{4} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) - b}\right ) + 6 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right ) + 6 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5} + 5 \, {\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{4} - 4 \, {\left (2 \, a^{5} + 3 \, a^{3} b^{2} + a b^{4}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (4 \, a^{4} b + 5 \, a^{2} b^{3} + b^{5}\right )} \cosh \left (x\right )^{2} - 4 \, {\left (a^{5} + a^{3} b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{3 \, {\left ({\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{6} + 6 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{5} + {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sinh \left (x\right )^{6} + a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6} + 3 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{4} + 3 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6} + 5 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{4} + 4 \, {\left (5 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{3} + 3 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + 3 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{2} + 3 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6} + 5 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{4} + 6 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 6 \, {\left ({\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{5} + 2 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )^{3} + {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\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 ^{4}{\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 [A]
time = 0.43, size = 197, normalized size = 1.59 \begin {gather*} \frac {a^{4} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (6 \, a^{2} b e^{\left (5 \, x\right )} + 3 \, b^{3} e^{\left (5 \, x\right )} - 6 \, a^{3} e^{\left (4 \, x\right )} - 3 \, a b^{2} e^{\left (4 \, x\right )} + 8 \, a^{2} b e^{\left (3 \, x\right )} + 2 \, b^{3} e^{\left (3 \, x\right )} - 6 \, a^{3} e^{\left (2 \, x\right )} + 6 \, a^{2} b e^{x} + 3 \, b^{3} e^{x} - 4 \, a^{3} - a b^{2}\right )}}{3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.47, size = 654, normalized size = 5.27 \begin {gather*} \frac {\frac {2\,a\,\left (2\,a^2+b^2\right )}{{\left (a^2+b^2\right )}^2}-\frac {2\,b\,{\mathrm {e}}^x\,\left (2\,a^2+b^2\right )}{{\left (a^2+b^2\right )}^2}}{{\mathrm {e}}^{2\,x}+1}-\frac {\frac {4\,\left (a^3+a\,b^2\right )}{{\left (a^2+b^2\right )}^2}-\frac {8\,{\mathrm {e}}^x\,\left (a^2\,b+b^3\right )}{3\,{\left (a^2+b^2\right )}^2}}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}+\frac {\frac {8\,a}{3\,\left (a^2+b^2\right )}-\frac {8\,b\,{\mathrm {e}}^x}{3\,\left (a^2+b^2\right )}}{3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1}-\frac {2\,\mathrm {atan}\left (\left ({\mathrm {e}}^x\,\left (\frac {2\,a^4}{b^2\,\sqrt {a^8}\,{\left (a^2+b^2\right )}^2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {2\,\left (a^5\,\sqrt {a^8}+2\,a^3\,b^2\,\sqrt {a^8}+a\,b^4\,\sqrt {a^8}\right )}{a^3\,b^2\,\sqrt {-{\left (a^2+b^2\right )}^5}\,\left (a^4+2\,a^2\,b^2+b^4\right )\,\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}}\right )-\frac {2\,\left (b^5\,\sqrt {a^8}+2\,a^2\,b^3\,\sqrt {a^8}+a^4\,b\,\sqrt {a^8}\right )}{a^3\,b^2\,\sqrt {-{\left (a^2+b^2\right )}^5}\,\left (a^4+2\,a^2\,b^2+b^4\right )\,\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}}\right )\,\left (\frac {b^5\,\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}}{2}+\frac {a^4\,b\,\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}}{2}+a^2\,b^3\,\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}\right )\right )\,\sqrt {a^8}}{\sqrt {-a^{10}-5\,a^8\,b^2-10\,a^6\,b^4-10\,a^4\,b^6-5\,a^2\,b^8-b^{10}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________