Optimal. Leaf size=88 \[ \frac{2 \left (a^2+b^2\right )^{3/2} \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a b^3}-\frac{\left (2 a^2+3 b^2\right ) \tanh ^{-1}(\cosh (x))}{2 b^3}+\frac{a \coth (x)}{b^2}+\frac{x}{a}-\frac{\coth (x) \text{csch}(x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.332179, antiderivative size = 88, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.538, Rules used = {3898, 2893, 3057, 2660, 618, 204, 3770} \[ \frac{2 \left (a^2+b^2\right )^{3/2} \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a b^3}-\frac{\left (2 a^2+3 b^2\right ) \tanh ^{-1}(\cosh (x))}{2 b^3}+\frac{a \coth (x)}{b^2}+\frac{x}{a}-\frac{\coth (x) \text{csch}(x)}{2 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3898
Rule 2893
Rule 3057
Rule 2660
Rule 618
Rule 204
Rule 3770
Rubi steps
\begin{align*} \int \frac{\coth ^4(x)}{a+b \text{csch}(x)} \, dx &=i \int \frac{\cosh (x) \coth ^3(x)}{i b+i a \sinh (x)} \, dx\\ &=\frac{a \coth (x)}{b^2}-\frac{\coth (x) \text{csch}(x)}{2 b}-\frac{i \int \frac{\text{csch}(x) \left (-2 a^2-3 b^2+a b \sinh (x)-2 b^2 \sinh ^2(x)\right )}{i b+i a \sinh (x)} \, dx}{2 b^2}\\ &=\frac{x}{a}+\frac{a \coth (x)}{b^2}-\frac{\coth (x) \text{csch}(x)}{2 b}-\frac{\left (i \left (a^2+b^2\right )^2\right ) \int \frac{1}{i b+i a \sinh (x)} \, dx}{a b^3}+\frac{\left (2 a^2+3 b^2\right ) \int \text{csch}(x) \, dx}{2 b^3}\\ &=\frac{x}{a}-\frac{\left (2 a^2+3 b^2\right ) \tanh ^{-1}(\cosh (x))}{2 b^3}+\frac{a \coth (x)}{b^2}-\frac{\coth (x) \text{csch}(x)}{2 b}-\frac{\left (2 i \left (a^2+b^2\right )^2\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 )}{a b^3}\\ &=\frac{x}{a}-\frac{\left (2 a^2+3 b^2\right ) \tanh ^{-1}(\cosh (x))}{2 b^3}+\frac{a \coth (x)}{b^2}-\frac{\coth (x) \text{csch}(x)}{2 b}+\frac{\left (4 i \left (a^2+b^2\right )^2\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 )}{a b^3}\\ &=\frac{x}{a}-\frac{\left (2 a^2+3 b^2\right ) \tanh ^{-1}(\cosh (x))}{2 b^3}+\frac{2 \left (a^2+b^2\right )^{3/2} \tanh ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{a^2+b^2}}\right )}{a b^3}+\frac{a \coth (x)}{b^2}-\frac{\coth (x) \text{csch}(x)}{2 b}\\ \end{align*}
Mathematica [A] time = 0.574497, size = 151, normalized size = 1.72 \[ \frac{\text{csch}(x) (a \sinh (x)+b) \left (4 a \left (2 a^2+3 b^2\right ) \log \left (\tanh \left (\frac{x}{2}\right )\right )-16 \left (-a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac{a-b \tanh \left (\frac{x}{2}\right )}{\sqrt{-a^2-b^2}}\right )+4 a^2 b \tanh \left (\frac{x}{2}\right )+4 a^2 b \coth \left (\frac{x}{2}\right )-a b^2 \text{csch}^2\left (\frac{x}{2}\right )-a b^2 \text{sech}^2\left (\frac{x}{2}\right )+8 b^3 x\right )}{8 a b^3 (a+b \text{csch}(x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.038, size = 207, normalized size = 2.4 \begin{align*}{\frac{1}{8\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}}+{\frac{a}{2\,{b}^{2}}\tanh \left ({\frac{x}{2}} \right ) }+{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-2\,{\frac{{a}^{3}}{{b}^{3}\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 ) }-4\,{\frac{a}{b\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{b}{a\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 ) }-{\frac{1}{8\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-2}}+{\frac{{a}^{2}}{{b}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }+{\frac{3}{2\,b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) }+{\frac{a}{2\,{b}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{1}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -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 = 2.26011, size = 2174, normalized size = 24.7 \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 ^{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 [B] time = 1.20455, size = 217, normalized size = 2.47 \begin{align*} \frac{x}{a} - \frac{{\left (2 \, a^{2} + 3 \, b^{2}\right )} \log \left (e^{x} + 1\right )}{2 \, b^{3}} + \frac{{\left (2 \, a^{2} + 3 \, b^{2}\right )} \log \left ({\left | e^{x} - 1 \right |}\right )}{2 \, b^{3}} - \frac{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \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 )}{\sqrt{a^{2} + b^{2}} a b^{3}} - \frac{b e^{\left (3 \, x\right )} - 2 \, a e^{\left (2 \, x\right )} + b e^{x} + 2 \, a}{b^{2}{\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]