3.583 \(\int \frac {1}{a+b \cosh (x)} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.02, number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2659, 208} \[ \frac {2 \tanh ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Cosh[x])^(-1),x]

[Out]

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

Rule 208

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

Rule 2659

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 41, normalized size = 1.00 \[ -\frac {2 \tan ^{-1}\left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cosh[x])^(-1),x]

[Out]

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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{a+b \cosh (x)} \, dx \]

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[(a + b*Cosh[x])^(-1),x]

[Out]

Could not integrate

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cosh(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.59, size = 32, normalized size = 0.78 \[ \frac {2 \, \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cosh(x)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.07, size = 36, normalized size = 0.88




method result size



default \(\frac {2 \arctanh \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\) \(36\)
risch \(\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{b \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}\) \(109\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*cosh(x)),x,method=_RETURNVERBOSE)

[Out]

2/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tanh(1/2*x)/((a+b)*(a-b))^(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(1/(a+b*cosh(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(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 4.41, size = 126, normalized size = 3.07 \[ \begin {cases} \tilde {\infty } \operatorname {atan}{\left (\tanh {\left (\frac {x}{2} \right )} \right )} & \text {for}\: a = 0 \wedge b = 0 \\- \frac {1}{b \tanh {\left (\frac {x}{2} \right )}} & \text {for}\: a = - b \\\frac {\tanh {\left (\frac {x}{2} \right )}}{b} & \text {for}\: a = b \\- \frac {\log {\left (- \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} - b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} + \frac {\log {\left (\sqrt {\frac {a}{a - b} + \frac {b}{a - b}} + \tanh {\left (\frac {x}{2} \right )} \right )}}{a \sqrt {\frac {a}{a - b} + \frac {b}{a - b}} - b \sqrt {\frac {a}{a - b} + \frac {b}{a - b}}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*cosh(x)),x)

[Out]

Piecewise((zoo*atan(tanh(x/2)), Eq(a, 0) & Eq(b, 0)), (-1/(b*tanh(x/2)), Eq(a, -b)), (tanh(x/2)/b, Eq(a, b)),
(-log(-sqrt(a/(a - b) + b/(a - b)) + tanh(x/2))/(a*sqrt(a/(a - b) + b/(a - b)) - b*sqrt(a/(a - b) + b/(a - b))
) + log(sqrt(a/(a - b) + b/(a - b)) + tanh(x/2))/(a*sqrt(a/(a - b) + b/(a - b)) - b*sqrt(a/(a - b) + b/(a - b)
)), True))

________________________________________________________________________________________