Optimal. Leaf size=207 \[ -\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 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2}}+\frac {a b^2 \coth (x)}{\left (a^2-b^2\right )^2}-\frac {a \coth (x)}{a^2-b^2}-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}-\frac {b^3 \text {csch}(x)}{\left (a^2-b^2\right )^2}+\frac {b \text {csch}(x)}{a^2-b^2}+\frac {b \text {csch}^3(x)}{3 \left (a^2-b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 207, normalized size of antiderivative = 1.00, number of steps
used = 15, number of rules used = 8, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {3983, 2981,
2686, 3554, 8, 2814, 2738, 211} \begin {gather*} -\frac {a b^2 x}{\left (a^2-b^2\right )^2}+\frac {a x}{a^2-b^2}-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}+\frac {a b^2 \coth (x)}{\left (a^2-b^2\right )^2}-\frac {a \coth (x)}{a^2-b^2}+\frac {b \text {csch}^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \text {csch}(x)}{a^2-b^2}+\frac {b^4 x}{a \left (a^2-b^2\right )^2}-\frac {b^3 \text {csch}(x)}{\left (a^2-b^2\right )^2}-\frac {2 b^5 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 211
Rule 2686
Rule 2738
Rule 2814
Rule 2981
Rule 3554
Rule 3983
Rubi steps
\begin {align*} \int \frac {\coth ^4(x)}{a+b \text {sech}(x)} \, dx &=\int \frac {\cosh (x) \coth ^4(x)}{b+a \cosh (x)} \, dx\\ &=\frac {a \int \coth ^4(x) \, dx}{a^2-b^2}-\frac {b \int \coth ^3(x) \text {csch}(x) \, dx}{a^2-b^2}-\frac {b^2 \int \frac {\cosh (x) \coth ^2(x)}{b+a \cosh (x)} \, dx}{a^2-b^2}\\ &=-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}-\frac {\left (a b^2\right ) \int \coth ^2(x) \, dx}{\left (a^2-b^2\right )^2}+\frac {b^3 \int \coth (x) \text {csch}(x) \, dx}{\left (a^2-b^2\right )^2}+\frac {b^4 \int \frac {\cosh (x)}{b+a \cosh (x)} \, dx}{\left (a^2-b^2\right )^2}+\frac {a \int \coth ^2(x) \, dx}{a^2-b^2}-\frac {(i b) \text {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,-i \text {csch}(x)\right )}{a^2-b^2}\\ &=\frac {b^4 x}{a \left (a^2-b^2\right )^2}+\frac {a b^2 \coth (x)}{\left (a^2-b^2\right )^2}-\frac {a \coth (x)}{a^2-b^2}-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \text {csch}(x)}{a^2-b^2}+\frac {b \text {csch}^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 {\left (i b^3\right ) \text {Subst}(\int 1 \, dx,x,-i \text {csch}(x))}{\left (a^2-b^2\right )^2}-\frac {b^5 \int \frac {1}{b+a \cosh (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 {a b^2 \coth (x)}{\left (a^2-b^2\right )^2}-\frac {a \coth (x)}{a^2-b^2}-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}-\frac {b^3 \text {csch}(x)}{\left (a^2-b^2\right )^2}+\frac {b \text {csch}(x)}{a^2-b^2}+\frac {b \text {csch}^3(x)}{3 \left (a^2-b^2\right )}-\frac {\left (2 b^5\right ) \text {Subst}\left (\int \frac {1}{a+b-(-a+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 {2 b^5 \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a (a-b)^{5/2} (a+b)^{5/2}}+\frac {a b^2 \coth (x)}{\left (a^2-b^2\right )^2}-\frac {a \coth (x)}{a^2-b^2}-\frac {a \coth ^3(x)}{3 \left (a^2-b^2\right )}-\frac {b^3 \text {csch}(x)}{\left (a^2-b^2\right )^2}+\frac {b \text {csch}(x)}{a^2-b^2}+\frac {b \text {csch}^3(x)}{3 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.51, size = 166, normalized size = 0.80 \begin {gather*} \frac {(b+a \cosh (x)) \text {sech}(x) \left (\frac {24 x}{a}+\frac {48 b^5 \text {ArcTan}\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 {2 (8 a+11 b) \coth \left (\frac {x}{2}\right )}{(a+b)^2}+\frac {8 \text {csch}^3(x) \sinh ^4\left (\frac {x}{2}\right )}{a-b}-\frac {\text {csch}^4\left (\frac {x}{2}\right ) \sinh (x)}{2 (a+b)}-\frac {16 a \tanh \left (\frac {x}{2}\right )}{(a-b)^2}+\frac {22 b \tanh \left (\frac {x}{2}\right )}{(a-b)^2}\right )}{24 (a+b \text {sech}(x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.92, size = 153, normalized size = 0.74
method | result | size |
default | \(-\frac {\frac {a \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{3}-\frac {b \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{3}+5 a \tanh \left (\frac {x}{2}\right )-7 b \tanh \left (\frac {x}{2}\right )}{8 \left (a -b \right )^{2}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {1}{24 \left (a +b \right ) \tanh \left (\frac {x}{2}\right )^{3}}-\frac {5 a +7 b}{8 \left (a +b \right )^{2} \tanh \left (\frac {x}{2}\right )}-\frac {2 b^{5} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2} a \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(153\) |
risch | \(\frac {x}{a}-\frac {2 \left (-3 a^{2} b \,{\mathrm e}^{5 x}+6 b^{3} {\mathrm e}^{5 x}+6 a^{3} {\mathrm e}^{4 x}-9 a \,b^{2} {\mathrm e}^{4 x}+2 a^{2} b \,{\mathrm e}^{3 x}-8 b^{3} {\mathrm e}^{3 x}-6 a^{3} {\mathrm e}^{2 x}+12 a \,b^{2} {\mathrm e}^{2 x}-3 a^{2} b \,{\mathrm e}^{x}+6 b^{3} {\mathrm e}^{x}+4 a^{3}-7 a \,b^{2}\right )}{3 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \left ({\mathrm e}^{2 x}-1\right )^{3}}-\frac {b^{5} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a}+\frac {b^{5} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} a}\) | \(280\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \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. 1725 vs.
\(2 (193) = 386\).
time = 0.43, size = 3530, normalized size = 17.05 \begin {gather*} \text {Too large to display} \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 {\coth ^{4}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.39, size = 190, normalized size = 0.92 \begin {gather*} -\frac {2 \, b^{5} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.83, size = 713, normalized size = 3.44 \begin {gather*} \frac {x}{a}-\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 {\frac {2\,\left (2\,a^4-3\,a^2\,b^2\right )}{a\,{\left (a^2-b^2\right )}^2}-\frac {2\,{\mathrm {e}}^x\,\left (a^2\,b-2\,b^3\right )}{{\left (a^2-b^2\right )}^2}}{{\mathrm {e}}^{2\,x}-1}-\frac {\frac {4\,\left (a^4-a^2\,b^2\right )}{a\,{\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}}{{\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1}-\frac {2\,\mathrm {atan}\left (\left ({\mathrm {e}}^x\,\left (\frac {2\,b^5}{a^3\,{\left (a^2-b^2\right )}^2\,\sqrt {b^{10}}\,\left (a^5-2\,a^3\,b^2+a\,b^4\right )}+\frac {2\,\left (a\,b^5\,\sqrt {b^{10}}-2\,a^3\,b^3\,\sqrt {b^{10}}+a^5\,b\,\sqrt {b^{10}}\right )}{a^2\,b^4\,\sqrt {a^2\,{\left (a^2-b^2\right )}^5}\,\left (a^5-2\,a^3\,b^2+a\,b^4\right )\,\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}}\right )+\frac {2\,\left (a^6\,\sqrt {b^{10}}+a^2\,b^4\,\sqrt {b^{10}}-2\,a^4\,b^2\,\sqrt {b^{10}}\right )}{a^2\,b^4\,\sqrt {a^2\,{\left (a^2-b^2\right )}^5}\,\left (a^5-2\,a^3\,b^2+a\,b^4\right )\,\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}}\right )\,\left (\frac {a^6\,\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}}{2}+\frac {a^2\,b^4\,\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}}{2}-a^4\,b^2\,\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}\right )\right )\,\sqrt {b^{10}}}{\sqrt {a^{12}-5\,a^{10}\,b^2+10\,a^8\,b^4-10\,a^6\,b^6+5\,a^4\,b^8-a^2\,b^{10}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________