Integrand size = 13, antiderivative size = 146 \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\frac {\left (3 a^4+4 a^2 b^2+8 b^4\right ) x}{8 a^5}-\frac {2 b^5 \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]
Time = 0.45 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3938, 4189, 4004, 3916, 2738, 211} \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=-\frac {2 b^5 \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} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 3916
Rule 3938
Rule 4004
Rule 4189
Rubi steps \begin{align*} \text {integral}& = \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 \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} \\ \end{align*}
Time = 0.35 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.86 \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\frac {12 \left (3 a^4+4 a^2 b^2+8 b^4\right ) x+\frac {192 b^5 \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} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(263\) vs. \(2(126)=252\).
Time = 0.57 (sec) , antiderivative size = 264, normalized size of antiderivative = 1.81
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\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1161 vs. \(2 (126) = 252\).
Time = 0.29 (sec) , antiderivative size = 2402, normalized size of antiderivative = 16.45 \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\cosh ^{4}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 182, normalized size of antiderivative = 1.25 \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=-\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}} \]
[In]
[Out]
Time = 2.45 (sec) , antiderivative size = 251, normalized size of antiderivative = 1.72 \[ \int \frac {\cosh ^4(x)}{a+b \text {sech}(x)} \, dx=\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}} \]
[In]
[Out]