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.14, antiderivative size = 60, normalized size of antiderivative = 1.00, 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 12
Rule 204
Rule 618
Rule 2660
Rule 2866
Rule 3872
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.18, 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]
________________________________________________________________________________________
fricas [B] time = 1.33, size = 256, normalized size = 4.27 \[ -\frac {2 \, a^{3} + 2 \, a b^{2} - {\left (a b \cosh \relax (x)^{2} + 2 \, a b \cosh \relax (x) \sinh \relax (x) + a b \sinh \relax (x)^{2} + a b\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {a^{2} \cosh \relax (x)^{2} + a^{2} \sinh \relax (x)^{2} + 2 \, a b \cosh \relax (x) + a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \relax (x) + a b\right )} \sinh \relax (x) + 2 \, \sqrt {a^{2} + b^{2}} {\left (a \cosh \relax (x) + a \sinh \relax (x) + b\right )}}{a \cosh \relax (x)^{2} + a \sinh \relax (x)^{2} + 2 \, b \cosh \relax (x) + 2 \, {\left (a \cosh \relax (x) + b\right )} \sinh \relax (x) - a}\right ) + 2 \, {\left (a^{2} b + b^{3}\right )} \cosh \relax (x) + 2 \, {\left (a^{2} b + b^{3}\right )} \sinh \relax (x)}{a^{4} + 2 \, a^{2} b^{2} + b^{4} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 85, normalized size = 1.42 \[ -\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 )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.17, size = 81, normalized size = 1.35 \[ -\frac {4 a b \arctanh \left (\frac {2 \tanh \left (\frac {x}{2}\right ) b -2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (2 a^{2}+2 b^{2}\right ) \sqrt {a^{2}+b^{2}}}-\frac {2 \left (b -a \tanh \left (\frac {x}{2}\right )\right )}{\left (a^{2}+b^{2}\right ) \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 91, normalized size = 1.52 \[ -\frac {a b \log \left (\frac {a e^{\left (-x\right )} - b - \sqrt {a^{2} + b^{2}}}{a e^{\left (-x\right )} - b + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b e^{\left (-x\right )} - a\right )}}{a^{2} + b^{2} + {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, x\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.66, size = 133, normalized size = 2.22 \[ \frac {a\,b\,\ln \left (\frac {2\,b\,\left (a-b\,{\mathrm {e}}^x\right )}{{\left (a^2+b^2\right )}^{3/2}}+\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}\right )}{{\left (a^2+b^2\right )}^{3/2}}-\frac {a\,b\,\ln \left (\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}-\frac {2\,b\,\left (a-b\,{\mathrm {e}}^x\right )}{{\left (a^2+b^2\right )}^{3/2}}\right )}{{\left (a^2+b^2\right )}^{3/2}}-\frac {\frac {2\,a}{a^2+b^2}+\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}}{{\mathrm {e}}^{2\,x}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\operatorname {sech}^{2}{\relax (x )}}{a + b \operatorname {csch}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________