3.2.56 \(\int \frac {1}{2+\cosh (x)} \, dx\) [156]

Optimal. Leaf size=20 \[ \frac {2 \coth ^{-1}\left (\sqrt {3} \coth \left (\frac {x}{2}\right )\right )}{\sqrt {3}} \]

[Out]

2/3*arccoth(3^(1/2)*coth(1/2*x))*3^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 30, normalized size of antiderivative = 1.50, number of steps used = 1, number of rules used = 1, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2736} \begin {gather*} \frac {x}{\sqrt {3}}-\frac {2 \text {arctanh}\left (\frac {\sinh (x)}{\cosh (x)+\sqrt {3}+2}\right )}{\sqrt {3}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(2 + Cosh[x])^(-1),x]

[Out]

x/Sqrt[3] - (2*ArcTanh[Sinh[x]/(2 + Sqrt[3] + Cosh[x])])/Sqrt[3]

Rule 2736

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{q = Rt[a^2 - b^2, 2]}, Simp[x/q, x] + Simp
[(2/(d*q))*ArcTan[b*(Cos[c + d*x]/(a + q + b*Sin[c + d*x]))], x]] /; FreeQ[{a, b, c, d}, x] && GtQ[a^2 - b^2,
0] && PosQ[a]

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=\frac {x}{\sqrt {3}}-\frac {2 \text {arctanh}\left (\frac {\sinh (x)}{2+\sqrt {3}+\cosh (x)}\right )}{\sqrt {3}}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 20, normalized size = 1.00 \begin {gather*} \frac {2 \text {arctanh}\left (\frac {\tanh \left (\frac {x}{2}\right )}{\sqrt {3}}\right )}{\sqrt {3}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(2 + Cosh[x])^(-1),x]

[Out]

(2*ArcTanh[Tanh[x/2]/Sqrt[3]])/Sqrt[3]

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 16, normalized size = 0.80

method result size
default \(\frac {2 \sqrt {3}\, \arctanh \left (\frac {\tanh \left (\frac {x}{2}\right ) \sqrt {3}}{3}\right )}{3}\) \(16\)
risch \(\frac {\sqrt {3}\, \ln \left ({\mathrm e}^{x}+2-\sqrt {3}\right )}{3}-\frac {\sqrt {3}\, \ln \left ({\mathrm e}^{x}+2+\sqrt {3}\right )}{3}\) \(30\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(2+cosh(x)),x,method=_RETURNVERBOSE)

[Out]

2/3*3^(1/2)*arctanh(1/3*tanh(1/2*x)*3^(1/2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (14) = 28\).
time = 0.49, size = 30, normalized size = 1.50 \begin {gather*} -\frac {1}{3} \, \sqrt {3} \log \left (-\frac {\sqrt {3} - e^{\left (-x\right )} - 2}{\sqrt {3} + e^{\left (-x\right )} + 2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(2+cosh(x)),x, algorithm="maxima")

[Out]

-1/3*sqrt(3)*log(-(sqrt(3) - e^(-x) - 2)/(sqrt(3) + e^(-x) + 2))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (14) = 28\).
time = 0.57, size = 39, normalized size = 1.95 \begin {gather*} \frac {1}{3} \, \sqrt {3} \log \left (-\frac {2 \, {\left (\sqrt {3} - 2\right )} \cosh \left (x\right ) - {\left (2 \, \sqrt {3} - 3\right )} \sinh \left (x\right ) + \sqrt {3} - 2}{\cosh \left (x\right ) + 2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(2+cosh(x)),x, algorithm="fricas")

[Out]

1/3*sqrt(3)*log(-(2*(sqrt(3) - 2)*cosh(x) - (2*sqrt(3) - 3)*sinh(x) + sqrt(3) - 2)/(cosh(x) + 2))

________________________________________________________________________________________

Sympy [A]
time = 0.21, size = 36, normalized size = 1.80 \begin {gather*} - \frac {\sqrt {3} \log {\left (\tanh {\left (\frac {x}{2} \right )} - \sqrt {3} \right )}}{3} + \frac {\sqrt {3} \log {\left (\tanh {\left (\frac {x}{2} \right )} + \sqrt {3} \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(2+cosh(x)),x)

[Out]

-sqrt(3)*log(tanh(x/2) - sqrt(3))/3 + sqrt(3)*log(tanh(x/2) + sqrt(3))/3

________________________________________________________________________________________

Giac [A]
time = 0.47, size = 26, normalized size = 1.30 \begin {gather*} \frac {1}{3} \, \sqrt {3} \log \left (-\frac {\sqrt {3} - e^{x} - 2}{\sqrt {3} + e^{x} + 2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(2+cosh(x)),x, algorithm="giac")

[Out]

1/3*sqrt(3)*log(-(sqrt(3) - e^x - 2)/(sqrt(3) + e^x + 2))

________________________________________________________________________________________

Mupad [B]
time = 0.13, size = 42, normalized size = 2.10 \begin {gather*} \frac {\sqrt {3}\,\left (\ln \left (-2\,{\mathrm {e}}^x-\frac {\sqrt {3}\,\left (4\,{\mathrm {e}}^x+2\right )}{3}\right )-\ln \left (\frac {\sqrt {3}\,\left (4\,{\mathrm {e}}^x+2\right )}{3}-2\,{\mathrm {e}}^x\right )\right )}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x) + 2),x)

[Out]

(3^(1/2)*(log(- 2*exp(x) - (3^(1/2)*(4*exp(x) + 2))/3) - log((3^(1/2)*(4*exp(x) + 2))/3 - 2*exp(x))))/3

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 8, normalized size = 0.40 \begin {gather*} \ln \left ({\mathrm e}^{x}+{\mathrm e}^{-x}\right ) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int(1/(2+cosh(x)),x)

[Out]

ln(exp(x)+exp(-x))

________________________________________________________________________________________