3.599 \(\int \frac{x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx\)

Optimal. Leaf size=15 \[ x-(1-x) \tanh \left (\frac{x}{2}\right ) \]

[Out]

x - (1 - x)*Tanh[x/2]

________________________________________________________________________________________

Rubi [A]  time = 0.130112, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {6742, 3318, 4184, 3475} \[ x-(1-x) \tanh \left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x - (1 - x)*Tanh[x/2]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 3318

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1*(e + (Pi*a)/(2*b)))/2 + (f*x)/2]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 4184

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

Rule 3475

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

Rubi steps

\begin{align*} \int \frac{x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx &=\int \left (\frac{x+\cosh (x)}{1+\cosh (x)}+\tanh \left (\frac{x}{2}\right )\right ) \, dx\\ &=\int \frac{x+\cosh (x)}{1+\cosh (x)} \, dx+\int \tanh \left (\frac{x}{2}\right ) \, dx\\ &=2 \log \left (\cosh \left (\frac{x}{2}\right )\right )+\int \left (1+\frac{-1+x}{1+\cosh (x)}\right ) \, dx\\ &=x+2 \log \left (\cosh \left (\frac{x}{2}\right )\right )+\int \frac{-1+x}{1+\cosh (x)} \, dx\\ &=x+2 \log \left (\cosh \left (\frac{x}{2}\right )\right )+\frac{1}{2} \int (-1+x) \text{sech}^2\left (\frac{x}{2}\right ) \, dx\\ &=x+2 \log \left (\cosh \left (\frac{x}{2}\right )\right )-(1-x) \tanh \left (\frac{x}{2}\right )-\int \tanh \left (\frac{x}{2}\right ) \, dx\\ &=x-(1-x) \tanh \left (\frac{x}{2}\right )\\ \end{align*}

Mathematica [A]  time = 0.074841, size = 20, normalized size = 1.33 \[ \frac{\sinh (x) \left (x+x \coth \left (\frac{x}{2}\right )-1\right )}{\cosh (x)+1} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.024, size = 16, normalized size = 1.1 \begin{align*} 2\,x-2\,{\frac{-1+x}{1+{{\rm e}^{x}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 0.963221, size = 47, normalized size = 3.13 \begin{align*} x + \frac{2 \, x e^{x}}{e^{x} + 1} - \frac{2}{e^{\left (-x\right )} + 1} + \log \left (\cosh \left (x\right ) + 1\right ) - 2 \, \log \left (e^{x} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.12291, size = 74, normalized size = 4.93 \begin{align*} \frac{2 \,{\left (x \cosh \left (x\right ) + x \sinh \left (x\right ) + 1\right )}}{\cosh \left (x\right ) + \sinh \left (x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.428544, size = 12, normalized size = 0.8 \begin{align*} x \tanh{\left (\frac{x}{2} \right )} + x - \tanh{\left (\frac{x}{2} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.10866, size = 19, normalized size = 1.27 \begin{align*} \frac{2 \,{\left (x e^{x} + 1\right )}}{e^{x} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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