3.64 \(\int (1+\coth (x))^2 \, dx\)

Optimal. Leaf size=13 \[ 2 x-\coth (x)+2 \log (\sinh (x)) \]

[Out]

2*x-coth(x)+2*ln(sinh(x))

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 13, normalized size of antiderivative = 1.00, 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 = {3477, 3475} \[ 2 x-\coth (x)+2 \log (\sinh (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*x - Coth[x] + 2*Log[Sinh[x]]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3477

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 13, normalized size = 1.00 \[ 2 x-\coth (x)+2 \log (\sinh (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*x - Coth[x] + 2*Log[Sinh[x]]

________________________________________________________________________________________

fricas [B]  time = 0.41, size = 53, normalized size = 4.08 \[ \frac {2 \, {\left ({\left (\cosh \relax (x)^{2} + 2 \, \cosh \relax (x) \sinh \relax (x) + \sinh \relax (x)^{2} - 1\right )} \log \left (\frac {2 \, \sinh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right ) - 1\right )}}{\cosh \relax (x)^{2} + 2 \, \cosh \relax (x) \sinh \relax (x) + \sinh \relax (x)^{2} - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.13, size = 21, normalized size = 1.62 \[ -\frac {2}{e^{\left (2 \, x\right )} - 1} + 2 \, \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2/(e^(2*x) - 1) + 2*log(abs(e^(2*x) - 1))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 13, normalized size = 1.00 \[ -\coth \relax (x )-2 \ln \left (\coth \relax (x )-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-coth(x)-2*ln(coth(x)-1)

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 19, normalized size = 1.46 \[ 2 \, x + \frac {2}{e^{\left (-2 \, x\right )} - 1} + 2 \, \log \left (\sinh \relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x + 2/(e^(-2*x) - 1) + 2*log(sinh(x))

________________________________________________________________________________________

mupad [B]  time = 1.14, size = 20, normalized size = 1.54 \[ 2\,\ln \left ({\mathrm {e}}^{2\,x}-1\right )-\frac {2}{{\mathrm {e}}^{2\,x}-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(exp(2*x) - 1) - 2/(exp(2*x) - 1)

________________________________________________________________________________________

sympy [A]  time = 0.37, size = 22, normalized size = 1.69 \[ 4 x - 2 \log {\left (\tanh {\relax (x )} + 1 \right )} + 2 \log {\left (\tanh {\relax (x )} \right )} - \frac {1}{\tanh {\relax (x )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*x - 2*log(tanh(x) + 1) + 2*log(tanh(x)) - 1/tanh(x)

________________________________________________________________________________________