\(\int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx\) [108]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 11 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-i x-\text {arctanh}(\cosh (x)) \]

[Out]

-I*x-arctanh(cosh(x))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3973, 3855} \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-\text {arctanh}(\cosh (x))-i x \]

[In]

Int[Coth[x]^2/(I + Csch[x]),x]

[Out]

(-I)*x - ArcTanh[Cosh[x]]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3973

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int (-i+\text {csch}(x)) \, dx \\ & = -i x+\int \text {csch}(x) \, dx \\ & = -i x-\text {arctanh}(\cosh (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 22, normalized size of antiderivative = 2.00 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-i x-\log \left (\cosh \left (\frac {x}{2}\right )\right )+\log \left (\sinh \left (\frac {x}{2}\right )\right ) \]

[In]

Integrate[Coth[x]^2/(I + Csch[x]),x]

[Out]

(-I)*x - Log[Cosh[x/2]] + Log[Sinh[x/2]]

Maple [A] (verified)

Time = 1.62 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.64

method result size
risch \(-i x +\ln \left ({\mathrm e}^{x}-1\right )-\ln \left ({\mathrm e}^{x}+1\right )\) \(18\)
default \(\ln \left (\tanh \left (\frac {x}{2}\right )\right )-i \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+i \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )\) \(27\)

[In]

int(coth(x)^2/(I+csch(x)),x,method=_RETURNVERBOSE)

[Out]

-I*x+ln(exp(x)-1)-ln(exp(x)+1)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.45 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-i \, x - \log \left (e^{x} + 1\right ) + \log \left (e^{x} - 1\right ) \]

[In]

integrate(coth(x)^2/(I+csch(x)),x, algorithm="fricas")

[Out]

-I*x - log(e^x + 1) + log(e^x - 1)

Sympy [F]

\[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=\int \frac {\coth ^{2}{\left (x \right )}}{\operatorname {csch}{\left (x \right )} + i}\, dx \]

[In]

integrate(coth(x)**2/(I+csch(x)),x)

[Out]

Integral(coth(x)**2/(csch(x) + I), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 20 vs. \(2 (9) = 18\).

Time = 0.19 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.82 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-i \, x - \log \left (e^{\left (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\right ) \]

[In]

integrate(coth(x)^2/(I+csch(x)),x, algorithm="maxima")

[Out]

-I*x - log(e^(-x) + 1) + log(e^(-x) - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.55 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=-i \, x - \log \left (e^{x} + 1\right ) + \log \left ({\left | e^{x} - 1 \right |}\right ) \]

[In]

integrate(coth(x)^2/(I+csch(x)),x, algorithm="giac")

[Out]

-I*x - log(e^x + 1) + log(abs(e^x - 1))

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.91 \[ \int \frac {\coth ^2(x)}{i+\text {csch}(x)} \, dx=\ln \left (2-2\,{\mathrm {e}}^x\right )-\ln \left (-2\,{\mathrm {e}}^x-2\right )-x\,1{}\mathrm {i} \]

[In]

int(coth(x)^2/(1/sinh(x) + 1i),x)

[Out]

log(2 - 2*exp(x)) - log(- 2*exp(x) - 2) - x*1i