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(1/2*x))/(a^2-b^2-c^2)^(1/2))/(a^2-b^2-c^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 54, normalized size of antiderivative = 1.00, 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 verified.

[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 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])

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 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 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]

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.06, size = 54, normalized size = 1.00 \[ \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 verified.

[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]

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 234, normalized size = 4.33 \[ \left [-\frac {\sqrt {-a^{2} + b^{2} + c^{2}} \log \left (\frac {2 \, {\left (a + b\right )} c \cosh \relax (x) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \relax (x)^{2} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \relax (x)^{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 \relax (x)\right )} \sinh \relax (x) - 2 \, \sqrt {-a^{2} + b^{2} + c^{2}} {\left ({\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x) + c\right )}}{{\left (a + b\right )} \cosh \relax (x)^{2} + {\left (a + b\right )} \sinh \relax (x)^{2} + 2 \, c \cosh \relax (x) + 2 \, {\left ({\left (a + b\right )} \cosh \relax (x) + c\right )} \sinh \relax (x) + a - b}\right )}{a^{2} - b^{2} - c^{2}}, -\frac {2 \, \arctan \left (-\frac {{\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x) + c}{\sqrt {a^{2} - b^{2} - c^{2}}}\right )}{\sqrt {a^{2} - b^{2} - c^{2}}}\right ] \]

Verification 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)]

________________________________________________________________________________________

giac [A]  time = 0.11, size = 46, normalized size = 0.85 \[ \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}}} \]

Verification 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)

________________________________________________________________________________________

maple [A]  time = 0.24, size = 53, normalized size = 0.98 \[ \frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right )}{\sqrt {a^{2}-b^{2}-c^{2}}} \]

Verification 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.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification 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 >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(c^2+b^2-a^2>0)', see `assume?`
 for more details)Is c^2+b^2-a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 1.82, size = 78, normalized size = 1.44 \[ \frac {2\,\mathrm {atan}\left (\frac {c}{\sqrt {a^2-b^2-c^2}}+\frac {a\,{\mathrm {e}}^x}{\sqrt {a^2-b^2-c^2}}+\frac {b\,{\mathrm {e}}^x}{\sqrt {a^2-b^2-c^2}}\right )}{\sqrt {a^2-b^2-c^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*atan(c/(a^2 - b^2 - c^2)^(1/2) + (a*exp(x))/(a^2 - b^2 - c^2)^(1/2) + (b*exp(x))/(a^2 - b^2 - c^2)^(1/2)))/
(a^2 - b^2 - c^2)^(1/2)

________________________________________________________________________________________

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

Verification 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)

________________________________________________________________________________________