3.6.97 \(\int x \coth ^2(x) \, dx\) [597]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3801, 3556, 30} \begin {gather*} \frac {x^2}{2}-x \coth (x)+\log (\sinh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*Coth[x]^2,x]

[Out]

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

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3556

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

Rule 3801

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(c + d*x)^m*((b*Tan[e
 + f*x])^(n - 1)/(f*(n - 1))), x] + (-Dist[b*d*(m/(f*(n - 1))), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 16, normalized size = 1.00 \begin {gather*} \frac {x^2}{2}-x \coth (x)+\log (\sinh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*Coth[x]^2,x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 28, normalized size = 1.75

method result size
risch \(\frac {x^{2}}{2}-2 x -\frac {2 x}{{\mathrm e}^{2 x}-1}+\ln \left ({\mathrm e}^{2 x}-1\right )\) \(28\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*coth(x)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*x^2-2*x-2*x/(exp(2*x)-1)+ln(exp(2*x)-1)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (14) = 28\).
time = 1.71, size = 53, normalized size = 3.31 \begin {gather*} -\frac {x e^{\left (2 \, x\right )}}{e^{\left (2 \, x\right )} - 1} - \frac {x^{2} - {\left (x^{2} - 2 \, x\right )} e^{\left (2 \, x\right )}}{2 \, {\left (e^{\left (2 \, x\right )} - 1\right )}} + \log \left (e^{x} + 1\right ) + \log \left (e^{x} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (14) = 28\).
time = 0.86, size = 95, normalized size = 5.94 \begin {gather*} \frac {{\left (x^{2} - 4 \, x\right )} \cosh \left (x\right )^{2} + 2 \, {\left (x^{2} - 4 \, x\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (x^{2} - 4 \, x\right )} \sinh \left (x\right )^{2} - x^{2} + 2 \, {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 1\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{2 \, {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.30, size = 22, normalized size = 1.38 \begin {gather*} \frac {x^{2}}{2} + x - \frac {x}{\tanh {\left (x \right )}} - \log {\left (\tanh {\left (x \right )} + 1 \right )} + \log {\left (\tanh {\left (x \right )} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (14) = 28\).
time = 0.44, size = 53, normalized size = 3.31 \begin {gather*} \frac {x^{2} e^{\left (2 \, x\right )} - x^{2} - 4 \, x e^{\left (2 \, x\right )} + 2 \, e^{\left (2 \, x\right )} \log \left (e^{\left (2 \, x\right )} - 1\right ) - 2 \, \log \left (e^{\left (2 \, x\right )} - 1\right )}{2 \, {\left (e^{\left (2 \, x\right )} - 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.29, size = 27, normalized size = 1.69 \begin {gather*} \ln \left ({\mathrm {e}}^{2\,x}-1\right )-2\,x-\frac {2\,x}{{\mathrm {e}}^{2\,x}-1}+\frac {x^2}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*coth(x)^2,x)

[Out]

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

________________________________________________________________________________________