Optimal. Leaf size=26 \[ 2 i \tanh ^{-1}(\cosh (x))+\coth (x)+\frac {2 i \coth (x)}{i-\text {csch}(x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 26, normalized size of antiderivative = 1.00, 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 = {2788, 3855,
3852, 8, 3862} \begin {gather*} \coth (x)+2 i \tanh ^{-1}(\cosh (x))+\frac {2 i \coth (x)}{-\text {csch}(x)+i} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2788
Rule 3852
Rule 3855
Rule 3862
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 \text {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] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(66\) vs. \(2(26)=52\).
time = 0.11, size = 66, normalized size = 2.54 \begin {gather*} \frac {1}{2} \left (\coth \left (\frac {x}{2}\right )+4 i \log \left (\cosh \left (\frac {x}{2}\right )\right )-4 i \log \left (\sinh \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 )}+\tanh \left (\frac {x}{2}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.75, size = 35, normalized size = 1.35
method | result | size |
default | \(\frac {\tanh \left (\frac {x}{2}\right )}{2}-2 i \ln \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {1}{2 \tanh \left (\frac {x}{2}\right )}+\frac {4}{\tanh \left (\frac {x}{2}\right )+i}\) | \(35\) |
risch | \(-\frac {2 i \left (i {\mathrm e}^{x}+2 \,{\mathrm e}^{2 x}-3\right )}{\left ({\mathrm e}^{2 x}-1\right ) \left ({\mathrm e}^{x}+i\right )}-2 i \ln \left ({\mathrm e}^{x}-1\right )+2 i \ln \left ({\mathrm e}^{x}+1\right )\) | \(49\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 53 vs. \(2 (20) = 40\).
time = 0.26, size = 53, normalized size = 2.04 \begin {gather*} \frac {2 \, {\left (e^{\left (-x\right )} + 2 i \, e^{\left (-2 \, x\right )} - 3 i\right )}}{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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 78 vs. \(2 (20) = 40\).
time = 0.46, size = 78, normalized size = 3.00 \begin {gather*} -\frac {2 \, {\left ({\left (-i \, e^{\left (3 \, x\right )} + e^{\left (2 \, x\right )} + i \, e^{x} - 1\right )} \log \left (e^{x} + 1\right ) + {\left (i \, e^{\left (3 \, x\right )} - e^{\left (2 \, x\right )} - i \, e^{x} + 1\right )} \log \left (e^{x} - 1\right ) + 2 i \, e^{\left (2 \, x\right )} - e^{x} - 3 i\right )}}{e^{\left (3 \, x\right )} + i \, e^{\left (2 \, x\right )} - e^{x} - i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 49 vs. \(2 (24) = 48\).
time = 0.10, size = 49, normalized size = 1.88 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 48 vs. \(2 (20) = 40\).
time = 0.43, size = 48, normalized size = 1.85 \begin {gather*} -\frac {2 \, {\left (2 i \, e^{\left (2 \, x\right )} - e^{x} - 3 i\right )}}{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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.75, size = 60, normalized size = 2.31 \begin {gather*} -\ln \left ({\mathrm {e}}^x\,4{}\mathrm {i}-4{}\mathrm {i}\right )\,2{}\mathrm {i}+\ln \left ({\mathrm {e}}^x\,4{}\mathrm {i}+4{}\mathrm {i}\right )\,2{}\mathrm {i}+\frac {2\,{\mathrm {e}}^x-{\mathrm {e}}^{2\,x}\,4{}\mathrm {i}+6{}\mathrm {i}}{{\mathrm {e}}^{2\,x}\,1{}\mathrm {i}+{\mathrm {e}}^{3\,x}-{\mathrm {e}}^x-\mathrm {i}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________