Optimal. Leaf size=104 \[ \frac{2 a^3 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 )^{5/2}}-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.270334, antiderivative size = 104, normalized size of antiderivative = 1., number of steps used = 7, 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^3 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 )^{5/2}}-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^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}^4(x)}{a+b \text{csch}(x)} \, dx &=i \int \frac{\text{sech}^3(x) \tanh (x)}{i b+i a \sinh (x)} \, dx\\ &=-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}+\frac{\int \frac{\text{sech}^2(x) \left (-i a b+2 i a^2 \sinh (x)\right )}{i b+i a \sinh (x)} \, dx}{3 \left (a^2+b^2\right )}\\ &=-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2}+\frac{\int -\frac{3 i a^3 b}{i b+i a \sinh (x)} \, dx}{3 \left (a^2+b^2\right )^2}\\ &=-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2}-\frac{\left (i a^3 b\right ) \int \frac{1}{i b+i a \sinh (x)} \, dx}{\left (a^2+b^2\right )^2}\\ &=-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2}-\frac{\left (2 i a^3 b\right ) \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 )}{\left (a^2+b^2\right )^2}\\ &=-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2}+\frac{\left (4 i a^3 b\right ) \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 )}{\left (a^2+b^2\right )^2}\\ &=\frac{2 a^3 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 )^{5/2}}-\frac{\text{sech}^3(x) (b-a \sinh (x))}{3 \left (a^2+b^2\right )}-\frac{\text{sech}(x) \left (3 a^2 b-a \left (2 a^2-b^2\right ) \sinh (x)\right )}{3 \left (a^2+b^2\right )^2}\\ \end{align*}
Mathematica [A] time = 0.61086, size = 114, normalized size = 1.1 \[ -\frac{\left (a b^2-2 a^3\right ) \tanh (x)+b \left (a^2+b^2\right ) \text{sech}^3(x)+\frac{6 a^3 b \tan ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{-a^2-b^2}}\right )}{\sqrt{-a^2-b^2}}-a \left (a^2+b^2\right ) \tanh (x) \text{sech}^2(x)+3 a^2 b \text{sech}(x)}{3 \left (a^2+b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 170, normalized size = 1.6 \begin{align*} -4\,{\frac{{a}^{3}b}{ \left ( 2\,{a}^{4}+4\,{a}^{2}{b}^{2}+2\,{b}^{4} \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}^{3} \left ( \tanh \left ( x/2 \right ) \right ) ^{5}+ \left ( 2\,{a}^{2}b+{b}^{3} \right ) \left ( \tanh \left ( x/2 \right ) \right ) ^{4}+ \left ( -2/3\,{a}^{3}+4/3\,a{b}^{2} \right ) \left ( \tanh \left ( x/2 \right ) \right ) ^{3}+2\,{a}^{2}b \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-{a}^{3}\tanh \left ( x/2 \right ) +4/3\,{a}^{2}b+1/3\,{b}^{3}}{ \left ({a}^{4}+2\,{a}^{2}{b}^{2}+{b}^{4} \right ) \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{3}}} \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.80851, size = 2822, normalized size = 27.13 \begin{align*} \text{result too large to display} \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}^{4}{\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.21967, size = 235, normalized size = 2.26 \begin{align*} -\frac{a^{3} 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^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt{a^{2} + b^{2}}} - \frac{2 \,{\left (3 \, a^{2} b e^{\left (5 \, x\right )} - 3 \, a b^{2} e^{\left (4 \, x\right )} + 10 \, a^{2} b e^{\left (3 \, x\right )} + 4 \, b^{3} e^{\left (3 \, x\right )} + 6 \, a^{3} e^{\left (2 \, x\right )} + 3 \, a^{2} b e^{x} + 2 \, a^{3} - a b^{2}\right )}}{3 \,{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}{\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]