Optimal. Leaf size=26 \[ \coth (x)+2 i \tanh ^{-1}(\cosh (x))+\frac{2 i \coth (x)}{-\text{csch}(x)+i} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0677855, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {2709, 3770, 3767, 8, 3777} \[ \coth (x)+2 i \tanh ^{-1}(\cosh (x))+\frac{2 i \coth (x)}{-\text{csch}(x)+i} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2709
Rule 3770
Rule 3767
Rule 8
Rule 3777
Rubi steps
\begin{align*} \int \frac{\coth ^2(x)}{(i+\sinh (x))^2} \, dx &=\int \left (2-2 i \text{csch}(x)-\text{csch}^2(x)+\frac{2 i}{-i+\text{csch}(x)}\right ) \, dx\\ &=2 x-2 i \int \text{csch}(x) \, dx+2 i \int \frac{1}{-i+\text{csch}(x)} \, dx-\int \text{csch}^2(x) \, dx\\ &=2 x+2 i \tanh ^{-1}(\cosh (x))+\frac{2 i \coth (x)}{i-\text{csch}(x)}+i \operatorname{Subst}(\int 1 \, dx,x,-i \coth (x))+2 i \int i \, dx\\ &=2 i \tanh ^{-1}(\cosh (x))+\coth (x)+\frac{2 i \coth (x)}{i-\text{csch}(x)}\\ \end{align*}
Mathematica [B] time = 0.138201, size = 66, normalized size = 2.54 \[ \frac{1}{2} \left (\tanh \left (\frac{x}{2}\right )+\coth \left (\frac{x}{2}\right )-4 i \log \left (\sinh \left (\frac{x}{2}\right )\right )+4 i \log \left (\cosh \left (\frac{x}{2}\right )\right )+\frac{8 \sinh \left (\frac{x}{2}\right )}{\cosh \left (\frac{x}{2}\right )-i \sinh \left (\frac{x}{2}\right )}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.045, size = 35, normalized size = 1.4 \begin{align*}{\frac{1}{2}\tanh \left ({\frac{x}{2}} \right ) }-2\,i\ln \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) +{\frac{1}{2} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}+4\, \left ( \tanh \left ( x/2 \right ) +i \right ) ^{-1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.13042, size = 73, normalized size = 2.81 \begin{align*} \frac{2 \, e^{\left (-x\right )} + 4 i \, e^{\left (-2 \, x\right )} - 6 i}{e^{\left (-x\right )} + i \, e^{\left (-2 \, x\right )} - e^{\left (-3 \, x\right )} - i} + 2 i \, \log \left (e^{\left (-x\right )} + 1\right ) - 2 i \, \log \left (e^{\left (-x\right )} - 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.08805, size = 232, normalized size = 8.92 \begin{align*} \frac{{\left (2 i \, e^{\left (3 \, x\right )} - 2 \, e^{\left (2 \, x\right )} - 2 i \, e^{x} + 2\right )} \log \left (e^{x} + 1\right ) +{\left (-2 i \, e^{\left (3 \, x\right )} + 2 \, e^{\left (2 \, x\right )} + 2 i \, e^{x} - 2\right )} \log \left (e^{x} - 1\right ) - 4 i \, e^{\left (2 \, x\right )} + 2 \, e^{x} + 6 i}{e^{\left (3 \, x\right )} + i \, e^{\left (2 \, x\right )} - e^{x} - i} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 0.47057, size = 49, normalized size = 1.88 \begin{align*} \frac{- 4 i e^{2 x} + 2 e^{x} + 6 i}{e^{3 x} + i e^{2 x} - e^{x} - i} + 2 \operatorname{RootSum}{\left (z^{2} + 1, \left ( i \mapsto i \log{\left (- i i + e^{x} \right )} \right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.15333, size = 63, normalized size = 2.42 \begin{align*} \frac{-4 i \, e^{\left (2 \, x\right )} + 2 \, e^{x} + 6 i}{e^{\left (3 \, x\right )} + i \, e^{\left (2 \, x\right )} - e^{x} - i} + 2 i \, \log \left (e^{x} + 1\right ) - 2 i \, \log \left ({\left | e^{x} - 1 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]