Optimal. Leaf size=29 \[ \frac {\log (x)}{x}+x \left (-\log \left (2 \left (1-e^x-x\right )\right )+\log (e x)\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.90, antiderivative size = 28, normalized size of antiderivative = 0.97, 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 = {6874, 14,
2372, 2628} \begin {gather*} x+x \left (-\log \left (2 \left (-x-e^x+1\right )\right )\right )+x \log (x)+\frac {\log (x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 2372
Rule 2628
Rule 6874
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.20, 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]
________________________________________________________________________________________
Maple [A]
time = 0.51, 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 \left (x \right )+2 x^{2}+2 \ln \left (x \right )}{2 x}\) | \(37\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.51, size = 36, normalized size = 1.24 \begin {gather*} -\frac {{\left (i \, \pi + \log \left (2\right ) - 1\right )} x^{2} + x^{2} \log \left (x + e^{x} - 1\right ) - {\left (x^{2} + 1\right )} \log \left (x\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, 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 \left (x\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.22, 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 {\left (x \right )}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 31, normalized size = 1.07 \begin {gather*} \frac {x^{2} \log \left (x\right ) - x^{2} \log \left (-2 \, x - 2 \, e^{x} + 2\right ) + x^{2} + \log \left (x\right )}{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 \left (x\right )\,\left (2\,x-\frac {x^2-1}{x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________