Integrand size = 11, antiderivative size = 62 \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=-\frac {b x}{a^2}+\frac {2 b^2 \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}+\frac {\sinh (x)}{a} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 62, 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.455, Rules used = {3938, 12, 3868, 2738, 211} \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\frac {2 b^2 \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}-\frac {b x}{a^2}+\frac {\sinh (x)}{a} \]
[In]
[Out]
Rule 12
Rule 211
Rule 2738
Rule 3868
Rule 3938
Rubi steps \begin{align*} \text {integral}& = \frac {\sinh (x)}{a}-\frac {\int \frac {b}{a+b \text {sech}(x)} \, dx}{a} \\ & = \frac {\sinh (x)}{a}-\frac {b \int \frac {1}{a+b \text {sech}(x)} \, dx}{a} \\ & = -\frac {b x}{a^2}+\frac {\sinh (x)}{a}+\frac {b \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{a^2} \\ & = -\frac {b x}{a^2}+\frac {\sinh (x)}{a}+\frac {(2 b) \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^2} \\ & = -\frac {b x}{a^2}+\frac {2 b^2 \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}+\frac {\sinh (x)}{a} \\ \end{align*}
Time = 0.22 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.92 \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\frac {b \left (-x-\frac {2 b \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}\right )+a \sinh (x)}{a^2} \]
[In]
[Out]
Time = 0.22 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.52
method | result | size |
default | \(-\frac {1}{a \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a^{2}}-\frac {1}{a \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a^{2}}+\frac {2 b^{2} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}\) | \(94\) |
risch | \(-\frac {b x}{a^{2}}+\frac {{\mathrm e}^{x}}{2 a}-\frac {{\mathrm e}^{-x}}{2 a}-\frac {b^{2} \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^{2}}+\frac {b^{2} \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^{2}}\) | \(144\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (52) = 104\).
Time = 0.26 (sec) , antiderivative size = 430, normalized size of antiderivative = 6.94 \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\left [-\frac {a^{3} - a b^{2} + 2 \, {\left (a^{2} b - b^{3}\right )} x \cosh \left (x\right ) - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} - {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\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 ) + 2 \, {\left ({\left (a^{2} b - b^{3}\right )} x - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} \cosh \left (x\right ) + {\left (a^{4} - a^{2} b^{2}\right )} \sinh \left (x\right )\right )}}, -\frac {a^{3} - a b^{2} + 2 \, {\left (a^{2} b - b^{3}\right )} x \cosh \left (x\right ) - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} - {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\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 ) + 2 \, {\left ({\left (a^{2} b - b^{3}\right )} x - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} \cosh \left (x\right ) + {\left (a^{4} - a^{2} b^{2}\right )} \sinh \left (x\right )\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\int \frac {\cosh {\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00 \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\frac {2 \, b^{2} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a^{2}} - \frac {b x}{a^{2}} - \frac {e^{\left (-x\right )}}{2 \, a} + \frac {e^{x}}{2 \, a} \]
[In]
[Out]
Time = 2.16 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.24 \[ \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx=\frac {{\mathrm {e}}^x}{2\,a}-\frac {{\mathrm {e}}^{-x}}{2\,a}-\frac {b\,x}{a^2}+\frac {b^2\,\ln \left (-\frac {2\,b^2\,{\mathrm {e}}^x}{a^3}-\frac {2\,b^2\,\left (a+b\,{\mathrm {e}}^x\right )}{a^3\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {b^2\,\ln \left (\frac {2\,b^2\,\left (a+b\,{\mathrm {e}}^x\right )}{a^3\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{a^3}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}} \]
[In]
[Out]