\(\int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx\) [599]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 13, antiderivative size = 15 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=x-(1-x) \tanh \left (\frac {x}{2}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {6874, 3399, 4269, 3556} \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=x-(1-x) \tanh \left (\frac {x}{2}\right ) \]

[In]

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

[Out]

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

Rule 3399

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/2)*(e + Pi*(a/(2*b))) + 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 3556

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

Rule 4269

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 6874

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

Rubi steps \begin{align*} \text {integral}& = \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] (verified)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=\frac {\left (-1+x+x \coth \left (\frac {x}{2}\right )\right ) \sinh (x)}{1+\cosh (x)} \]

[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] (verified)

Time = 0.19 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07

method result size
risch \(2 x -\frac {2 \left (-1+x \right )}{1+{\mathrm e}^{x}}\) \(16\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=\frac {2 \, {\left (x \cosh \left (x\right ) + x \sinh \left (x\right ) + 1\right )}}{\cosh \left (x\right ) + \sinh \left (x\right ) + 1} \]

[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] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.80 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=x \tanh {\left (\frac {x}{2} \right )} + x - \tanh {\left (\frac {x}{2} \right )} \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 35 vs. \(2 (10) = 20\).

Time = 0.19 (sec) , antiderivative size = 35, normalized size of antiderivative = 2.33 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=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 ) \]

[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)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \frac {x+\cosh (x)+\sinh (x)}{1+\cosh (x)} \, dx=2\,x-\frac {2\,x-2}{{\mathrm {e}}^x+1} \]

[In]

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

[Out]

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