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

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

Optimal result

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

[Out]

-arctanh(cosh(x))+coth(x)/(I+csch(x))

Rubi [A] (verified)

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

[In]

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

[Out]

-ArcTanh[Cosh[x]] + Coth[x]/(I + Csch[x])

Rule 3855

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

Rule 3874

Int[csc[(e_.) + (f_.)*(x_)]^2/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[Csc[e + f*x],
 x], x] - Dist[a/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x]

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

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

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(46\) vs. \(2(17)=34\).

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.45 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.12

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

[In]

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

[Out]

-2*I/(tanh(1/2*x)-I)+ln(tanh(1/2*x))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (15) = 30\).

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

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

2/(e^(-x) + I) - log(e^(-x) + 1) + log(e^(-x) - 1)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

2/(e^x - I) - log(e^x + 1) + log(abs(e^x - 1))

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.53 \[ \int \frac {\text {csch}^2(x)}{i+\text {csch}(x)} \, dx=\ln \left (2-2\,{\mathrm {e}}^x\right )-\ln \left (-2\,{\mathrm {e}}^x-2\right )+\frac {2}{{\mathrm {e}}^x-\mathrm {i}} \]

[In]

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

[Out]

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