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

Optimal. Leaf size=26 \[ \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]
time = 0.01, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3560, 8} \begin {gather*} \frac {x}{4}-\frac {1}{4 (\coth (x)+1)}-\frac {1}{4 (\coth (x)+1)^2} \end {gather*}

Antiderivative was successfully verified.

[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*} \int \frac {1}{(1+\coth (x))^2} \, dx &=-\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]
time = 0.04, size = 30, normalized size = 1.15 \begin {gather*} \frac {1}{16} (4 x+4 \cosh (2 x)-\cosh (4 x)-4 \sinh (2 x)+\sinh (4 x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.26, size = 32, normalized size = 1.23

method result size
risch \(\frac {x}{4}+\frac {{\mathrm e}^{-2 x}}{4}-\frac {{\mathrm e}^{-4 x}}{16}\) \(17\)
derivativedivides \(-\frac {\ln \left (\coth \left (x \right )-1\right )}{8}-\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}\) \(32\)
default \(-\frac {\ln \left (\coth \left (x \right )-1\right )}{8}-\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}\) \(32\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 16, normalized size = 0.62 \begin {gather*} \frac {1}{4} \, x + \frac {1}{4} \, e^{\left (-2 \, x\right )} - \frac {1}{16} \, e^{\left (-4 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (20) = 40\).
time = 0.35, size = 52, normalized size = 2.00 \begin {gather*} \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 )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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] Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (20) = 40\).
time = 0.50, size = 88, normalized size = 3.38 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 18, normalized size = 0.69 \begin {gather*} \frac {1}{16} \, {\left (4 \, e^{\left (2 \, x\right )} - 1\right )} e^{\left (-4 \, x\right )} + \frac {1}{4} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.05, size = 16, normalized size = 0.62 \begin {gather*} \frac {x}{4}+\frac {{\mathrm {e}}^{-2\,x}}{4}-\frac {{\mathrm {e}}^{-4\,x}}{16} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________