3.136 \(\int \frac{2-\sinh (x)}{2+\sinh (x)} \, dx\)

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

[Out]

-x + (4*x)/Sqrt[5] - (8*ArcTanh[Cosh[x]/(2 + Sqrt[5] + Sinh[x])])/Sqrt[5]

________________________________________________________________________________________

Rubi [A]  time = 0.037192, antiderivative size = 34, 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{4 x}{\sqrt{5}}-x-\frac{8 \tanh ^{-1}\left (\frac{\cosh (x)}{\sinh (x)+\sqrt{5}+2}\right )}{\sqrt{5}} \]

Antiderivative was successfully verified.

[In]

Int[(2 - Sinh[x])/(2 + Sinh[x]),x]

[Out]

-x + (4*x)/Sqrt[5] - (8*ArcTanh[Cosh[x]/(2 + Sqrt[5] + Sinh[x])])/Sqrt[5]

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{2-\sinh (x)}{2+\sinh (x)} \, dx &=-x+4 \int \frac{1}{2+\sinh (x)} \, dx\\ &=-x+\frac{4 x}{\sqrt{5}}-\frac{8 \tanh ^{-1}\left (\frac{\cosh (x)}{2+\sqrt{5}+\sinh (x)}\right )}{\sqrt{5}}\\ \end{align*}

Mathematica [A]  time = 0.0855739, size = 28, normalized size = 0.82 \[ -x-\frac{8 \tanh ^{-1}\left (\frac{1-2 \tanh \left (\frac{x}{2}\right )}{\sqrt{5}}\right )}{\sqrt{5}} \]

Antiderivative was successfully verified.

[In]

Integrate[(2 - Sinh[x])/(2 + Sinh[x]),x]

[Out]

-x - (8*ArcTanh[(1 - 2*Tanh[x/2])/Sqrt[5]])/Sqrt[5]

________________________________________________________________________________________

Maple [A]  time = 0.016, size = 37, normalized size = 1.1 \begin{align*} -\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) +\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) +{\frac{8\,\sqrt{5}}{5}{\it Artanh} \left ({\frac{\sqrt{5}}{5} \left ( 2\,\tanh \left ( x/2 \right ) -1 \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2-sinh(x))/(2+sinh(x)),x)

[Out]

-ln(tanh(1/2*x)+1)+ln(tanh(1/2*x)-1)+8/5*5^(1/2)*arctanh(1/5*(2*tanh(1/2*x)-1)*5^(1/2))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.75286, size = 139, normalized size = 4.09 \begin{align*} \frac{4}{5} \, \sqrt{5} \log \left (-\frac{{\left (2 \, \sqrt{5} - 5\right )} \cosh \left (x\right ) - 2 \,{\left (\sqrt{5} - 2\right )} \sinh \left (x\right ) + \sqrt{5} - 2}{\sinh \left (x\right ) + 2}\right ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2-sinh(x))/(2+sinh(x)),x)

[Out]

Timed out

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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