\(\int \frac {1}{(1+\coth (x))^2} \, dx\) [66]

   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 = 26 \[ \int \frac {1}{(1+\coth (x))^2} \, dx=\frac {x}{4}-\frac {1}{4 (1+\coth (x))^2}-\frac {1}{4 (1+\coth (x))} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, 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))^2} \, dx=\frac {x}{4}-\frac {1}{4 (\coth (x)+1)}-\frac {1}{4 (\coth (x)+1)^2} \]

[In]

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

[Out]

x/4 - 1/(4*(1 + Coth[x])^2) - 1/(4*(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}{4 (1+\coth (x))^2}+\frac {1}{2} \int \frac {1}{1+\coth (x)} \, dx \\ & = -\frac {1}{4 (1+\coth (x))^2}-\frac {1}{4 (1+\coth (x))}+\frac {\int 1 \, dx}{4} \\ & = \frac {x}{4}-\frac {1}{4 (1+\coth (x))^2}-\frac {1}{4 (1+\coth (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.70 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.08 \[ \int \frac {1}{(1+\coth (x))^2} \, dx=\frac {1}{4} \text {arctanh}(\tanh (x))-\frac {1}{4 (1+\tanh (x))^2}+\frac {3}{4 (1+\tanh (x))} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65

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

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.00 \[ \int \frac {1}{(1+\coth (x))^2} \, dx=\frac {{\left (4 \, x - 1\right )} \cosh \left (x\right )^{2} + 2 \, {\left (4 \, x + 1\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (4 \, x - 1\right )} \sinh \left (x\right )^{2} + 4}{16 \, {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}\right )}} \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.48 (sec) , antiderivative size = 88, normalized size of antiderivative = 3.38 \[ \int \frac {1}{(1+\coth (x))^2} \, dx=\frac {x \tanh ^{2}{\left (x \right )}}{4 \tanh ^{2}{\left (x \right )} + 8 \tanh {\left (x \right )} + 4} + \frac {2 x \tanh {\left (x \right )}}{4 \tanh ^{2}{\left (x \right )} + 8 \tanh {\left (x \right )} + 4} + \frac {x}{4 \tanh ^{2}{\left (x \right )} + 8 \tanh {\left (x \right )} + 4} + \frac {3 \tanh {\left (x \right )}}{4 \tanh ^{2}{\left (x \right )} + 8 \tanh {\left (x \right )} + 4} + \frac {2}{4 \tanh ^{2}{\left (x \right )} + 8 \tanh {\left (x \right )} + 4} \]

[In]

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

[Out]

x*tanh(x)**2/(4*tanh(x)**2 + 8*tanh(x) + 4) + 2*x*tanh(x)/(4*tanh(x)**2 + 8*tanh(x) + 4) + x/(4*tanh(x)**2 + 8
*tanh(x) + 4) + 3*tanh(x)/(4*tanh(x)**2 + 8*tanh(x) + 4) + 2/(4*tanh(x)**2 + 8*tanh(x) + 4)

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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