3.127 \(\int \frac{1}{1+\coth (x)} \, dx\)

Optimal. Leaf size=16 \[ \frac{x}{2}-\frac{1}{2 (\coth (x)+1)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0083708, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3479, 8} \[ \frac{x}{2}-\frac{1}{2 (\coth (x)+1)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3479

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]

Rule 8

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

Rubi steps

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

Mathematica [A]  time = 0.0252688, size = 18, normalized size = 1.12 \[ \frac{1}{4} (2 x-\sinh (2 x)+\cosh (2 x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*x + Cosh[2*x] - Sinh[2*x])/4

________________________________________________________________________________________

Maple [A]  time = 0., size = 24, normalized size = 1.5 \begin{align*} -{\frac{1}{2+2\,{\rm coth} \left (x\right )}}+{\frac{\ln \left ( 1+{\rm coth} \left (x\right ) \right ) }{4}}-{\frac{\ln \left ({\rm coth} \left (x\right )-1 \right ) }{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.1258, size = 14, normalized size = 0.88 \begin{align*} \frac{1}{2} \, x + \frac{1}{4} \, e^{\left (-2 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.76851, size = 88, normalized size = 5.5 \begin{align*} \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 )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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]  time = 0.613514, size = 27, normalized size = 1.69 \begin{align*} \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} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

Giac [A]  time = 1.1395, size = 14, normalized size = 0.88 \begin{align*} \frac{1}{2} \, x + \frac{1}{4} \, e^{\left (-2 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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