Optimal. Leaf size=99 \[ \frac{b B \log (a+b \cosh (x))}{a^2-b^2}+\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}+\frac{B \log (1-\cosh (x))}{2 (a+b)}-\frac{B \log (\cosh (x)+1)}{2 (a-b)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.305051, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.533, Rules used = {4225, 4401, 2659, 208, 2668, 706, 31, 633} \[ \frac{b B \log (a+b \cosh (x))}{a^2-b^2}+\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}+\frac{B \log (1-\cosh (x))}{2 (a+b)}-\frac{B \log (\cosh (x)+1)}{2 (a-b)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4225
Rule 4401
Rule 2659
Rule 208
Rule 2668
Rule 706
Rule 31
Rule 633
Rubi steps
\begin{align*} \int \frac{A+B \text{csch}(x)}{a+b \cosh (x)} \, dx &=-\left (i \int \frac{\text{csch}(x) (i B+i A \sinh (x))}{a+b \cosh (x)} \, dx\right )\\ &=\int \left (\frac{A}{a+b \cosh (x)}+\frac{B \text{csch}(x)}{a+b \cosh (x)}\right ) \, dx\\ &=A \int \frac{1}{a+b \cosh (x)} \, dx+B \int \frac{\text{csch}(x)}{a+b \cosh (x)} \, dx\\ &=(2 A) \operatorname{Subst}\left (\int \frac{1}{a+b-(a-b) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )-(b B) \operatorname{Subst}\left (\int \frac{1}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \cosh (x)\right )\\ &=\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}+\frac{(b B) \operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \cosh (x)\right )}{a^2-b^2}+\frac{(b B) \operatorname{Subst}\left (\int \frac{-a+x}{b^2-x^2} \, dx,x,b \cosh (x)\right )}{a^2-b^2}\\ &=\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}+\frac{b B \log (a+b \cosh (x))}{a^2-b^2}+\frac{B \operatorname{Subst}\left (\int \frac{1}{-b-x} \, dx,x,b \cosh (x)\right )}{2 (a-b)}-\frac{B \operatorname{Subst}\left (\int \frac{1}{b-x} \, dx,x,b \cosh (x)\right )}{2 (a+b)}\\ &=\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}+\frac{B \log (1-\cosh (x))}{2 (a+b)}-\frac{B \log (1+\cosh (x))}{2 (a-b)}+\frac{b B \log (a+b \cosh (x))}{a^2-b^2}\\ \end{align*}
Mathematica [A] time = 0.187558, size = 81, normalized size = 0.82 \[ \frac{B \left (b \log (a+b \cosh (x))+a \log \left (\tanh \left (\frac{x}{2}\right )\right )-b \log (\sinh (x))\right )}{a^2-b^2}-\frac{2 A \tan ^{-1}\left (\frac{(a-b) \tanh \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.025, size = 138, normalized size = 1.4 \begin{align*}{\frac{Bb}{ \left ( a+b \right ) \left ( a-b \right ) }\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}- \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b-a-b \right ) }+2\,{\frac{Aa}{ \left ( a+b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{Ab}{ \left ( a+b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+{\frac{B}{a+b}\ln \left ( \tanh \left ({\frac{x}{2}} \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 [A] time = 22.6808, size = 840, normalized size = 8.48 \begin{align*} \left [\frac{B b \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + \sqrt{a^{2} - b^{2}} A \log \left (\frac{b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} - b^{2} + 2 \,{\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt{a^{2} - b^{2}}{\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \,{\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) + b}\right ) -{\left (B a + B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) +{\left (B a - B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} - b^{2}}, \frac{B b \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - 2 \, \sqrt{-a^{2} + b^{2}} A \arctan \left (-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{a^{2} - b^{2}}\right ) -{\left (B a + B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) +{\left (B a - B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} - b^{2}}\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{A + B \operatorname{csch}{\left (x \right )}}{a + b \cosh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23717, size = 122, normalized size = 1.23 \begin{align*} \frac{B b \log \left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} + b\right )}{a^{2} - b^{2}} + \frac{2 \, A \arctan \left (\frac{b e^{x} + a}{\sqrt{-a^{2} + b^{2}}}\right )}{\sqrt{-a^{2} + b^{2}}} - \frac{B \log \left (e^{x} + 1\right )}{a - b} + \frac{B \log \left ({\left | e^{x} - 1 \right |}\right )}{a + b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]