3.1.63 \(\int (1+\coth (x))^3 \, dx\) [63]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 23, 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 = {3559, 3558, 3556} \begin {gather*} 4 x-\frac {1}{2} (\coth (x)+1)^2-2 \coth (x)+4 \log (\sinh (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

4*x - 2*Coth[x] - (1 + Coth[x])^2/2 + 4*Log[Sinh[x]]

Rule 3556

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

Rule 3558

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]

Rule 3559

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))
), x] + Dist[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] && G
tQ[n, 1]

Rubi steps

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

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 0.11, size = 61, normalized size = 2.65 \begin {gather*} \frac {1}{4} \text {csch}^2(x) \left (-1-2 x-8 \log (\cosh (x))-8 \log (\tanh (x))+\cosh (2 x) (-1+2 x+8 \log (\cosh (x))+8 \log (\tanh (x)))-6 \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\tanh ^2(x)\right ) \sinh (2 x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(Csch[x]^2*(-1 - 2*x - 8*Log[Cosh[x]] - 8*Log[Tanh[x]] + Cosh[2*x]*(-1 + 2*x + 8*Log[Cosh[x]] + 8*Log[Tanh[x]]
) - 6*Hypergeometric2F1[-1/2, 1, 1/2, Tanh[x]^2]*Sinh[2*x]))/4

________________________________________________________________________________________

Maple [A]
time = 0.19, size = 19, normalized size = 0.83

method result size
derivativedivides \(-\frac {\left (\coth ^{2}\left (x \right )\right )}{2}-3 \coth \left (x \right )-4 \ln \left (\coth \left (x \right )-1\right )\) \(19\)
default \(-\frac {\left (\coth ^{2}\left (x \right )\right )}{2}-3 \coth \left (x \right )-4 \ln \left (\coth \left (x \right )-1\right )\) \(19\)
risch \(-\frac {2 \left (4 \,{\mathrm e}^{2 x}-3\right )}{\left ({\mathrm e}^{2 x}-1\right )^{2}}+4 \ln \left ({\mathrm e}^{2 x}-1\right )\) \(29\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (21) = 42\).
time = 0.27, size = 55, normalized size = 2.39 \begin {gather*} 5 \, x + \frac {2 \, e^{\left (-2 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} - e^{\left (-4 \, x\right )} - 1} + \frac {6}{e^{\left (-2 \, x\right )} - 1} + \log \left (e^{\left (-x\right )} + 1\right ) + \log \left (e^{\left (-x\right )} - 1\right ) + 3 \, \log \left (\sinh \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

5*x + 2*e^(-2*x)/(2*e^(-2*x) - e^(-4*x) - 1) + 6/(e^(-2*x) - 1) + log(e^(-x) + 1) + log(e^(-x) - 1) + 3*log(si
nh(x))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 142 vs. \(2 (21) = 42\).
time = 0.34, size = 142, normalized size = 6.17 \begin {gather*} -\frac {2 \, {\left (4 \, \cosh \left (x\right )^{2} - 2 \, {\left (\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 2 \, {\left (3 \, \cosh \left (x\right )^{2} - 1\right )} \sinh \left (x\right )^{2} - 2 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} - \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 8 \, \cosh \left (x\right ) \sinh \left (x\right ) + 4 \, \sinh \left (x\right )^{2} - 3\right )}}{\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 2 \, {\left (3 \, \cosh \left (x\right )^{2} - 1\right )} \sinh \left (x\right )^{2} - 2 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} - \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.39, size = 31, normalized size = 1.35 \begin {gather*} 8 x - 4 \log {\left (\tanh {\left (x \right )} + 1 \right )} + 4 \log {\left (\tanh {\left (x \right )} \right )} - \frac {3}{\tanh {\left (x \right )}} - \frac {1}{2 \tanh ^{2}{\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 29, normalized size = 1.26 \begin {gather*} -\frac {2 \, {\left (4 \, e^{\left (2 \, x\right )} - 3\right )}}{{\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} + 4 \, \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 36, normalized size = 1.57 \begin {gather*} 4\,\ln \left ({\mathrm {e}}^{2\,x}-1\right )-\frac {2}{{\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1}-\frac {8}{{\mathrm {e}}^{2\,x}-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*log(exp(2*x) - 1) - 2/(exp(4*x) - 2*exp(2*x) + 1) - 8/(exp(2*x) - 1)

________________________________________________________________________________________