3.3.23 \(\int \frac {\coth ^2(x)}{(i+\sinh (x))^2} \, dx\) [223]

Optimal. Leaf size=26 \[ 2 i \tanh ^{-1}(\cosh (x))+\coth (x)+\frac {2 i \coth (x)}{i-\text {csch}(x)} \]

[Out]

2*I*arctanh(cosh(x))+3*coth(x)-2*I*coth(x)/(I+sinh(x))

________________________________________________________________________________________

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]

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

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2788

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_), x_Symbol] :> Dist[a^p, Int[Expan
dIntegrand[Sin[e + f*x]^p*((a + b*Sin[e + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a,
 b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m - p/2, 0])

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

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

Rule 3862

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-Cot[c + d*x])*((a + b*Csc[c + d*x])^n/(d*
(2*n + 1))), x] + Dist[1/(a^2*(2*n + 1)), Int[(a + b*Csc[c + d*x])^(n + 1)*(a*(2*n + 1) - b*(n + 1)*Csc[c + d*
x]), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && LeQ[n, -1] && IntegerQ[2*n]

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]

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

[Out]

(Coth[x/2] + (4*I)*Log[Cosh[x/2]] - (4*I)*Log[Sinh[x/2]] + (8*Sinh[x/2])/(Cosh[x/2] - I*Sinh[x/2]) + Tanh[x/2]
)/2

________________________________________________________________________________________

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]

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

[Out]

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

________________________________________________________________________________________

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]

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

[Out]

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

________________________________________________________________________________________

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]

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

[Out]

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

________________________________________________________________________________________

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]

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

[Out]

(-4*I*exp(2*x) + 2*exp(x) + 6*I)/(exp(3*x) + I*exp(2*x) - exp(x) - I) + 2*RootSum(_z**2 + 1, Lambda(_i, _i*log
(-_i*I + exp(x))))

________________________________________________________________________________________

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]

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

[Out]

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

________________________________________________________________________________________

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]

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

[Out]

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

________________________________________________________________________________________