\(\int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx\) [136]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 34 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=-x+\frac {4 x}{\sqrt {5}}-\frac {8 \text {arctanh}\left (\frac {\cosh (x)}{2+\sqrt {5}+\sinh (x)}\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] (verified)

Time = 0.03 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2814, 2736} \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=-\frac {8 \text {arctanh}\left (\frac {\cosh (x)}{\sinh (x)+\sqrt {5}+2}\right )}{\sqrt {5}}+\frac {4 x}{\sqrt {5}}-x \]

[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 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]

Rule 2814

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.82 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=-x-\frac {8 \text {arctanh}\left (\frac {1-2 \tanh \left (\frac {x}{2}\right )}{\sqrt {5}}\right )}{\sqrt {5}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.97

method result size
risch \(-x +\frac {4 \sqrt {5}\, \ln \left ({\mathrm e}^{x}+2-\sqrt {5}\right )}{5}-\frac {4 \sqrt {5}\, \ln \left ({\mathrm e}^{x}+2+\sqrt {5}\right )}{5}\) \(33\)
default \(\frac {8 \sqrt {5}\, \operatorname {arctanh}\left (\frac {\left (2 \tanh \left (\frac {x}{2}\right )-1\right ) \sqrt {5}}{5}\right )}{5}-\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )\) \(37\)

[In]

int((2-sinh(x))/(2+sinh(x)),x,method=_RETURNVERBOSE)

[Out]

-x+4/5*5^(1/2)*ln(exp(x)+2-5^(1/2))-4/5*5^(1/2)*ln(exp(x)+2+5^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.24 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=\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 \]

[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 [A] (verification not implemented)

Time = 0.77 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.50 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=- 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} \]

[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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=\frac {4}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - e^{\left (-x\right )} + 2}{\sqrt {5} + e^{\left (-x\right )} - 2}\right ) - x \]

[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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.97 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=\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 \]

[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

Mupad [B] (verification not implemented)

Time = 1.27 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.41 \[ \int \frac {2-\sinh (x)}{2+\sinh (x)} \, dx=\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} \]

[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