3.2.22 \(\int \frac {\text {sech}(x)}{i+2 \coth (x)} \, dx\) [122]

Optimal. Leaf size=31 \[ -i \text {ArcTan}(\sinh (x))-\frac {2 \tanh ^{-1}\left (\frac {\cosh (x)-2 i \sinh (x)}{\sqrt {5}}\right )}{\sqrt {5}} \]

[Out]

-I*arctan(sinh(x))-2/5*arctanh(1/5*(cosh(x)-2*I*sinh(x))*5^(1/2))*5^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3599, 3189, 3855, 3153, 212} \begin {gather*} -i \text {ArcTan}(\sinh (x))-\frac {2 \tanh ^{-1}\left (\frac {\cosh (x)-2 i \sinh (x)}{\sqrt {5}}\right )}{\sqrt {5}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sech[x]/(I + 2*Coth[x]),x]

[Out]

(-I)*ArcTan[Sinh[x]] - (2*ArcTanh[(Cosh[x] - (2*I)*Sinh[x])/Sqrt[5]])/Sqrt[5]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3153

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Dist[-d^(-1), Subst[Int
[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2,
0]

Rule 3189

Int[(cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.))/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(
c_.) + (d_.)*(x_)]), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*(sin[c + d*x]^n/(a*cos[c + d*x] + b*sin[c + d*
x])), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IntegersQ[m, n]

Rule 3599

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Sin[e + f*x]^
m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/Cos[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3855

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

Rubi steps

\begin {align*} \int \frac {\text {sech}(x)}{i+2 \coth (x)} \, dx &=-\left (i \int \frac {\tanh (x)}{-2 i \cosh (x)+\sinh (x)} \, dx\right )\\ &=-\int \left (i \text {sech}(x)-\frac {2 i}{2 \cosh (x)+i \sinh (x)}\right ) \, dx\\ &=-(i \int \text {sech}(x) \, dx)+2 i \int \frac {1}{2 \cosh (x)+i \sinh (x)} \, dx\\ &=-i \tan ^{-1}(\sinh (x))-2 \text {Subst}\left (\int \frac {1}{5-x^2} \, dx,x,\cosh (x)-2 i \sinh (x)\right )\\ &=-i \tan ^{-1}(\sinh (x))-\frac {2 \tanh ^{-1}\left (\frac {\cosh (x)-2 i \sinh (x)}{\sqrt {5}}\right )}{\sqrt {5}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 38, normalized size = 1.23 \begin {gather*} -2 i \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )-\frac {4 \tanh ^{-1}\left (\frac {1-2 i \tanh \left (\frac {x}{2}\right )}{\sqrt {5}}\right )}{\sqrt {5}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sech[x]/(I + 2*Coth[x]),x]

[Out]

(-2*I)*ArcTan[Tanh[x/2]] - (4*ArcTanh[(1 - (2*I)*Tanh[x/2])/Sqrt[5]])/Sqrt[5]

________________________________________________________________________________________

Maple [A]
time = 1.28, size = 41, normalized size = 1.32

method result size
default \(-\ln \left (\tanh \left (\frac {x}{2}\right )-i\right )+\ln \left (\tanh \left (\frac {x}{2}\right )+i\right )+\frac {4 i \sqrt {5}\, \arctan \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )+i\right ) \sqrt {5}}{5}\right )}{5}\) \(41\)
risch \(-\ln \left ({\mathrm e}^{x}-i\right )+\ln \left ({\mathrm e}^{x}+i\right )+\frac {2 \sqrt {5}\, \ln \left ({\mathrm e}^{x}-\frac {2 i \sqrt {5}}{5}-\frac {\sqrt {5}}{5}\right )}{5}-\frac {2 \sqrt {5}\, \ln \left ({\mathrm e}^{x}+\frac {2 i \sqrt {5}}{5}+\frac {\sqrt {5}}{5}\right )}{5}\) \(56\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(x)/(I+2*coth(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 38, normalized size = 1.23 \begin {gather*} \frac {2}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - \left (2 i + 1\right ) \, e^{\left (-x\right )}}{\sqrt {5} + \left (2 i + 1\right ) \, e^{\left (-x\right )}}\right ) + 2 i \, \arctan \left (e^{\left (-x\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(I+2*coth(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 41, normalized size = 1.32 \begin {gather*} -\frac {2}{5} \, \sqrt {5} \log \left (\left (\frac {2}{5} i + \frac {1}{5}\right ) \, \sqrt {5} + e^{x}\right ) + \frac {2}{5} \, \sqrt {5} \log \left (-\left (\frac {2}{5} i + \frac {1}{5}\right ) \, \sqrt {5} + e^{x}\right ) + \log \left (e^{x} + i\right ) - \log \left (e^{x} - i\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(I+2*coth(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {sech}{\left (x \right )}}{2 \coth {\left (x \right )} + i}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 26, normalized size = 0.84 \begin {gather*} \frac {4}{5} i \, \sqrt {5} \arctan \left (\left (\frac {1}{5} i + \frac {2}{5}\right ) \, \sqrt {5} e^{x}\right ) + \log \left (e^{x} + i\right ) - \log \left (e^{x} - i\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(I+2*coth(x)),x, algorithm="giac")

[Out]

4/5*I*sqrt(5)*arctan((1/5*I + 2/5)*sqrt(5)*e^x) + log(e^x + I) - log(e^x - I)

________________________________________________________________________________________

Mupad [B]
time = 0.51, size = 65, normalized size = 2.10 \begin {gather*} \ln \left ({\mathrm {e}}^x\,\left (32+64{}\mathrm {i}\right )-64+32{}\mathrm {i}\right )-\ln \left ({\mathrm {e}}^x\,\left (32+64{}\mathrm {i}\right )+64-32{}\mathrm {i}\right )-\frac {2\,\sqrt {5}\,\ln \left ({\mathrm {e}}^x\,\left (-\frac {256}{5}+\frac {192}{5}{}\mathrm {i}\right )+\sqrt {5}\,\left (-\frac {128}{5}-\frac {64}{5}{}\mathrm {i}\right )\right )}{5}+\frac {2\,\sqrt {5}\,\ln \left ({\mathrm {e}}^x\,\left (-\frac {256}{5}+\frac {192}{5}{}\mathrm {i}\right )+\sqrt {5}\,\left (\frac {128}{5}+\frac {64}{5}{}\mathrm {i}\right )\right )}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x)*(2*coth(x) + 1i)),x)

[Out]

log(exp(x)*(32 + 64i) - (64 - 32i)) - log(exp(x)*(32 + 64i) + (64 - 32i)) - (2*5^(1/2)*log(- exp(x)*(256/5 - 1
92i/5) - 5^(1/2)*(128/5 + 64i/5)))/5 + (2*5^(1/2)*log(5^(1/2)*(128/5 + 64i/5) - exp(x)*(256/5 - 192i/5)))/5

________________________________________________________________________________________