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 ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.57, 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 = {6873, 12,
6874, 6820, 2332, 45, 2628} \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 45
Rule 2332
Rule 2628
Rule 6820
Rule 6873
Rule 6874
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]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 1.25, 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 \left (x \right )}{4}-\frac {i \pi x \,\mathrm {csgn}\left (i {\mathrm e}^{-x}\right ) \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}+\frac {i \pi x \,\mathrm {csgn}\left (i {\mathrm e}^{-x}\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 )^{2}}{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 \left (2\right )\) | \(240\) |
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 = 39, normalized size = 1.26 \begin {gather*} -{\left (-i \, \pi - 2 \, \log \left (2\right )\right )} x - x^{2} + x \log \left (-x^{2} + {\left (x - 2\right )} e^{x} + x - 2\right ) + \frac {1}{4} \, x \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, 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 \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.36, size = 31, normalized size = 1.00 \begin {gather*} \frac {x \log {\left (x \right )}}{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]
________________________________________________________________________________________
Giac [A]
time = 0.45, 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 \left (x\right ) \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 \left (x\right )}{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]
________________________________________________________________________________________