Optimal. Leaf size=183 \[ \frac{b^4 x}{a \left (a^2+b^2\right )^2}+\frac{a b^2 x}{\left (a^2+b^2\right )^2}+\frac{a x}{a^2+b^2}+\frac{2 b^5 \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2}}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}-\frac{a b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{b \text{sech}^3(x)}{3 \left (a^2+b^2\right )}+\frac{b^3 \text{sech}(x)}{\left (a^2+b^2\right )^2}+\frac{b \text{sech}(x)}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.384148, antiderivative size = 183, normalized size of antiderivative = 1., number of steps used = 16, number of rules used = 9, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.692, Rules used = {3898, 2902, 2606, 3473, 8, 2735, 2660, 618, 204} \[ \frac{b^4 x}{a \left (a^2+b^2\right )^2}+\frac{a b^2 x}{\left (a^2+b^2\right )^2}+\frac{a x}{a^2+b^2}+\frac{2 b^5 \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2}}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}-\frac{a b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{b \text{sech}^3(x)}{3 \left (a^2+b^2\right )}+\frac{b^3 \text{sech}(x)}{\left (a^2+b^2\right )^2}+\frac{b \text{sech}(x)}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3898
Rule 2902
Rule 2606
Rule 3473
Rule 8
Rule 2735
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\tanh ^4(x)}{a+b \text{csch}(x)} \, dx &=i \int \frac{\sinh (x) \tanh ^4(x)}{i b+i a \sinh (x)} \, dx\\ &=\frac{a \int \tanh ^4(x) \, dx}{a^2+b^2}-\frac{b \int \text{sech}(x) \tanh ^3(x) \, dx}{a^2+b^2}+\frac{\left (i b^2\right ) \int \frac{\sinh (x) \tanh ^2(x)}{i b+i a \sinh (x)} \, dx}{a^2+b^2}\\ &=-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}+\frac{\left (a b^2\right ) \int \tanh ^2(x) \, dx}{\left (a^2+b^2\right )^2}-\frac{b^3 \int \text{sech}(x) \tanh (x) \, dx}{\left (a^2+b^2\right )^2}+\frac{\left (i b^4\right ) \int \frac{\sinh (x)}{i b+i a \sinh (x)} \, dx}{\left (a^2+b^2\right )^2}+\frac{a \int \tanh ^2(x) \, dx}{a^2+b^2}-\frac{b \operatorname{Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\text{sech}(x)\right )}{a^2+b^2}\\ &=\frac{b^4 x}{a \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 b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}+\frac{\left (a b^2\right ) \int 1 \, dx}{\left (a^2+b^2\right )^2}+\frac{b^3 \operatorname{Subst}(\int 1 \, dx,x,\text{sech}(x))}{\left (a^2+b^2\right )^2}-\frac{\left (i b^5\right ) \int \frac{1}{i b+i a \sinh (x)} \, dx}{a \left (a^2+b^2\right )^2}+\frac{a \int 1 \, dx}{a^2+b^2}\\ &=\frac{a b^2 x}{\left (a^2+b^2\right )^2}+\frac{b^4 x}{a \left (a^2+b^2\right )^2}+\frac{a x}{a^2+b^2}+\frac{b^3 \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 b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}-\frac{\left (2 i b^5\right ) \operatorname{Subst}\left (\int \frac{1}{i b+2 i a x-i b x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{a \left (a^2+b^2\right )^2}\\ &=\frac{a b^2 x}{\left (a^2+b^2\right )^2}+\frac{b^4 x}{a \left (a^2+b^2\right )^2}+\frac{a x}{a^2+b^2}+\frac{b^3 \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 b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}+\frac{\left (4 i b^5\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2+b^2\right )-x^2} \, dx,x,2 i a-2 i b \tanh \left (\frac{x}{2}\right )\right )}{a \left (a^2+b^2\right )^2}\\ &=\frac{a b^2 x}{\left (a^2+b^2\right )^2}+\frac{b^4 x}{a \left (a^2+b^2\right )^2}+\frac{a x}{a^2+b^2}+\frac{2 b^5 \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2}}+\frac{b^3 \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 b^2 \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{a \tanh (x)}{a^2+b^2}-\frac{a \tanh ^3(x)}{3 \left (a^2+b^2\right )}\\ \end{align*}
Mathematica [A] time = 0.695776, size = 141, normalized size = 0.77 \[ \frac{1}{3} \left (-\frac{a \left (4 a^2+7 b^2\right ) \tanh (x)}{\left (a^2+b^2\right )^2}-\frac{b \text{sech}^3(x)}{a^2+b^2}+\frac{3 b \left (a^2+2 b^2\right ) \text{sech}(x)}{\left (a^2+b^2\right )^2}+\frac{3 \left (x-\frac{2 b^5 \tan ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{-a^2-b^2}}\right )}{\left (-a^2-b^2\right )^{5/2}}\right )}{a}+\frac{a \tanh (x) \text{sech}^2(x)}{a^2+b^2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.053, size = 207, normalized size = 1.1 \begin{align*}{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-2\,{\frac{{b}^{5}}{a \left ({a}^{4}+2\,{a}^{2}{b}^{2}+{b}^{4} \right ) \sqrt{{a}^{2}+{b}^{2}}}{\it Artanh} \left ( 1/2\,{\frac{2\,\tanh \left ( x/2 \right ) b-2\,a}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }-{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+2\,{\frac{ \left ( -{a}^{3}-2\,a{b}^{2} \right ) \left ( \tanh \left ( x/2 \right ) \right ) ^{5}+{b}^{3} \left ( \tanh \left ( x/2 \right ) \right ) ^{4}+ \left ( -10/3\,{a}^{3}-16/3\,a{b}^{2} \right ) \left ( \tanh \left ( x/2 \right ) \right ) ^{3}+ \left ( 2\,{a}^{2}b+4\,{b}^{3} \right ) \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+ \left ( -{a}^{3}-2\,a{b}^{2} \right ) \tanh \left ( x/2 \right ) +2/3\,{a}^{2}b+5/3\,{b}^{3}}{ \left ({a}^{4}+2\,{a}^{2}{b}^{2}+{b}^{4} \right ) \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.85507, size = 4128, normalized size = 22.56 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tanh ^{4}{\left (x \right )}}{a + b \operatorname{csch}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.20349, size = 290, normalized size = 1.58 \begin{align*} -\frac{b^{5} \log \left (\frac{{\left | 2 \, a e^{x} + 2 \, b - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, a e^{x} + 2 \, b + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{{\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \sqrt{a^{2} + b^{2}}} + \frac{x}{a} + \frac{2 \,{\left (3 \, a^{2} b e^{\left (5 \, x\right )} + 6 \, b^{3} e^{\left (5 \, x\right )} + 6 \, a^{3} e^{\left (4 \, x\right )} + 9 \, a b^{2} e^{\left (4 \, x\right )} + 2 \, a^{2} b e^{\left (3 \, x\right )} + 8 \, b^{3} e^{\left (3 \, x\right )} + 6 \, a^{3} e^{\left (2 \, x\right )} + 12 \, a b^{2} e^{\left (2 \, x\right )} + 3 \, a^{2} b e^{x} + 6 \, b^{3} e^{x} + 4 \, a^{3} + 7 \, 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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]