3.1.94 \(\int \frac {\cosh (x)}{1+\tanh (x)} \, dx\) [94]

Optimal. Leaf size=19 \[ \frac {2 \sinh (x)}{3}-\frac {\cosh (x)}{3 (1+\tanh (x))} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3583, 2717} \begin {gather*} \frac {2 \sinh (x)}{3}-\frac {\cosh (x)}{3 (\tanh (x)+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cosh[x]/(1 + Tanh[x]),x]

[Out]

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

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3583

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(b*f*(m + 2*n))), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rubi steps

\begin {align*} \int \frac {\cosh (x)}{1+\tanh (x)} \, dx &=-\frac {\cosh (x)}{3 (1+\tanh (x))}+\frac {2}{3} \int \cosh (x) \, dx\\ &=\frac {2 \sinh (x)}{3}-\frac {\cosh (x)}{3 (1+\tanh (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 23, normalized size = 1.21 \begin {gather*} \frac {1}{12} (-3 \cosh (x)-\cosh (3 x)+9 \sinh (x)+\sinh (3 x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cosh[x]/(1 + Tanh[x]),x]

[Out]

(-3*Cosh[x] - Cosh[3*x] + 9*Sinh[x] + Sinh[3*x])/12

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(39\) vs. \(2(15)=30\).
time = 0.49, size = 40, normalized size = 2.11

method result size
risch \(\frac {{\mathrm e}^{x}}{4}-\frac {{\mathrm e}^{-x}}{2}-\frac {{\mathrm e}^{-3 x}}{12}\) \(18\)
default \(-\frac {1}{2 \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {2}{3 \left (\tanh \left (\frac {x}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {3}{2 \left (\tanh \left (\frac {x}{2}\right )+1\right )}\) \(40\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 17, normalized size = 0.89 \begin {gather*} -\frac {1}{2} \, e^{\left (-x\right )} - \frac {1}{12} \, e^{\left (-3 \, x\right )} + \frac {1}{4} \, e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 25, normalized size = 1.32 \begin {gather*} \frac {\cosh \left (x\right )^{2} + 4 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 3}{6 \, {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 48 vs. \(2 (15) = 30\).
time = 0.18, size = 48, normalized size = 2.53 \begin {gather*} \frac {2 \sinh {\left (x \right )} \tanh {\left (x \right )}}{3 \tanh {\left (x \right )} + 3} + \frac {\sinh {\left (x \right )}}{3 \tanh {\left (x \right )} + 3} + \frac {\cosh {\left (x \right )} \tanh {\left (x \right )}}{3 \tanh {\left (x \right )} + 3} - \frac {\cosh {\left (x \right )}}{3 \tanh {\left (x \right )} + 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(x)/(1+tanh(x)),x)

[Out]

2*sinh(x)*tanh(x)/(3*tanh(x) + 3) + sinh(x)/(3*tanh(x) + 3) + cosh(x)*tanh(x)/(3*tanh(x) + 3) - cosh(x)/(3*tan
h(x) + 3)

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 19, normalized size = 1.00 \begin {gather*} -\frac {1}{12} \, {\left (6 \, e^{\left (2 \, x\right )} + 1\right )} e^{\left (-3 \, x\right )} + \frac {1}{4} \, e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.05, size = 17, normalized size = 0.89 \begin {gather*} \frac {{\mathrm {e}}^x}{4}-\frac {{\mathrm {e}}^{-3\,x}}{12}-\frac {{\mathrm {e}}^{-x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(x)/(tanh(x) + 1),x)

[Out]

exp(x)/4 - exp(-3*x)/12 - exp(-x)/2

________________________________________________________________________________________