### 3.784 $$\int \frac{\text{sech}(x)}{a+c \text{sech}(x)+b \tanh (x)} \, dx$$

Optimal. Leaf size=54 $\frac{2 \tan ^{-1}\left (\frac{(a-c) \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2-c^2}}\right )}{\sqrt{a^2-b^2-c^2}}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0817428, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.267, Rules used = {3165, 3124, 618, 204} $\frac{2 \tan ^{-1}\left (\frac{(a-c) \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2-c^2}}\right )}{\sqrt{a^2-b^2-c^2}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3165

Int[sec[(d_.) + (e_.)*(x_)]^(n_.)*((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(m_)
, x_Symbol] :> Int[1/(b + a*Cos[d + e*x] + c*Sin[d + e*x])^n, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[m + n, 0]
&& IntegerQ[n]

Rule 3124

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2], x]}, Dist[(2*f)/e, Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d +
e*x)/2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]

Rule 618

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

Rule 204

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

Rubi steps

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

Mathematica [A]  time = 0.0411778, size = 54, normalized size = 1. $\frac{2 \tan ^{-1}\left (\frac{(a-c) \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2-c^2}}\right )}{\sqrt{a^2-b^2-c^2}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[-sqrt(-a^2 + b^2 + c^2)*log((2*(a + b)*c*cosh(x) + (a^2 + 2*a*b + b^2)*cosh(x)^2 + (a^2 + 2*a*b + b^2)*sinh(x
)^2 - a^2 + b^2 + 2*c^2 + 2*((a + b)*c + (a^2 + 2*a*b + b^2)*cosh(x))*sinh(x) - 2*sqrt(-a^2 + b^2 + c^2)*((a +
b)*cosh(x) + (a + b)*sinh(x) + c))/((a + b)*cosh(x)^2 + (a + b)*sinh(x)^2 + 2*c*cosh(x) + 2*((a + b)*cosh(x)
+ c)*sinh(x) + a - b))/(a^2 - b^2 - c^2), -2*arctan(-((a + b)*cosh(x) + (a + b)*sinh(x) + c)/sqrt(a^2 - b^2 -
c^2))/sqrt(a^2 - b^2 - c^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 )} + c \operatorname{sech}{\left (x \right )}}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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