Optimal. Leaf size=89 \[ -\frac{2 A \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}}+\frac{b B \log (a+b \sinh (x))}{a^2+b^2}+\frac{a B \tan ^{-1}(\sinh (x))}{a^2+b^2}-\frac{b B \log (\cosh (x))}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.251957, antiderivative size = 89, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 11, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.733, Rules used = {4226, 4401, 2660, 618, 206, 2668, 706, 31, 635, 204, 260} \[ -\frac{2 A \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}}+\frac{b B \log (a+b \sinh (x))}{a^2+b^2}+\frac{a B \tan ^{-1}(\sinh (x))}{a^2+b^2}-\frac{b B \log (\cosh (x))}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4226
Rule 4401
Rule 2660
Rule 618
Rule 206
Rule 2668
Rule 706
Rule 31
Rule 635
Rule 204
Rule 260
Rubi steps
\begin{align*} \int \frac{A+B \text{sech}(x)}{a+b \sinh (x)} \, dx &=\int \frac{(B+A \cosh (x)) \text{sech}(x)}{a+b \sinh (x)} \, dx\\ &=\int \left (\frac{A}{a+b \sinh (x)}+\frac{B \text{sech}(x)}{a+b \sinh (x)}\right ) \, dx\\ &=A \int \frac{1}{a+b \sinh (x)} \, dx+B \int \frac{\text{sech}(x)}{a+b \sinh (x)} \, dx\\ &=(2 A) \operatorname{Subst}\left (\int \frac{1}{a+2 b x-a 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 \sinh (x)\right )\\ &=-\left ((4 A) \operatorname{Subst}\left (\int \frac{1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac{x}{2}\right )\right )\right )+\frac{(b B) \operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \sinh (x)\right )}{a^2+b^2}+\frac{(b B) \operatorname{Subst}\left (\int \frac{-a+x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}\\ &=-\frac{2 A \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}}+\frac{b B \log (a+b \sinh (x))}{a^2+b^2}+\frac{(b B) \operatorname{Subst}\left (\int \frac{x}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}-\frac{(a b B) \operatorname{Subst}\left (\int \frac{1}{-b^2-x^2} \, dx,x,b \sinh (x)\right )}{a^2+b^2}\\ &=\frac{a B \tan ^{-1}(\sinh (x))}{a^2+b^2}-\frac{2 A \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\sqrt{a^2+b^2}}-\frac{b B \log (\cosh (x))}{a^2+b^2}+\frac{b B \log (a+b \sinh (x))}{a^2+b^2}\\ \end{align*}
Mathematica [A] time = 0.249137, size = 93, normalized size = 1.04 \[ \frac{2 A \tan ^{-1}\left (\frac{b-a \tanh \left (\frac{x}{2}\right )}{\sqrt{-a^2-b^2}}\right )}{\sqrt{-a^2-b^2}}+\frac{2 a B \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )}{a^2+b^2}-\frac{b B (\log (\cosh (x))-\log (a+b \sinh (x)))}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.032, size = 150, normalized size = 1.7 \begin{align*} -{\frac{Bb}{{a}^{2}+{b}^{2}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }+2\,{\frac{aB\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{{a}^{2}+{b}^{2}}}+{\frac{Bb}{{a}^{2}+{b}^{2}}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) }+2\,{\frac{{a}^{2}A}{ \left ({a}^{2}+{b}^{2} \right ) ^{3/2}}{\it Artanh} \left ( 1/2\,{\frac{2\,a\tanh \left ( x/2 \right ) -2\,b}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }+2\,{\frac{A{b}^{2}}{ \left ({a}^{2}+{b}^{2} \right ) ^{3/2}}{\it Artanh} \left ( 1/2\,{\frac{2\,a\tanh \left ( x/2 \right ) -2\,b}{\sqrt{{a}^{2}+{b}^{2}}}} \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 = 26.1958, size = 510, normalized size = 5.73 \begin{align*} \frac{2 \, B a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + B b \log \left (\frac{2 \,{\left (b \sinh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - B b \log \left (\frac{2 \, \cosh \left (x\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 )}{a^{2} + b^{2}} \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{sech}{\left (x \right )}}{a + b \sinh{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.16818, size = 166, normalized size = 1.87 \begin{align*} \frac{2 \, B a \arctan \left (e^{x}\right )}{a^{2} + b^{2}} - \frac{B b \log \left (e^{\left (2 \, x\right )} + 1\right )}{a^{2} + b^{2}} + \frac{B b \log \left ({\left | b e^{\left (2 \, x\right )} + 2 \, a e^{x} - b \right |}\right )}{a^{2} + b^{2}} + \frac{A \log \left (\frac{{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{\sqrt{a^{2} + b^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]