Optimal. Leaf size=62 \[ \frac{2 b^2 \tan ^{-1}\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} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0924905, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.454, Rules used = {3853, 12, 3783, 2659, 205} \[ \frac{2 b^2 \tan ^{-1}\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} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3853
Rule 12
Rule 3783
Rule 2659
Rule 205
Rubi steps
\begin{align*} \int \frac{\cosh (x)}{a+b \text{sech}(x)} \, dx &=\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) \operatorname{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 \tan ^{-1}\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*}
Mathematica [A] time = 0.112964, size = 57, normalized size = 0.92 \[ \frac{b \left (-\frac{2 b \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}-x\right )+a \sinh (x)}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.031, size = 94, normalized size = 1.5 \begin{align*} -{\frac{1}{a} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{b}{{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{1}{a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{b}{{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+2\,{\frac{{b}^{2}}{{a}^{2}\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.6303, size = 1064, normalized size = 17.16 \begin{align*} \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 ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cosh{\left (x \right )}}{a + b \operatorname{sech}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.16149, size = 84, normalized size = 1.35 \begin{align*} \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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]