\(\int \frac {1}{(1+\cosh (x))^2} \, dx\) [584]

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

Optimal result

Integrand size = 6, antiderivative size = 25 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=\frac {\sinh (x)}{3 (1+\cosh (x))^2}+\frac {\sinh (x)}{3 (1+\cosh (x))} \]

[Out]

1/3*sinh(x)/(1+cosh(x))^2+1/3*sinh(x)/(1+cosh(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2729, 2727} \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=\frac {\sinh (x)}{3 (\cosh (x)+1)}+\frac {\sinh (x)}{3 (\cosh (x)+1)^2} \]

[In]

Int[(1 + Cosh[x])^(-2),x]

[Out]

Sinh[x]/(3*(1 + Cosh[x])^2) + Sinh[x]/(3*(1 + Cosh[x]))

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2729

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*Cos[c + d*x]*((a + b*Sin[c + d*x])^n/(a*d
*(2*n + 1))), x] + Dist[(n + 1)/(a*(2*n + 1)), Int[(a + b*Sin[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d},
 x] && EqQ[a^2 - b^2, 0] && LtQ[n, -1] && IntegerQ[2*n]

Rubi steps \begin{align*} \text {integral}& = \frac {\sinh (x)}{3 (1+\cosh (x))^2}+\frac {1}{3} \int \frac {1}{1+\cosh (x)} \, dx \\ & = \frac {\sinh (x)}{3 (1+\cosh (x))^2}+\frac {\sinh (x)}{3 (1+\cosh (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=\frac {(2+\cosh (x)) \sinh (x)}{3 (1+\cosh (x))^2} \]

[In]

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

[Out]

((2 + Cosh[x])*Sinh[x])/(3*(1 + Cosh[x])^2)

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.60

method result size
risch \(-\frac {2 \left (1+3 \,{\mathrm e}^{x}\right )}{3 \left (1+{\mathrm e}^{x}\right )^{3}}\) \(15\)
default \(-\frac {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{6}+\frac {\tanh \left (\frac {x}{2}\right )}{2}\) \(16\)
parallelrisch \(-\frac {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{6}+\frac {\tanh \left (\frac {x}{2}\right )}{2}\) \(16\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (21) = 42\).

Time = 0.23 (sec) , antiderivative size = 58, normalized size of antiderivative = 2.32 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=-\frac {2 \, {\left (3 \, \cosh \left (x\right ) + 3 \, \sinh \left (x\right ) + 1\right )}}{3 \, {\left (\cosh \left (x\right )^{3} + 3 \, {\left (\cosh \left (x\right ) + 1\right )} \sinh \left (x\right )^{2} + \sinh \left (x\right )^{3} + 3 \, \cosh \left (x\right )^{2} + 3 \, {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) + 1\right )} \sinh \left (x\right ) + 3 \, \cosh \left (x\right ) + 1\right )}} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.56 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=- \frac {\tanh ^{3}{\left (\frac {x}{2} \right )}}{6} + \frac {\tanh {\left (\frac {x}{2} \right )}}{2} \]

[In]

integrate(1/(1+cosh(x))**2,x)

[Out]

-tanh(x/2)**3/6 + tanh(x/2)/2

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (21) = 42\).

Time = 0.21 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.96 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=\frac {2 \, e^{\left (-x\right )}}{3 \, e^{\left (-x\right )} + 3 \, e^{\left (-2 \, x\right )} + e^{\left (-3 \, x\right )} + 1} + \frac {2}{3 \, {\left (3 \, e^{\left (-x\right )} + 3 \, e^{\left (-2 \, x\right )} + e^{\left (-3 \, x\right )} + 1\right )}} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.56 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=-\frac {2 \, {\left (3 \, e^{x} + 1\right )}}{3 \, {\left (e^{x} + 1\right )}^{3}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.39 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.56 \[ \int \frac {1}{(1+\cosh (x))^2} \, dx=-\frac {2\,\left (3\,{\mathrm {e}}^x+1\right )}{3\,{\left ({\mathrm {e}}^x+1\right )}^3} \]

[In]

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

[Out]

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