3.112 \(\int \frac{\text{sech}(x)}{a+b \tanh (x)} \, dx\)

Optimal. Leaf size=37 \[ \frac{\tan ^{-1}\left (\frac{\cosh (x) (a \tanh (x)+b)}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0318675, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3509, 206} \[ \frac{\tan ^{-1}\left (\frac{\cosh (x) (a \tanh (x)+b)}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3509

Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Dist[f^(-1), Subst[Int[1/(a^
2 + b^2 - x^2), x], x, (b - a*Tan[e + f*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]

Rule 206

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

Rubi steps

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

Mathematica [A]  time = 0.0288495, size = 46, normalized size = 1.24 \[ \frac{2 \tan ^{-1}\left (\frac{a \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a-b} \sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*ArcTan[(b + a*Tanh[x/2])/(Sqrt[a - b]*Sqrt[a + b])])/(Sqrt[a - b]*Sqrt[a + b])

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 39, normalized size = 1.1 \begin{align*} 2\,{\frac{1}{\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tanh \left ( x/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.16479, size = 423, normalized size = 11.43 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}} \log \left (\frac{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )^{2} - 2 \, \sqrt{-a^{2} + b^{2}}{\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} - a + b}{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )^{2} + a - b}\right )}{a^{2} - b^{2}}, -\frac{2 \, \arctan \left (\frac{\sqrt{a^{2} - b^{2}}}{{\left (a + b\right )} \cosh \left (x\right ) +{\left (a + b\right )} \sinh \left (x\right )}\right )}{\sqrt{a^{2} - b^{2}}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[-sqrt(-a^2 + b^2)*log(((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x)^2 - 2*sqrt(-a^2 + b^2)
*(cosh(x) + sinh(x)) - a + b)/((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x)^2 + a - b))/(a^
2 - b^2), -2*arctan(sqrt(a^2 - b^2)/((a + b)*cosh(x) + (a + b)*sinh(x)))/sqrt(a^2 - b^2)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\operatorname{sech}{\left (x \right )}}{a + b \tanh{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.29313, size = 47, normalized size = 1.27 \begin{align*} \frac{2 \, \arctan \left (\frac{a e^{x} + b e^{x}}{\sqrt{a^{2} - b^{2}}}\right )}{\sqrt{a^{2} - b^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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