Optimal. Leaf size=146 \[ \frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {2 b^5 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^5 \sqrt {a-b} \sqrt {a+b}}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.45, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3938, 4189,
4004, 3916, 2738, 211} \begin {gather*} -\frac {2 b^5 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^5 \sqrt {a-b} \sqrt {a+b}}-\frac {b \sinh (x) \cosh ^2(x)}{3 a^2}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \sinh (x) \cosh (x)}{8 a^3}+\frac {x \left (3 a^4+4 a^2 b^2+8 b^4\right )}{8 a^5}+\frac {\sinh (x) \cosh ^3(x)}{4 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 2738
Rule 3916
Rule 3938
Rule 4004
Rule 4189
Rubi steps
\begin {align*} \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx &=\frac {\cosh ^3(x) \sinh (x)}{4 a}+\frac {\int \frac {\cosh ^3(x) \left (-4 b+3 a \text {sech}(x)+3 b \text {sech}^2(x)\right )}{a+b \text {sech}(x)} \, dx}{4 a}\\ &=-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}-\frac {\int \frac {\cosh ^2(x) \left (-3 \left (3 a^2+4 b^2\right )-a b \text {sech}(x)+8 b^2 \text {sech}^2(x)\right )}{a+b \text {sech}(x)} \, dx}{12 a^2}\\ &=\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}+\frac {\int \frac {\cosh (x) \left (-8 b \left (2 a^2+3 b^2\right )+a \left (9 a^2-4 b^2\right ) \text {sech}(x)+3 b \left (3 a^2+4 b^2\right ) \text {sech}^2(x)\right )}{a+b \text {sech}(x)} \, dx}{24 a^3}\\ &=-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}-\frac {\int \frac {-3 \left (3 a^4+4 a^2 b^2+8 b^4\right )-3 a b \left (3 a^2+4 b^2\right ) \text {sech}(x)}{a+b \text {sech}(x)} \, dx}{24 a^4}\\ &=\frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}-\frac {b^5 \int \frac {\text {sech}(x)}{a+b \text {sech}(x)} \, dx}{a^5}\\ &=\frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}-\frac {b^4 \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{a^5}\\ &=\frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}-\frac {\left (2 b^4\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}-\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^5}\\ &=\frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {2 b^5 \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^5 \sqrt {a-b} \sqrt {a+b}}-\frac {b \left (2 a^2+3 b^2\right ) \sinh (x)}{3 a^4}+\frac {\left (3 a^2+4 b^2\right ) \cosh (x) \sinh (x)}{8 a^3}-\frac {b \cosh ^2(x) \sinh (x)}{3 a^2}+\frac {\cosh ^3(x) \sinh (x)}{4 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.19, size = 126, normalized size = 0.86 \begin {gather*} \frac {12 \left (3 a^4+4 a^2 b^2+8 b^4\right ) x+\frac {192 b^5 \text {ArcTan}\left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}-24 a b \left (3 a^2+4 b^2\right ) \sinh (x)+24 a^2 \left (a^2+b^2\right ) \sinh (2 x)-8 a^3 b \sinh (3 x)+3 a^4 \sinh (4 x)}{96 a^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(298\) vs.
\(2(126)=252\).
time = 0.84, size = 299, normalized size = 2.05
method | result | size |
risch | \(\frac {3 x}{8 a}+\frac {x \,b^{2}}{2 a^{3}}+\frac {x \,b^{4}}{a^{5}}+\frac {{\mathrm e}^{4 x}}{64 a}-\frac {b \,{\mathrm e}^{3 x}}{24 a^{2}}+\frac {{\mathrm e}^{2 x}}{8 a}+\frac {{\mathrm e}^{2 x} b^{2}}{8 a^{3}}-\frac {3 b \,{\mathrm e}^{x}}{8 a^{2}}-\frac {b^{3} {\mathrm e}^{x}}{2 a^{4}}+\frac {3 b \,{\mathrm e}^{-x}}{8 a^{2}}+\frac {b^{3} {\mathrm e}^{-x}}{2 a^{4}}-\frac {{\mathrm e}^{-2 x}}{8 a}-\frac {{\mathrm e}^{-2 x} b^{2}}{8 a^{3}}+\frac {b \,{\mathrm e}^{-3 x}}{24 a^{2}}-\frac {{\mathrm e}^{-4 x}}{64 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}}\, a^{5}}+\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}}\, a^{5}}\) | \(264\) |
default | \(\frac {1}{4 a \left (\tanh \left (\frac {x}{2}\right )-1\right )^{4}}-\frac {-3 a -2 b}{6 a^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )^{3}}-\frac {-7 a^{2}-4 a b -4 b^{2}}{8 a^{3} \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {\left (-3 a^{4}-4 a^{2} b^{2}-8 b^{4}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 a^{5}}-\frac {-5 a^{3}-8 a^{2} b -4 a \,b^{2}-8 b^{3}}{8 a^{4} \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {1}{4 a \left (\tanh \left (\frac {x}{2}\right )+1\right )^{4}}-\frac {-3 a -2 b}{6 a^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {7 a^{2}+4 a b +4 b^{2}}{8 a^{3} \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {\left (3 a^{4}+4 a^{2} b^{2}+8 b^{4}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{8 a^{5}}-\frac {-5 a^{3}-8 a^{2} b -4 a \,b^{2}-8 b^{3}}{8 a^{4} \left (\tanh \left (\frac {x}{2}\right )+1\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 )}{a^{5} \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(299\) |
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. 1161 vs.
\(2 (126) = 252\).
time = 0.41, size = 2402, normalized size = 16.45 \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 {\cosh ^{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.40, size = 182, normalized size = 1.25 \begin {gather*} -\frac {2 \, b^{5} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a^{5}} + \frac {3 \, a^{3} e^{\left (4 \, x\right )} - 8 \, a^{2} b e^{\left (3 \, x\right )} + 24 \, a^{3} e^{\left (2 \, x\right )} + 24 \, a b^{2} e^{\left (2 \, x\right )} - 72 \, a^{2} b e^{x} - 96 \, b^{3} e^{x}}{192 \, a^{4}} + \frac {{\left (3 \, a^{4} + 4 \, a^{2} b^{2} + 8 \, b^{4}\right )} x}{8 \, a^{5}} + \frac {{\left (8 \, a^{3} b e^{x} - 3 \, a^{4} + 24 \, {\left (3 \, a^{3} b + 4 \, a b^{3}\right )} e^{\left (3 \, x\right )} - 24 \, {\left (a^{4} + a^{2} b^{2}\right )} e^{\left (2 \, x\right )}\right )} e^{\left (-4 \, x\right )}}{192 \, a^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.85, size = 251, normalized size = 1.72 \begin {gather*} \frac {{\mathrm {e}}^{4\,x}}{64\,a}-\frac {{\mathrm {e}}^{-4\,x}}{64\,a}+\frac {x\,\left (3\,a^4+4\,a^2\,b^2+8\,b^4\right )}{8\,a^5}-\frac {{\mathrm {e}}^{-2\,x}\,\left (a^2+b^2\right )}{8\,a^3}+\frac {{\mathrm {e}}^{2\,x}\,\left (a^2+b^2\right )}{8\,a^3}+\frac {{\mathrm {e}}^{-x}\,\left (3\,a^2\,b+4\,b^3\right )}{8\,a^4}+\frac {b\,{\mathrm {e}}^{-3\,x}}{24\,a^2}-\frac {b\,{\mathrm {e}}^{3\,x}}{24\,a^2}-\frac {{\mathrm {e}}^x\,\left (3\,a^2\,b+4\,b^3\right )}{8\,a^4}+\frac {b^5\,\ln \left (\frac {2\,b^5\,{\mathrm {e}}^x}{a^6}-\frac {2\,b^5\,\left (a+b\,{\mathrm {e}}^x\right )}{a^6\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a^5\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {b^5\,\ln \left (\frac {2\,b^5\,{\mathrm {e}}^x}{a^6}+\frac {2\,b^5\,\left (a+b\,{\mathrm {e}}^x\right )}{a^6\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a^5\,\sqrt {a+b}\,\sqrt {b-a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________