Integrand size = 13, antiderivative size = 82 \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=-\frac {\left (a^2-2 b^2\right ) x}{2 a^3}+\frac {2 \sqrt {a-b} b \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^3}-\frac {(2 b-a \cosh (x)) \sinh (x)}{2 a^2} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2944, 2814, 2738, 211} \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {2 b \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^3}-\frac {\sinh (x) (2 b-a \cosh (x))}{2 a^2}-\frac {x \left (a^2-2 b^2\right )}{2 a^3} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 2814
Rule 2944
Rule 3957
Rubi steps \begin{align*} \text {integral}& = -\int \frac {\cosh (x) \sinh ^2(x)}{-b-a \cosh (x)} \, dx \\ & = -\frac {(2 b-a \cosh (x)) \sinh (x)}{2 a^2}+\frac {\int \frac {-a b+\left (a^2-2 b^2\right ) \cosh (x)}{-b-a \cosh (x)} \, dx}{2 a^2} \\ & = -\frac {\left (a^2-2 b^2\right ) x}{2 a^3}-\frac {(2 b-a \cosh (x)) \sinh (x)}{2 a^2}-\frac {\left (b \left (a^2-b^2\right )\right ) \int \frac {1}{-b-a \cosh (x)} \, dx}{a^3} \\ & = -\frac {\left (a^2-2 b^2\right ) x}{2 a^3}-\frac {(2 b-a \cosh (x)) \sinh (x)}{2 a^2}-\frac {\left (2 b \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a-b-(a-b) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^3} \\ & = -\frac {\left (a^2-2 b^2\right ) x}{2 a^3}+\frac {2 \sqrt {a-b} b \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^3}-\frac {(2 b-a \cosh (x)) \sinh (x)}{2 a^2} \\ \end{align*}
Time = 0.18 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.93 \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {-2 a^2 x+4 b^2 x-8 b \sqrt {a^2-b^2} \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )-4 a b \sinh (x)+a^2 \sinh (2 x)}{4 a^3} \]
[In]
[Out]
Time = 2.28 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.59
method | result | size |
risch | \(-\frac {x}{2 a}+\frac {x \,b^{2}}{a^{3}}+\frac {{\mathrm e}^{2 x}}{8 a}-\frac {b \,{\mathrm e}^{x}}{2 a^{2}}+\frac {b \,{\mathrm e}^{-x}}{2 a^{2}}-\frac {{\mathrm e}^{-2 x}}{8 a}+\frac {\sqrt {-a^{2}+b^{2}}\, b \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{a^{3}}-\frac {\sqrt {-a^{2}+b^{2}}\, b \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{a^{3}}\) | \(130\) |
default | \(\frac {1}{2 a \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {\left (a^{2}-2 b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 a^{3}}-\frac {-a -2 b}{2 a^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {1}{2 a \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {-a -2 b}{2 a^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )}+\frac {\left (-a^{2}+2 b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 a^{3}}+\frac {2 b \left (a^{2}-b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{3} \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(160\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 228 vs. \(2 (67) = 134\).
Time = 0.28 (sec) , antiderivative size = 536, normalized size of antiderivative = 6.54 \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\left [\frac {a^{2} \cosh \left (x\right )^{4} + a^{2} \sinh \left (x\right )^{4} - 4 \, a b \cosh \left (x\right )^{3} - 4 \, {\left (a^{2} - 2 \, b^{2}\right )} x \cosh \left (x\right )^{2} + 4 \, {\left (a^{2} \cosh \left (x\right ) - a b\right )} \sinh \left (x\right )^{3} + 4 \, a b \cosh \left (x\right ) + 2 \, {\left (3 \, a^{2} \cosh \left (x\right )^{2} - 6 \, a b \cosh \left (x\right ) - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} x\right )} \sinh \left (x\right )^{2} + 8 \, {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2}\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {a^{2} \cosh \left (x\right )^{2} + a^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) - a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + b\right )}}{a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) + 2 \, {\left (a \cosh \left (x\right ) + b\right )} \sinh \left (x\right ) + a}\right ) - a^{2} + 4 \, {\left (a^{2} \cosh \left (x\right )^{3} - 3 \, a b \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} x \cosh \left (x\right ) + a b\right )} \sinh \left (x\right )}{8 \, {\left (a^{3} \cosh \left (x\right )^{2} + 2 \, a^{3} \cosh \left (x\right ) \sinh \left (x\right ) + a^{3} \sinh \left (x\right )^{2}\right )}}, \frac {a^{2} \cosh \left (x\right )^{4} + a^{2} \sinh \left (x\right )^{4} - 4 \, a b \cosh \left (x\right )^{3} - 4 \, {\left (a^{2} - 2 \, b^{2}\right )} x \cosh \left (x\right )^{2} + 4 \, {\left (a^{2} \cosh \left (x\right ) - a b\right )} \sinh \left (x\right )^{3} + 4 \, a b \cosh \left (x\right ) + 2 \, {\left (3 \, a^{2} \cosh \left (x\right )^{2} - 6 \, a b \cosh \left (x\right ) - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} x\right )} \sinh \left (x\right )^{2} - 16 \, {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cosh \left (x\right ) + a \sinh \left (x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right ) - a^{2} + 4 \, {\left (a^{2} \cosh \left (x\right )^{3} - 3 \, a b \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} x \cosh \left (x\right ) + a b\right )} \sinh \left (x\right )}{8 \, {\left (a^{3} \cosh \left (x\right )^{2} + 2 \, a^{3} \cosh \left (x\right ) \sinh \left (x\right ) + a^{3} \sinh \left (x\right )^{2}\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\sinh ^{2}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.22 \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {a e^{\left (2 \, x\right )} - 4 \, b e^{x}}{8 \, a^{2}} - \frac {{\left (a^{2} - 2 \, b^{2}\right )} x}{2 \, a^{3}} + \frac {{\left (4 \, a b e^{x} - a^{2}\right )} e^{\left (-2 \, x\right )}}{8 \, a^{3}} + \frac {2 \, {\left (a^{2} b - b^{3}\right )} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a^{3}} \]
[In]
[Out]
Time = 2.22 (sec) , antiderivative size = 173, normalized size of antiderivative = 2.11 \[ \int \frac {\sinh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {{\mathrm {e}}^{2\,x}}{8\,a}-\frac {{\mathrm {e}}^{-2\,x}}{8\,a}-\frac {b\,{\mathrm {e}}^x}{2\,a^2}+\frac {b\,{\mathrm {e}}^{-x}}{2\,a^2}-\frac {x\,\left (a^2-2\,b^2\right )}{2\,a^3}+\frac {b\,\ln \left (-\frac {2\,b\,{\mathrm {e}}^x\,\left (a^2-b^2\right )}{a^4}-\frac {2\,b\,\sqrt {a+b}\,\left (a+b\,{\mathrm {e}}^x\right )\,\sqrt {b-a}}{a^4}\right )\,\sqrt {a+b}\,\sqrt {b-a}}{a^3}-\frac {b\,\ln \left (\frac {2\,b\,\sqrt {a+b}\,\left (a+b\,{\mathrm {e}}^x\right )\,\sqrt {b-a}}{a^4}-\frac {2\,b\,{\mathrm {e}}^x\,\left (a^2-b^2\right )}{a^4}\right )\,\sqrt {a+b}\,\sqrt {b-a}}{a^3} \]
[In]
[Out]