Optimal. Leaf size=15 \[ x-(1-x) \tanh \left (\frac {x}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 15, normalized size of antiderivative = 1.00, 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 = {6874, 3399,
4269, 3556} \begin {gather*} x-(1-x) \tanh \left (\frac {x}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3399
Rule 3556
Rule 4269
Rule 6874
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.03, size = 20, normalized size = 1.33 \begin {gather*} \frac {\left (-1+x+x \coth \left (\frac {x}{2}\right )\right ) \sinh (x)}{1+\cosh (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 16, normalized size = 1.07
method | result | size |
risch | \(2 x -\frac {2 \left (-1+x \right )}{1+{\mathrm e}^{x}}\) | \(16\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 35 vs.
\(2 (10) = 20\).
time = 0.87, size = 35, normalized size = 2.33 \begin {gather*} 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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.85, size = 20, normalized size = 1.33 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.14, size = 12, normalized size = 0.80 \begin {gather*} x \tanh {\left (\frac {x}{2} \right )} + x - \tanh {\left (\frac {x}{2} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 14, normalized size = 0.93 \begin {gather*} \frac {2 \, {\left (x e^{x} + 1\right )}}{e^{x} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.29, size = 17, normalized size = 1.13 \begin {gather*} 2\,x-\frac {2\,x-2}{{\mathrm {e}}^x+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________