\(\int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx\) [112]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 17 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=\frac {\tanh ^2(x)}{2}-\frac {\tanh ^3(x)}{3} \]

[Out]

1/2*tanh(x)^2-1/3*tanh(x)^3

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3597, 862, 45} \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=\frac {\tanh ^2(x)}{2}-\frac {\tanh ^3(x)}{3} \]

[In]

Int[Sech[x]^4/(1 + Coth[x]),x]

[Out]

Tanh[x]^2/2 - Tanh[x]^3/3

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {-1+x^2}{x^4 (1+x)} \, dx,x,\coth (x)\right ) \\ & = -\text {Subst}\left (\int \frac {-1+x}{x^4} \, dx,x,\coth (x)\right ) \\ & = -\text {Subst}\left (\int \left (-\frac {1}{x^4}+\frac {1}{x^3}\right ) \, dx,x,\coth (x)\right ) \\ & = \frac {\tanh ^2(x)}{2}-\frac {\tanh ^3(x)}{3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=\frac {1}{6} (-2+3 \coth (x)) \tanh ^3(x) \]

[In]

Integrate[Sech[x]^4/(1 + Coth[x]),x]

[Out]

((-2 + 3*Coth[x])*Tanh[x]^3)/6

Maple [A] (verified)

Time = 0.93 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.82

method result size
derivativedivides \(-\frac {1}{3 \coth \left (x \right )^{3}}+\frac {1}{2 \coth \left (x \right )^{2}}\) \(14\)
default \(-\frac {1}{3 \coth \left (x \right )^{3}}+\frac {1}{2 \coth \left (x \right )^{2}}\) \(14\)
risch \(-\frac {2 \left (3 \,{\mathrm e}^{2 x}-1\right )}{3 \left (1+{\mathrm e}^{2 x}\right )^{3}}\) \(19\)
parallelrisch \(\frac {11}{18}+\frac {\left (-3+2 \tanh \left (x \right )\right ) \operatorname {sech}\left (x \right )^{2}}{6}-\frac {\tanh \left (x \right )}{3}\) \(19\)

[In]

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

[Out]

-1/3/coth(x)^3+1/2/coth(x)^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (13) = 26\).

Time = 0.24 (sec) , antiderivative size = 84, normalized size of antiderivative = 4.94 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=-\frac {4 \, {\left (\cosh \left (x\right ) + 2 \, \sinh \left (x\right )\right )}}{3 \, {\left (\cosh \left (x\right )^{5} + 5 \, \cosh \left (x\right ) \sinh \left (x\right )^{4} + \sinh \left (x\right )^{5} + {\left (10 \, \cosh \left (x\right )^{2} + 3\right )} \sinh \left (x\right )^{3} + 3 \, \cosh \left (x\right )^{3} + {\left (10 \, \cosh \left (x\right )^{3} + 9 \, \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} + {\left (5 \, \cosh \left (x\right )^{4} + 9 \, \cosh \left (x\right )^{2} + 2\right )} \sinh \left (x\right ) + 4 \, \cosh \left (x\right )\right )}} \]

[In]

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

[Out]

-4/3*(cosh(x) + 2*sinh(x))/(cosh(x)^5 + 5*cosh(x)*sinh(x)^4 + sinh(x)^5 + (10*cosh(x)^2 + 3)*sinh(x)^3 + 3*cos
h(x)^3 + (10*cosh(x)^3 + 9*cosh(x))*sinh(x)^2 + (5*cosh(x)^4 + 9*cosh(x)^2 + 2)*sinh(x) + 4*cosh(x))

Sympy [F]

\[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=\int \frac {\operatorname {sech}^{4}{\left (x \right )}}{\coth {\left (x \right )} + 1}\, dx \]

[In]

integrate(sech(x)**4/(1+coth(x)),x)

[Out]

Integral(sech(x)**4/(coth(x) + 1), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (13) = 26\).

Time = 0.19 (sec) , antiderivative size = 75, normalized size of antiderivative = 4.41 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=-\frac {2 \, e^{\left (-2 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} - \frac {4 \, e^{\left (-4 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} - \frac {2}{3 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1\right )}} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.06 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=-\frac {2 \, {\left (3 \, e^{\left (2 \, x\right )} - 1\right )}}{3 \, {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.06 \[ \int \frac {\text {sech}^4(x)}{1+\coth (x)} \, dx=-\frac {2\,\left (3\,{\mathrm {e}}^{2\,x}-1\right )}{3\,{\left ({\mathrm {e}}^{2\,x}+1\right )}^3} \]

[In]

int(1/(cosh(x)^4*(coth(x) + 1)),x)

[Out]

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