Optimal. Leaf size=114 \[ -\frac{b^2 x}{a \left (a^2-b^2\right )}+\frac{a x}{a^2-b^2}-\frac{a \coth (x)}{a^2-b^2}+\frac{b \text{csch}(x)}{a^2-b^2}+\frac{2 b^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a (a-b)^{3/2} (a+b)^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.20499, antiderivative size = 114, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 8, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.615, Rules used = {3898, 2902, 2606, 8, 3473, 2735, 2659, 205} \[ -\frac{b^2 x}{a \left (a^2-b^2\right )}+\frac{a x}{a^2-b^2}-\frac{a \coth (x)}{a^2-b^2}+\frac{b \text{csch}(x)}{a^2-b^2}+\frac{2 b^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a (a-b)^{3/2} (a+b)^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3898
Rule 2902
Rule 2606
Rule 8
Rule 3473
Rule 2735
Rule 2659
Rule 205
Rubi steps
\begin{align*} \int \frac{\coth ^2(x)}{a+b \text{sech}(x)} \, dx &=\int \frac{\cosh (x) \coth ^2(x)}{b+a \cosh (x)} \, dx\\ &=\frac{a \int \coth ^2(x) \, dx}{a^2-b^2}-\frac{b \int \coth (x) \text{csch}(x) \, dx}{a^2-b^2}-\frac{b^2 \int \frac{\cosh (x)}{b+a \cosh (x)} \, dx}{a^2-b^2}\\ &=-\frac{b^2 x}{a \left (a^2-b^2\right )}-\frac{a \coth (x)}{a^2-b^2}+\frac{a \int 1 \, dx}{a^2-b^2}+\frac{(i b) \operatorname{Subst}(\int 1 \, dx,x,-i \text{csch}(x))}{a^2-b^2}+\frac{b^3 \int \frac{1}{b+a \cosh (x)} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac{a x}{a^2-b^2}-\frac{b^2 x}{a \left (a^2-b^2\right )}-\frac{a \coth (x)}{a^2-b^2}+\frac{b \text{csch}(x)}{a^2-b^2}+\frac{\left (2 b^3\right ) \operatorname{Subst}\left (\int \frac{1}{a+b-(-a+b) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{a \left (a^2-b^2\right )}\\ &=\frac{a x}{a^2-b^2}-\frac{b^2 x}{a \left (a^2-b^2\right )}+\frac{2 b^3 \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{a (a-b)^{3/2} (a+b)^{3/2}}-\frac{a \coth (x)}{a^2-b^2}+\frac{b \text{csch}(x)}{a^2-b^2}\\ \end{align*}
Mathematica [A] time = 0.334968, size = 81, normalized size = 0.71 \[ \frac{\frac{2 b^3 \tan ^{-1}\left (\frac{(a-b) \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+a^2 x-a^2 \coth (x)+a b \text{csch}(x)-b^2 x}{a^3-a b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.03, size = 104, normalized size = 0.9 \begin{align*} -{\frac{1}{2\,a-2\,b}\tanh \left ({\frac{x}{2}} \right ) }+{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{1}{2\,b+2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+2\,{\frac{{b}^{3}}{ \left ( a-b \right ) a \left ( a+b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \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 [B] time = 2.35958, size = 1582, normalized size = 13.88 \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{\coth ^{2}{\left (x \right )}}{a + b \operatorname{sech}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15148, size = 111, normalized size = 0.97 \begin{align*} \frac{2 \, b^{3} \arctan \left (\frac{a e^{x} + b}{\sqrt{a^{2} - b^{2}}}\right )}{{\left (a^{3} - a b^{2}\right )} \sqrt{a^{2} - b^{2}}} + \frac{x}{a} + \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]