Optimal. Leaf size=16 \[ \frac{x^2}{2}-x \tanh (x)+\log (\cosh (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0194905, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3720, 3475, 30} \[ \frac{x^2}{2}-x \tanh (x)+\log (\cosh (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3720
Rule 3475
Rule 30
Rubi steps
\begin{align*} \int x \tanh ^2(x) \, dx &=-x \tanh (x)+\int x \, dx+\int \tanh (x) \, dx\\ &=\frac{x^2}{2}+\log (\cosh (x))-x \tanh (x)\\ \end{align*}
Mathematica [A] time = 0.020748, size = 16, normalized size = 1. \[ \frac{x^2}{2}-x \tanh (x)+\log (\cosh (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.013, size = 28, normalized size = 1.8 \begin{align*}{\frac{{x}^{2}}{2}}-2\,x+2\,{\frac{x}{1+{{\rm e}^{2\,x}}}}+\ln \left ( 1+{{\rm e}^{2\,x}} \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.56092, size = 66, normalized size = 4.12 \begin{align*} -\frac{x e^{\left (2 \, x\right )}}{e^{\left (2 \, x\right )} + 1} + \frac{x^{2} +{\left (x^{2} - 2 \, x\right )} e^{\left (2 \, x\right )}}{2 \,{\left (e^{\left (2 \, x\right )} + 1\right )}} + \log \left (e^{\left (2 \, x\right )} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.18759, size = 305, normalized size = 19.06 \begin{align*} \frac{{\left (x^{2} - 4 \, x\right )} \cosh \left (x\right )^{2} + 2 \,{\left (x^{2} - 4 \, x\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (x^{2} - 4 \, x\right )} \sinh \left (x\right )^{2} + x^{2} + 2 \,{\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1\right )} \log \left (\frac{2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{2 \,{\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.171118, size = 17, normalized size = 1.06 \begin{align*} \frac{x^{2}}{2} - x \tanh{\left (x \right )} + x - \log{\left (\tanh{\left (x \right )} + 1 \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.16759, size = 69, normalized size = 4.31 \begin{align*} \frac{x^{2} e^{\left (2 \, x\right )} + x^{2} - 4 \, x e^{\left (2 \, x\right )} + 2 \, e^{\left (2 \, x\right )} \log \left (e^{\left (2 \, x\right )} + 1\right ) + 2 \, \log \left (e^{\left (2 \, x\right )} + 1\right )}{2 \,{\left (e^{\left (2 \, x\right )} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]