Optimal. Leaf size=31 \[ x \left (\frac {\log (x)}{4}+\log \left (4 \left (2-x+e^{-x} \left (2-x+x^2\right )\right )\right )\right ) \]
________________________________________________________________________________________
Rubi [A] time = 2.29, antiderivative size = 35, normalized size of antiderivative = 1.13, number of steps used = 20, number of rules used = 7, integrand size = 110, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.064, Rules used = {6741, 12, 6742, 6688, 2295, 43, 2548} \begin {gather*} x \log \left (4 e^{-x} \left (x^2-x+e^x (2-x)+2\right )\right )+\frac {1}{4} x \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 43
Rule 2295
Rule 2548
Rule 6688
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {2-13 x+13 x^2-4 x^3-e^x (-2+5 x)-\left (-2+e^x (-2+x)+x-x^2\right ) \log (x)-\left (-8+4 x-4 x^2+e^x (-8+4 x)\right ) \log \left (e^{-x} \left (8+e^x (8-4 x)-4 x+4 x^2\right )\right )}{4 \left (2+2 e^x-x-e^x x+x^2\right )} \, dx\\ &=\frac {1}{4} \int \frac {2-13 x+13 x^2-4 x^3-e^x (-2+5 x)-\left (-2+e^x (-2+x)+x-x^2\right ) \log (x)-\left (-8+4 x-4 x^2+e^x (-8+4 x)\right ) \log \left (e^{-x} \left (8+e^x (8-4 x)-4 x+4 x^2\right )\right )}{2+2 e^x-x-e^x x+x^2} \, dx\\ &=\frac {1}{4} \int \left (-\frac {4 x \left (-4+8 x-4 x^2+x^3\right )}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )}+\frac {-2+5 x-2 \log (x)+x \log (x)-8 \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )+4 x \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )}{-2+x}\right ) \, dx\\ &=\frac {1}{4} \int \frac {-2+5 x-2 \log (x)+x \log (x)-8 \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )+4 x \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )}{-2+x} \, dx-\int \frac {x \left (-4+8 x-4 x^2+x^3\right )}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx\\ &=\frac {1}{4} \int \left (\log (x)+\frac {-2+5 x+4 (-2+x) \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )}{-2+x}\right ) \, dx-\int \left (-\frac {4}{-2-2 e^x+x+e^x x-x^2}+\frac {8}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )}+\frac {4 x}{2+2 e^x-x-e^x x+x^2}-\frac {2 x^2}{2+2 e^x-x-e^x x+x^2}+\frac {x^3}{2+2 e^x-x-e^x x+x^2}\right ) \, dx\\ &=\frac {1}{4} \int \log (x) \, dx+\frac {1}{4} \int \frac {-2+5 x+4 (-2+x) \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )}{-2+x} \, dx+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx\\ &=-\frac {x}{4}+\frac {1}{4} x \log (x)+\frac {1}{4} \int \left (\frac {-2+5 x}{-2+x}+4 \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )\right ) \, dx+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx\\ &=-\frac {x}{4}+\frac {1}{4} x \log (x)+\frac {1}{4} \int \frac {-2+5 x}{-2+x} \, dx+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx+\int \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right ) \, dx\\ &=-\frac {x}{4}+\frac {1}{4} x \log (x)+x \log \left (4 e^{-x} \left (2+e^x (2-x)-x+x^2\right )\right )+\frac {1}{4} \int \left (5+\frac {8}{-2+x}\right ) \, dx+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x \left (-3-e^x+3 x-x^2\right )}{2-e^x (-2+x)-x+x^2} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx\\ &=x+2 \log (2-x)+\frac {1}{4} x \log (x)+x \log \left (4 e^{-x} \left (2+e^x (2-x)-x+x^2\right )\right )+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx-\int \left (\frac {x}{-2+x}-\frac {x \left (-4+8 x-4 x^2+x^3\right )}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )}\right ) \, dx\\ &=x+2 \log (2-x)+\frac {1}{4} x \log (x)+x \log \left (4 e^{-x} \left (2+e^x (2-x)-x+x^2\right )\right )+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \frac {x}{-2+x} \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx+\int \frac {x \left (-4+8 x-4 x^2+x^3\right )}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx\\ &=x+2 \log (2-x)+\frac {1}{4} x \log (x)+x \log \left (4 e^{-x} \left (2+e^x (2-x)-x+x^2\right )\right )+2 \int \frac {x^2}{2+2 e^x-x-e^x x+x^2} \, dx+4 \int \frac {1}{-2-2 e^x+x+e^x x-x^2} \, dx-4 \int \frac {x}{2+2 e^x-x-e^x x+x^2} \, dx-8 \int \frac {1}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )} \, dx-\int \left (1+\frac {2}{-2+x}\right ) \, dx-\int \frac {x^3}{2+2 e^x-x-e^x x+x^2} \, dx+\int \left (-\frac {4}{-2-2 e^x+x+e^x x-x^2}+\frac {8}{(-2+x) \left (2+2 e^x-x-e^x x+x^2\right )}+\frac {4 x}{2+2 e^x-x-e^x x+x^2}-\frac {2 x^2}{2+2 e^x-x-e^x x+x^2}+\frac {x^3}{2+2 e^x-x-e^x x+x^2}\right ) \, dx\\ &=\frac {1}{4} x \log (x)+x \log \left (4 e^{-x} \left (2+e^x (2-x)-x+x^2\right )\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 34, normalized size = 1.10 \begin {gather*} \frac {1}{4} x \left (\log (x)+4 \log \left (4 e^{-x} \left (2-e^x (-2+x)-x+x^2\right )\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.59, size = 30, normalized size = 0.97 \begin {gather*} x \log \left (4 \, {\left (x^{2} - {\left (x - 2\right )} e^{x} - x + 2\right )} e^{\left (-x\right )}\right ) + \frac {1}{4} \, x \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.67, size = 32, normalized size = 1.03 \begin {gather*} x \log \left (4 \, {\left (x^{2} - x e^{x} - x + 2 \, e^{x} + 2\right )} e^{\left (-x\right )}\right ) + \frac {1}{4} \, x \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.20, size = 240, normalized size = 7.74
method | result | size |
risch | \(-x \ln \left ({\mathrm e}^{x}\right )+x \ln \left (x^{2}+\left (-{\mathrm e}^{x}-1\right ) x +2 \,{\mathrm e}^{x}+2\right )+\frac {x \ln \relax (x )}{4}-\frac {i \pi x \,\mathrm {csgn}\left (i \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{2}}{2}-\frac {i \pi x \,\mathrm {csgn}\left (i \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-x}\right )}{2}+\frac {i \pi x \mathrm {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{-x}\right )}{2}+\frac {i \pi x \mathrm {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-{\mathrm e}^{x}-1\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{3}}{2}+2 x \ln \relax (2)\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.49, size = 39, normalized size = 1.26 \begin {gather*} -{\left (-i \, \pi - 2 \, \log \relax (2)\right )} x - x^{2} + x \log \left (-x^{2} + {\left (x - 2\right )} e^{x} + x - 2\right ) + \frac {1}{4} \, x \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.85, size = 33, normalized size = 1.06 \begin {gather*} \frac {x\,\ln \relax (x)}{4}+x\,\ln \left (-{\mathrm {e}}^{-x}\,\left (4\,x+{\mathrm {e}}^x\,\left (4\,x-8\right )-4\,x^2-8\right )\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.84, size = 31, normalized size = 1.00 \begin {gather*} \frac {x \log {\relax (x )}}{4} + x \log {\left (\left (4 x^{2} - 4 x + \left (8 - 4 x\right ) e^{x} + 8\right ) e^{- x} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________