3.117 \(\int \frac{3+\cosh (x)}{2-\cosh (x)} \, dx\)

Optimal. Leaf size=36 \[ \frac{5 x}{\sqrt{3}}-x+\frac{10 \tanh ^{-1}\left (\frac{\sinh (x)}{-\cosh (x)+\sqrt{3}+2}\right )}{\sqrt{3}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.049653, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {2735, 2657} \[ \frac{5 x}{\sqrt{3}}-x+\frac{10 \tanh ^{-1}\left (\frac{\sinh (x)}{-\cosh (x)+\sqrt{3}+2}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]

Int[(3 + Cosh[x])/(2 - Cosh[x]),x]

[Out]

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

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2657

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

Rubi steps

\begin{align*} \int \frac{3+\cosh (x)}{2-\cosh (x)} \, dx &=-x+5 \int \frac{1}{2-\cosh (x)} \, dx\\ &=-x+\frac{5 x}{\sqrt{3}}+\frac{10 \tanh ^{-1}\left (\frac{\sinh (x)}{2+\sqrt{3}-\cosh (x)}\right )}{\sqrt{3}}\\ \end{align*}

Mathematica [A]  time = 0.0715123, size = 24, normalized size = 0.67 \[ \frac{10 \tanh ^{-1}\left (\sqrt{3} \tanh \left (\frac{x}{2}\right )\right )}{\sqrt{3}}-x \]

Antiderivative was successfully verified.

[In]

Integrate[(3 + Cosh[x])/(2 - Cosh[x]),x]

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.016, size = 32, normalized size = 0.9 \begin{align*} -\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) +\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) +{\frac{10\,\sqrt{3}}{3}{\it Artanh} \left ( \tanh \left ({\frac{x}{2}} \right ) \sqrt{3} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3+cosh(x))/(2-cosh(x)),x)

[Out]

-ln(tanh(1/2*x)+1)+ln(tanh(1/2*x)-1)+10/3*3^(1/2)*arctanh(tanh(1/2*x)*3^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.53155, size = 46, normalized size = 1.28 \begin{align*} \frac{5}{3} \, \sqrt{3} \log \left (-\frac{\sqrt{3} - e^{\left (-x\right )} + 2}{\sqrt{3} + e^{\left (-x\right )} - 2}\right ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.24681, size = 139, normalized size = 3.86 \begin{align*} \frac{5}{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 ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 1.07708, size = 44, normalized size = 1.22 \begin{align*} - x - \frac{5 \sqrt{3} \log{\left (\tanh{\left (\frac{x}{2} \right )} - \frac{\sqrt{3}}{3} \right )}}{3} + \frac{5 \sqrt{3} \log{\left (\tanh{\left (\frac{x}{2} \right )} + \frac{\sqrt{3}}{3} \right )}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3+cosh(x))/(2-cosh(x)),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.19526, size = 50, normalized size = 1.39 \begin{align*} -\frac{5}{3} \, \sqrt{3} \log \left (\frac{{\left | -2 \, \sqrt{3} + 2 \, e^{x} - 4 \right |}}{{\left | 2 \, \sqrt{3} + 2 \, e^{x} - 4 \right |}}\right ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-5/3*sqrt(3)*log(abs(-2*sqrt(3) + 2*e^x - 4)/abs(2*sqrt(3) + 2*e^x - 4)) - x