\(\int \frac {1}{1+\coth (x)} \, dx\) [127]

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

Optimal result

Integrand size = 6, antiderivative size = 16 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {x}{2}-\frac {1}{2 (1+\coth (x))} \]

[Out]

1/2*x-1/2/(1+coth(x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, 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.333, Rules used = {3560, 8} \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {x}{2}-\frac {1}{2 (\coth (x)+1)} \]

[In]

Int[(1 + Coth[x])^(-1),x]

[Out]

x/2 - 1/(2*(1 + Coth[x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3560

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + b*Tan[c + d*x])^n/(2*b*d*n)), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{2 (1+\coth (x))}+\frac {\int 1 \, dx}{2} \\ & = \frac {x}{2}-\frac {1}{2 (1+\coth (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.88 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {1}{2} \left (\text {arctanh}(\tanh (x))+\frac {1}{1+\tanh (x)}\right ) \]

[In]

Integrate[(1 + Coth[x])^(-1),x]

[Out]

(ArcTanh[Tanh[x]] + (1 + Tanh[x])^(-1))/2

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.69

method result size
risch \(\frac {x}{2}+\frac {{\mathrm e}^{-2 x}}{4}\) \(11\)
parallelrisch \(\frac {\tanh \left (x \right ) x +x +1}{2+2 \tanh \left (x \right )}\) \(17\)
derivativedivides \(-\frac {\ln \left (\coth \left (x \right )-1\right )}{4}-\frac {1}{2 \left (1+\coth \left (x \right )\right )}+\frac {\ln \left (1+\coth \left (x \right )\right )}{4}\) \(24\)
default \(-\frac {\ln \left (\coth \left (x \right )-1\right )}{4}-\frac {1}{2 \left (1+\coth \left (x \right )\right )}+\frac {\ln \left (1+\coth \left (x \right )\right )}{4}\) \(24\)

[In]

int(1/(1+coth(x)),x,method=_RETURNVERBOSE)

[Out]

1/2*x+1/4*exp(-2*x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 26 vs. \(2 (12) = 24\).

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.62 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {{\left (2 \, x + 1\right )} \cosh \left (x\right ) + {\left (2 \, x - 1\right )} \sinh \left (x\right )}{4 \, {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}} \]

[In]

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

[Out]

1/4*((2*x + 1)*cosh(x) + (2*x - 1)*sinh(x))/(cosh(x) + sinh(x))

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (10) = 20\).

Time = 0.25 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.69 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {x \tanh {\left (x \right )}}{2 \tanh {\left (x \right )} + 2} + \frac {x}{2 \tanh {\left (x \right )} + 2} + \frac {1}{2 \tanh {\left (x \right )} + 2} \]

[In]

integrate(1/(1+coth(x)),x)

[Out]

x*tanh(x)/(2*tanh(x) + 2) + x/(2*tanh(x) + 2) + 1/(2*tanh(x) + 2)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.62 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {1}{2} \, x + \frac {1}{4} \, e^{\left (-2 \, x\right )} \]

[In]

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

[Out]

1/2*x + 1/4*e^(-2*x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.62 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {1}{2} \, x + \frac {1}{4} \, e^{\left (-2 \, x\right )} \]

[In]

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

[Out]

1/2*x + 1/4*e^(-2*x)

Mupad [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.88 \[ \int \frac {1}{1+\coth (x)} \, dx=\frac {x}{2}-\frac {1}{2\,\left (\mathrm {coth}\left (x\right )+1\right )} \]

[In]

int(1/(coth(x) + 1),x)

[Out]

x/2 - 1/(2*(coth(x) + 1))