Optimal. Leaf size=32 \[ -e^x \left (x+\log \left (1+x-x^2\right )\right )+\log \left (\frac {1}{2}-e^3+x-\log (x)\right ) \]
________________________________________________________________________________________
Rubi [A] time = 3.02, antiderivative size = 36, normalized size of antiderivative = 1.12, number of steps used = 21, number of rules used = 9, integrand size = 193, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.047, Rules used = {6741, 6728, 6684, 6688, 2194, 2176, 2178, 2554, 2270} \begin {gather*} -e^x \log \left (-x^2+x+1\right )-e^x x+\log \left (2 x-2 \log (x)-2 e^3+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2176
Rule 2178
Rule 2194
Rule 2270
Rule 2554
Rule 6684
Rule 6688
Rule 6728
Rule 6741
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-2+4 x^2-2 x^3+e^x \left (-2 x-4 x^2+x^4+2 x^5+e^3 \left (4 x-2 x^4\right )\right )+e^x \left (-x-3 x^2-x^3+2 x^4+e^3 \left (2 x+2 x^2-2 x^3\right )\right ) \log \left (1+x-x^2\right )+\log (x) \left (e^x \left (4 x-2 x^4\right )+e^x \left (2 x+2 x^2-2 x^3\right ) \log \left (1+x-x^2\right )\right )}{x \left (1+x-x^2\right ) \left (1-2 e^3+2 x-2 \log (x)\right )} \, dx\\ &=\int \left (\frac {2 (-1+x)}{x \left (1-2 e^3+2 x-2 \log (x)\right )}-\frac {e^x \left (-2+x^3-\log \left (1+x-x^2\right )-x \log \left (1+x-x^2\right )+x^2 \log \left (1+x-x^2\right )\right )}{-1-x+x^2}\right ) \, dx\\ &=2 \int \frac {-1+x}{x \left (1-2 e^3+2 x-2 \log (x)\right )} \, dx-\int \frac {e^x \left (-2+x^3-\log \left (1+x-x^2\right )-x \log \left (1+x-x^2\right )+x^2 \log \left (1+x-x^2\right )\right )}{-1-x+x^2} \, dx\\ &=\log \left (1-2 e^3+2 x-2 \log (x)\right )-\int \frac {e^x \left (2-x^3-\left (-1-x+x^2\right ) \log \left (1+x-x^2\right )\right )}{1+x-x^2} \, dx\\ &=\log \left (1-2 e^3+2 x-2 \log (x)\right )-\int \left (\frac {e^x \left (-2+x^3\right )}{-1-x+x^2}+e^x \log \left (1+x-x^2\right )\right ) \, dx\\ &=\log \left (1-2 e^3+2 x-2 \log (x)\right )-\int \frac {e^x \left (-2+x^3\right )}{-1-x+x^2} \, dx-\int e^x \log \left (1+x-x^2\right ) \, dx\\ &=-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right )+\int \frac {e^x (1-2 x)}{1+x-x^2} \, dx-\int \left (e^x+e^x x-\frac {e^x (1-2 x)}{-1-x+x^2}\right ) \, dx\\ &=-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right )-\int e^x \, dx+\int \left (-\frac {2 e^x}{1-\sqrt {5}-2 x}-\frac {2 e^x}{1+\sqrt {5}-2 x}\right ) \, dx-\int e^x x \, dx+\int \frac {e^x (1-2 x)}{-1-x+x^2} \, dx\\ &=-e^x-e^x x-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right )-2 \int \frac {e^x}{1-\sqrt {5}-2 x} \, dx-2 \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx+\int e^x \, dx+\int \left (-\frac {2 e^x}{-1-\sqrt {5}+2 x}-\frac {2 e^x}{-1+\sqrt {5}+2 x}\right ) \, dx\\ &=-e^x x+e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \text {Ei}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )+e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right )-2 \int \frac {e^x}{-1-\sqrt {5}+2 x} \, dx-2 \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx\\ &=-e^x x-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.18, size = 36, normalized size = 1.12 \begin {gather*} -e^x x-e^x \log \left (1+x-x^2\right )+\log \left (1-2 e^3+2 x-2 \log (x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 33, normalized size = 1.03 \begin {gather*} -x e^{x} - e^{x} \log \left (-x^{2} + x + 1\right ) + \log \left (-2 \, x + 2 \, e^{3} + 2 \, \log \relax (x) - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.23, size = 33, normalized size = 1.03 \begin {gather*} -x e^{x} - e^{x} \log \left (-x^{2} + x + 1\right ) + \log \left (-2 \, x + 2 \, e^{3} + 2 \, \log \relax (x) - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.49, size = 30, normalized size = 0.94
method | result | size |
risch | \(-{\mathrm e}^{x} \ln \left (-x^{2}+x +1\right )-{\mathrm e}^{x} x +\ln \left ({\mathrm e}^{3}-x +\ln \relax (x )-\frac {1}{2}\right )\) | \(30\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 29, normalized size = 0.91 \begin {gather*} -x e^{x} - e^{x} \log \left (-x^{2} + x + 1\right ) + \log \left (-x + e^{3} + \log \relax (x) - \frac {1}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.48, size = 29, normalized size = 0.91 \begin {gather*} \ln \left ({\mathrm {e}}^3-x+\ln \relax (x)-\frac {1}{2}\right )-x\,{\mathrm {e}}^x-{\mathrm {e}}^x\,\ln \left (-x^2+x+1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.08, size = 27, normalized size = 0.84 \begin {gather*} \left (- x - \log {\left (- x^{2} + x + 1 \right )}\right ) e^{x} + \log {\left (- x + \log {\relax (x )} - \frac {1}{2} + e^{3} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________