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/5*x*5^(1/2)-8/5*arctanh(cosh(x)/(2+sinh(x)+5^(1/2)))*5^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 34, normalized size of antiderivative = 1.00, 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 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]

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]

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.09, 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]

________________________________________________________________________________________

fricas [A]  time = 0.87, size = 42, normalized size = 1.24 \[ \frac {4}{5} \, \sqrt {5} \log \left (-\frac {{\left (2 \, \sqrt {5} - 5\right )} \cosh \relax (x) - 2 \, {\left (\sqrt {5} - 2\right )} \sinh \relax (x) + \sqrt {5} - 2}{\sinh \relax (x) + 2}\right ) - x \]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 33, normalized size = 0.97 \[ \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 \]

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

________________________________________________________________________________________

maple [A]  time = 0.03, size = 37, normalized size = 1.09 \[ \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\frac {8 \sqrt {5}\, \arctanh \left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-1\right ) \sqrt {5}}{5}\right )}{5} \]

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 = 0.41, size = 34, normalized size = 1.00 \[ \frac {4}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - e^{\left (-x\right )} + 2}{\sqrt {5} + e^{\left (-x\right )} - 2}\right ) - x \]

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

________________________________________________________________________________________

mupad [B]  time = 0.59, size = 48, normalized size = 1.41 \[ \frac {4\,\sqrt {5}\,\ln \left (-8\,{\mathrm {e}}^x-\frac {4\,\sqrt {5}\,\left (4\,{\mathrm {e}}^x-2\right )}{5}\right )}{5}-x-\frac {4\,\sqrt {5}\,\ln \left (\frac {4\,\sqrt {5}\,\left (4\,{\mathrm {e}}^x-2\right )}{5}-8\,{\mathrm {e}}^x\right )}{5} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(4*5^(1/2)*log(- 8*exp(x) - (4*5^(1/2)*(4*exp(x) - 2))/5))/5 - x - (4*5^(1/2)*log((4*5^(1/2)*(4*exp(x) - 2))/5
 - 8*exp(x)))/5

________________________________________________________________________________________

sympy [A]  time = 1.71, size = 51, normalized size = 1.50 \[ - x + \frac {4 \sqrt {5} \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {1}{2} + \frac {\sqrt {5}}{2} \right )}}{5} - \frac {4 \sqrt {5} \log {\left (\tanh {\left (\frac {x}{2} \right )} - \frac {\sqrt {5}}{2} - \frac {1}{2} \right )}}{5} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________