3.97 \(\int \frac {\text {sech}(x)}{a+b \text {csch}(x)} \, dx\)

Optimal. Leaf size=64 \[ -\frac {b \log (a \sinh (x)+b)}{a^2+b^2}+\frac {\log (-\sinh (x)+i)}{2 (b+i a)}-\frac {\log (\sinh (x)+i)}{2 (-b+i a)} \]

[Out]

1/2*ln(I-sinh(x))/(I*a+b)-1/2*ln(I+sinh(x))/(I*a-b)-b*ln(b+a*sinh(x))/(a^2+b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3872, 2721, 801} \[ -\frac {b \log (a \sinh (x)+b)}{a^2+b^2}+\frac {\log (-\sinh (x)+i)}{2 (b+i a)}-\frac {\log (\sinh (x)+i)}{2 (-b+i a)} \]

Antiderivative was successfully verified.

[In]

Int[Sech[x]/(a + b*Csch[x]),x]

[Out]

Log[I - Sinh[x]]/(2*(I*a + b)) - Log[I + Sinh[x]]/(2*(I*a - b)) - (b*Log[b + a*Sinh[x]])/(a^2 + b^2)

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2721

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\text {sech}(x)}{a+b \text {csch}(x)} \, dx &=i \int \frac {\tanh (x)}{i b+i a \sinh (x)} \, dx\\ &=-\left (i \operatorname {Subst}\left (\int \frac {x}{(i b+x) \left (a^2-x^2\right )} \, dx,x,i a \sinh (x)\right )\right )\\ &=-\left (i \operatorname {Subst}\left (\int \left (\frac {1}{2 (a+i b) (a-x)}-\frac {b}{\left (a^2+b^2\right ) (b-i x)}+\frac {1}{2 (a-i b) (a+x)}\right ) \, dx,x,i a \sinh (x)\right )\right )\\ &=\frac {\log (i-\sinh (x))}{2 (i a+b)}-\frac {\log (i+\sinh (x))}{2 (i a-b)}-\frac {b \log (b+a \sinh (x))}{a^2+b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 36, normalized size = 0.56 \[ \frac {-b \log (a \sinh (x)+b)+2 a \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )+b \log (\cosh (x))}{a^2+b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Sech[x]/(a + b*Csch[x]),x]

[Out]

(2*a*ArcTan[Tanh[x/2]] + b*Log[Cosh[x]] - b*Log[b + a*Sinh[x]])/(a^2 + b^2)

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 57, normalized size = 0.89 \[ \frac {2 \, a \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) - b \log \left (\frac {2 \, {\left (a \sinh \relax (x) + b\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + b \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right )}{a^{2} + b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*csch(x)),x, algorithm="fricas")

[Out]

(2*a*arctan(cosh(x) + sinh(x)) - b*log(2*(a*sinh(x) + b)/(cosh(x) - sinh(x))) + b*log(2*cosh(x)/(cosh(x) - sin
h(x))))/(a^2 + b^2)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 89, normalized size = 1.39 \[ -\frac {a b \log \left ({\left | -a {\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, b \right |}\right )}{a^{3} + a b^{2}} + \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right )\right )} a}{2 \, {\left (a^{2} + b^{2}\right )}} + \frac {b \log \left ({\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4\right )}{2 \, {\left (a^{2} + b^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*csch(x)),x, algorithm="giac")

[Out]

-a*b*log(abs(-a*(e^(-x) - e^x) + 2*b))/(a^3 + a*b^2) + 1/2*(pi + 2*arctan(1/2*(e^(2*x) - 1)*e^(-x)))*a/(a^2 +
b^2) + 1/2*b*log((e^(-x) - e^x)^2 + 4)/(a^2 + b^2)

________________________________________________________________________________________

maple [A]  time = 0.15, size = 84, normalized size = 1.31 \[ -\frac {2 b \ln \left (\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) b -2 a \tanh \left (\frac {x}{2}\right )-b \right )}{2 a^{2}+2 b^{2}}+\frac {2 b \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{2 a^{2}+2 b^{2}}+\frac {4 a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{2 a^{2}+2 b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(x)/(a+b*csch(x)),x)

[Out]

-2*b/(2*a^2+2*b^2)*ln(tanh(1/2*x)^2*b-2*a*tanh(1/2*x)-b)+2/(2*a^2+2*b^2)*b*ln(tanh(1/2*x)^2+1)+4/(2*a^2+2*b^2)
*a*arctan(tanh(1/2*x))

________________________________________________________________________________________

maxima [A]  time = 0.40, size = 66, normalized size = 1.03 \[ -\frac {2 \, a \arctan \left (e^{\left (-x\right )}\right )}{a^{2} + b^{2}} - \frac {b \log \left (-2 \, b e^{\left (-x\right )} + a e^{\left (-2 \, x\right )} - a\right )}{a^{2} + b^{2}} + \frac {b \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{2} + b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*csch(x)),x, algorithm="maxima")

[Out]

-2*a*arctan(e^(-x))/(a^2 + b^2) - b*log(-2*b*e^(-x) + a*e^(-2*x) - a)/(a^2 + b^2) + b*log(e^(-2*x) + 1)/(a^2 +
 b^2)

________________________________________________________________________________________

mupad [B]  time = 2.36, size = 93, normalized size = 1.45 \[ \frac {\ln \left (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{b+a\,1{}\mathrm {i}}-\frac {b\,\ln \left (a^3\,{\mathrm {e}}^{2\,x}-4\,a\,b^2-a^3+8\,b^3\,{\mathrm {e}}^x+2\,a^2\,b\,{\mathrm {e}}^x+4\,a\,b^2\,{\mathrm {e}}^{2\,x}\right )}{a^2+b^2}+\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{a+b\,1{}\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x)*(a + b/sinh(x))),x)

[Out]

log(exp(x)*1i + 1)/(a*1i + b) + (log(exp(x) + 1i)*1i)/(a + b*1i) - (b*log(a^3*exp(2*x) - 4*a*b^2 - a^3 + 8*b^3
*exp(x) + 2*a^2*b*exp(x) + 4*a*b^2*exp(2*x)))/(a^2 + b^2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\operatorname {sech}{\relax (x )}}{a + b \operatorname {csch}{\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*csch(x)),x)

[Out]

Integral(sech(x)/(a + b*csch(x)), x)

________________________________________________________________________________________