Optimal. Leaf size=60 \[ \frac{2 a b \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14187, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.462, Rules used = {3872, 2866, 12, 2660, 618, 204} \[ \frac{2 a b \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3872
Rule 2866
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\text{sech}^2(x)}{a+b \text{csch}(x)} \, dx &=i \int \frac{\text{sech}(x) \tanh (x)}{i b+i a \sinh (x)} \, dx\\ &=-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2}-\frac{i \int \frac{a b}{i b+i a \sinh (x)} \, dx}{a^2+b^2}\\ &=-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2}-\frac{(i a b) \int \frac{1}{i b+i a \sinh (x)} \, dx}{a^2+b^2}\\ &=-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2}-\frac{(2 i a b) \operatorname{Subst}\left (\int \frac{1}{i b+2 i a x-i b x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{a^2+b^2}\\ &=-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2}+\frac{(4 i a b) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2+b^2\right )-x^2} \, dx,x,2 i a-2 i b \tanh \left (\frac{x}{2}\right )\right )}{a^2+b^2}\\ &=\frac{2 a b \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac{\text{sech}(x) (b-a \sinh (x))}{a^2+b^2}\\ \end{align*}
Mathematica [A] time = 0.176511, size = 67, normalized size = 1.12 \[ \frac{a \left (\tanh (x)-\frac{2 b \tan ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{-a^2-b^2}}\right )}{\sqrt{-a^2-b^2}}\right )-b \text{sech}(x)}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.029, size = 81, normalized size = 1.4 \begin{align*} -4\,{\frac{ab}{ \left ( 2\,{a}^{2}+2\,{b}^{2} \right ) \sqrt{{a}^{2}+{b}^{2}}}{\it Artanh} \left ( 1/2\,{\frac{2\,\tanh \left ( x/2 \right ) b-2\,a}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }-2\,{\frac{-a\tanh \left ( x/2 \right ) +b}{ \left ({a}^{2}+{b}^{2} \right ) \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \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 = 1.62838, size = 693, normalized size = 11.55 \begin{align*} -\frac{2 \, a^{3} + 2 \, a b^{2} -{\left (a b \cosh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) \sinh \left (x\right ) + a b \sinh \left (x\right )^{2} + a b\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 (a^{2} b + b^{3}\right )} \cosh \left (x\right ) + 2 \,{\left (a^{2} b + b^{3}\right )} \sinh \left (x\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4} +{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{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{\operatorname{sech}^{2}{\left (x \right )}}{a + b \operatorname{csch}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15072, size = 115, normalized size = 1.92 \begin{align*} -\frac{a b \log \left (\frac{{\left | 2 \, a e^{x} + 2 \, b - 2 \, \sqrt{a^{2} + b^{2}} \right |}}{{\left | 2 \, a e^{x} + 2 \, b + 2 \, \sqrt{a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac{3}{2}}} - \frac{2 \,{\left (b e^{x} + a\right )}}{{\left (a^{2} + b^{2}\right )}{\left (e^{\left (2 \, x\right )} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]