Optimal. Leaf size=29 \[ \frac {\log (x)}{x}+x \left (-\log \left (2 \left (1-e^x-x\right )\right )+\log (e x)\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.82, antiderivative size = 26, normalized size of antiderivative = 0.90, number of steps used = 17, number of rules used = 4, integrand size = 104, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.038, Rules used = {6742, 14, 2334, 2548} \begin {gather*} x+x \left (-\log \left (2 \left (-x-e^x+1\right )\right )\right )+\left (x+\frac {1}{x}\right ) \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2334
Rule 2548
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (\frac {(-2+x) x}{-1+e^x+x}+\frac {1+2 x^2-x^3-\log (x)+x^2 \log (x)-x^2 \log \left (-2 \left (-1+e^x+x\right )\right )}{x^2}\right ) \, dx\\ &=\int \frac {(-2+x) x}{-1+e^x+x} \, dx+\int \frac {1+2 x^2-x^3-\log (x)+x^2 \log (x)-x^2 \log \left (-2 \left (-1+e^x+x\right )\right )}{x^2} \, dx\\ &=\int \left (-\frac {2 x}{-1+e^x+x}+\frac {x^2}{-1+e^x+x}\right ) \, dx+\int \left (\frac {1+2 x^2-x^3-\log (x)+x^2 \log (x)}{x^2}-\log \left (-2 \left (-1+e^x+x\right )\right )\right ) \, dx\\ &=-\left (2 \int \frac {x}{-1+e^x+x} \, dx\right )+\int \frac {x^2}{-1+e^x+x} \, dx+\int \frac {1+2 x^2-x^3-\log (x)+x^2 \log (x)}{x^2} \, dx-\int \log \left (-2 \left (-1+e^x+x\right )\right ) \, dx\\ &=-x \log \left (2 \left (1-e^x-x\right )\right )-2 \int \frac {x}{-1+e^x+x} \, dx+\int \frac {\left (1+e^x\right ) x}{-1+e^x+x} \, dx+\int \frac {x^2}{-1+e^x+x} \, dx+\int \left (\frac {1+2 x^2-x^3}{x^2}+\frac {\left (-1+x^2\right ) \log (x)}{x^2}\right ) \, dx\\ &=-x \log \left (2 \left (1-e^x-x\right )\right )-2 \int \frac {x}{-1+e^x+x} \, dx+\int \frac {x^2}{-1+e^x+x} \, dx+\int \frac {1+2 x^2-x^3}{x^2} \, dx+\int \left (x-\frac {(-2+x) x}{-1+e^x+x}\right ) \, dx+\int \frac {\left (-1+x^2\right ) \log (x)}{x^2} \, dx\\ &=\frac {x^2}{2}-x \log \left (2 \left (1-e^x-x\right )\right )+\left (\frac {1}{x}+x\right ) \log (x)-2 \int \frac {x}{-1+e^x+x} \, dx-\int \left (1+\frac {1}{x^2}\right ) \, dx+\int \left (2+\frac {1}{x^2}-x\right ) \, dx-\int \frac {(-2+x) x}{-1+e^x+x} \, dx+\int \frac {x^2}{-1+e^x+x} \, dx\\ &=x-x \log \left (2 \left (1-e^x-x\right )\right )+\left (\frac {1}{x}+x\right ) \log (x)-2 \int \frac {x}{-1+e^x+x} \, dx+\int \frac {x^2}{-1+e^x+x} \, dx-\int \left (-\frac {2 x}{-1+e^x+x}+\frac {x^2}{-1+e^x+x}\right ) \, dx\\ &=x-x \log \left (2 \left (1-e^x-x\right )\right )+\left (\frac {1}{x}+x\right ) \log (x)\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.30, size = 22, normalized size = 0.76 \begin {gather*} x+\left (\frac {1}{x}+x\right ) \log (x)-x \log \left (-2 \left (-1+e^x+x\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.79, size = 34, normalized size = 1.17 \begin {gather*} -\frac {x^{2} \log \left (-2 \, x - 2 \, e^{x} + 2\right ) - x^{2} - {\left (x^{2} + 1\right )} \log \relax (x)}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 31, normalized size = 1.07 \begin {gather*} \frac {x^{2} \log \relax (x) - x^{2} \log \left (-2 \, x - 2 \, e^{x} + 2\right ) + x^{2} + \log \relax (x)}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 37, normalized size = 1.28
method | result | size |
risch | \(-x \ln \left (-2 \,{\mathrm e}^{x}-2 x +2\right )+\frac {2 x^{2} \ln \relax (x )+2 x^{2}+2 \ln \relax (x )}{2 x}\) | \(37\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.52, size = 36, normalized size = 1.24 \begin {gather*} -\frac {{\left (i \, \pi + \log \relax (2) - 1\right )} x^{2} + x^{2} \log \left (x + e^{x} - 1\right ) - {\left (x^{2} + 1\right )} \log \relax (x)}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.35, size = 32, normalized size = 1.10 \begin {gather*} x-x\,\ln \left (2-2\,{\mathrm {e}}^x-2\,x\right )+\ln \relax (x)\,\left (2\,x-\frac {x^2-1}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.74, size = 24, normalized size = 0.83 \begin {gather*} - x \log {\left (- 2 x - 2 e^{x} + 2 \right )} + x + \frac {\left (x^{2} + 1\right ) \log {\relax (x )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________