Optimal. Leaf size=16 \[ \frac {x^2}{2}+\log (\cosh (x))-x \tanh (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3801, 3556, 30}
\begin {gather*} \frac {x^2}{2}-x \tanh (x)+\log (\cosh (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3556
Rule 3801
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.02, size = 16, normalized size = 1.00 \begin {gather*} \frac {x^2}{2}+\log (\cosh (x))-x \tanh (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 28, normalized size = 1.75
method | result | size |
risch | \(\frac {x^{2}}{2}-2 x +\frac {2 x}{1+{\mathrm e}^{2 x}}+\ln \left (1+{\mathrm e}^{2 x}\right )\) | \(28\) |
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. 49 vs.
\(2 (14) = 28\).
time = 1.17, size = 49, normalized size = 3.06 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 93 vs.
\(2 (14) = 28\).
time = 0.74, size = 93, normalized size = 5.81 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 17, normalized size = 1.06 \begin {gather*} \frac {x^{2}}{2} - x \tanh {\left (x \right )} + x - \log {\left (\tanh {\left (x \right )} + 1 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 51 vs.
\(2 (14) = 28\).
time = 0.49, size = 51, normalized size = 3.19 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.31, size = 21, normalized size = 1.31 \begin {gather*} \ln \left ({\mathrm {e}}^{2\,x}+1\right )-x-x\,\mathrm {tanh}\left (x\right )+\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________