Optimal. Leaf size=34 \[ \left (2 e^{-2 x}+x\right ) \left (-x+x^2+(e-x) (-3+x-\log (1-x))\right ) \]
________________________________________________________________________________________
Rubi [C] time = 3.88, antiderivative size = 167, normalized size of antiderivative = 4.91, number of steps used = 43, number of rules used = 11, integrand size = 106, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.104, Rules used = {6742, 2178, 2199, 2194, 2176, 2554, 12, 6688, 698, 2395, 43} \begin {gather*} \frac {2 \text {Ei}(2-2 x)}{e}-\frac {2 \text {Ei}(2 (1-x))}{e}+\frac {1}{2} (5+2 e) x^2-\frac {1}{8} (e-2 x)^2-6 e^{1-2 x}+2 e^{1-2 x} x+4 e^{-2 x} x-\frac {1}{2} (2-e) x+(1-4 e) x+\frac {1}{4} (e-2 x)^2 \log (1-x)-2 e^{1-2 x} \log (1-x)+2 e^{-2 x} x \log (1-x)-\frac {1}{4} (2-e)^2 \log (1-x)+(1-e) \log (1-x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 43
Rule 698
Rule 2176
Rule 2178
Rule 2194
Rule 2199
Rule 2395
Rule 2554
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-\frac {4 e^{-2 x}}{-1+x}+\frac {14 e^{-2 x} x}{-1+x}-\frac {8 e^{-2 x} x^2}{-1+x}-\frac {2 e^{1-2 x} \left (8-9 x+2 x^2\right )}{-1+x}+4 e^{1-2 x} \log (1-x)-\frac {2 e^{-2 x} \log (1-x)}{-1+x}+\frac {6 e^{-2 x} x \log (1-x)}{-1+x}-\frac {4 e^{-2 x} x^2 \log (1-x)}{-1+x}+\frac {-3 e+4 \left (1+\frac {3 e}{2}\right ) x-5 \left (1+\frac {2 e}{5}\right ) x^2-e \log (1-x)+2 \left (1+\frac {e}{2}\right ) x \log (1-x)-2 x^2 \log (1-x)}{1-x}\right ) \, dx\\ &=-\left (2 \int \frac {e^{1-2 x} \left (8-9 x+2 x^2\right )}{-1+x} \, dx\right )-2 \int \frac {e^{-2 x} \log (1-x)}{-1+x} \, dx-4 \int \frac {e^{-2 x}}{-1+x} \, dx+4 \int e^{1-2 x} \log (1-x) \, dx-4 \int \frac {e^{-2 x} x^2 \log (1-x)}{-1+x} \, dx+6 \int \frac {e^{-2 x} x \log (1-x)}{-1+x} \, dx-8 \int \frac {e^{-2 x} x^2}{-1+x} \, dx+14 \int \frac {e^{-2 x} x}{-1+x} \, dx+\int \frac {-3 e+4 \left (1+\frac {3 e}{2}\right ) x-5 \left (1+\frac {2 e}{5}\right ) x^2-e \log (1-x)+2 \left (1+\frac {e}{2}\right ) x \log (1-x)-2 x^2 \log (1-x)}{1-x} \, dx\\ &=-\frac {4 \text {Ei}(2 (1-x))}{e^2}-2 e^{1-2 x} \log (1-x)+2 e^{-2 x} x \log (1-x)-2 \int \left (-7 e^{1-2 x}+\frac {e^{1-2 x}}{-1+x}+2 e^{1-2 x} x\right ) \, dx+2 \int \frac {\text {Ei}(2-2 x)}{e^2 (-1+x)} \, dx-4 \int \frac {e^{1-2 x}}{2-2 x} \, dx+4 \int \frac {e^{-2 x} (3+2 x)-\frac {4 \text {Ei}(2-2 x)}{e^2}}{4 (1-x)} \, dx-6 \int \frac {e^{-2 x}-\frac {2 \text {Ei}(2-2 x)}{e^2}}{2-2 x} \, dx-8 \int \left (e^{-2 x}+\frac {e^{-2 x}}{-1+x}+e^{-2 x} x\right ) \, dx+14 \int \left (e^{-2 x}+\frac {e^{-2 x}}{-1+x}\right ) \, dx+\int \frac {-x (-4+5 x)-e \left (3-6 x+2 x^2\right )+(e-2 x) (-1+x) \log (1-x)}{1-x} \, dx\\ &=\frac {2 \text {Ei}(2-2 x)}{e}-\frac {4 \text {Ei}(2 (1-x))}{e^2}-2 e^{1-2 x} \log (1-x)+2 e^{-2 x} x \log (1-x)-2 \int \frac {e^{1-2 x}}{-1+x} \, dx-4 \int e^{1-2 x} x \, dx-6 \int \left (-\frac {e^{-2 x}}{2 (-1+x)}+\frac {\text {Ei}(2-2 x)}{e^2 (-1+x)}\right ) \, dx-8 \int e^{-2 x} \, dx-8 \int \frac {e^{-2 x}}{-1+x} \, dx-8 \int e^{-2 x} x \, dx+14 \int e^{1-2 x} \, dx+14 \int e^{-2 x} \, dx+14 \int \frac {e^{-2 x}}{-1+x} \, dx+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\int \frac {e^{-2 x} (3+2 x)-\frac {4 \text {Ei}(2-2 x)}{e^2}}{1-x} \, dx+\int \left (\frac {-3 e+2 (2+3 e) x-(5+2 e) x^2}{1-x}-(e-2 x) \log (1-x)\right ) \, dx\\ &=-7 e^{1-2 x}-3 e^{-2 x}+2 e^{1-2 x} x+4 e^{-2 x} x+\frac {2 \text {Ei}(2-2 x)}{e}+\frac {2 \text {Ei}(2 (1-x))}{e^2}-\frac {2 \text {Ei}(2 (1-x))}{e}-2 e^{1-2 x} \log (1-x)+2 e^{-2 x} x \log (1-x)-2 \int e^{1-2 x} \, dx+3 \int \frac {e^{-2 x}}{-1+x} \, dx-4 \int e^{-2 x} \, dx+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\frac {6 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\int \frac {-3 e+2 (2+3 e) x-(5+2 e) x^2}{1-x} \, dx+\int \left (-\frac {e^{-2 x} (3+2 x)}{-1+x}+\frac {4 \text {Ei}(2-2 x)}{e^2 (-1+x)}\right ) \, dx-\int (e-2 x) \log (1-x) \, dx\\ &=-6 e^{1-2 x}-e^{-2 x}+2 e^{1-2 x} x+4 e^{-2 x} x+\frac {2 \text {Ei}(2-2 x)}{e}+\frac {5 \text {Ei}(2 (1-x))}{e^2}-\frac {2 \text {Ei}(2 (1-x))}{e}-2 e^{1-2 x} \log (1-x)+\frac {1}{4} (e-2 x)^2 \log (1-x)+2 e^{-2 x} x \log (1-x)+\frac {1}{4} \int \frac {(e-2 x)^2}{1-x} \, dx+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\frac {4 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\frac {6 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\int \frac {e^{-2 x} (3+2 x)}{-1+x} \, dx+\int \left (1-4 e+\frac {1-e}{-1+x}+(5+2 e) x\right ) \, dx\\ &=-6 e^{1-2 x}-e^{-2 x}+(1-4 e) x+2 e^{1-2 x} x+4 e^{-2 x} x+\frac {1}{2} (5+2 e) x^2+\frac {2 \text {Ei}(2-2 x)}{e}+\frac {5 \text {Ei}(2 (1-x))}{e^2}-\frac {2 \text {Ei}(2 (1-x))}{e}+(1-e) \log (1-x)-2 e^{1-2 x} \log (1-x)+\frac {1}{4} (e-2 x)^2 \log (1-x)+2 e^{-2 x} x \log (1-x)+\frac {1}{4} \int \left (2 (-2+e)+2 (e-2 x)+\frac {(-2+e)^2}{1-x}\right ) \, dx+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\frac {4 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\frac {6 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\int \left (2 e^{-2 x}+\frac {5 e^{-2 x}}{-1+x}\right ) \, dx\\ &=-6 e^{1-2 x}-e^{-2 x}-\frac {1}{8} (e-2 x)^2+(1-4 e) x-\frac {1}{2} (2-e) x+2 e^{1-2 x} x+4 e^{-2 x} x+\frac {1}{2} (5+2 e) x^2+\frac {2 \text {Ei}(2-2 x)}{e}+\frac {5 \text {Ei}(2 (1-x))}{e^2}-\frac {2 \text {Ei}(2 (1-x))}{e}+(1-e) \log (1-x)-\frac {1}{4} (2-e)^2 \log (1-x)-2 e^{1-2 x} \log (1-x)+\frac {1}{4} (e-2 x)^2 \log (1-x)+2 e^{-2 x} x \log (1-x)-2 \int e^{-2 x} \, dx-5 \int \frac {e^{-2 x}}{-1+x} \, dx+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\frac {4 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\frac {6 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}\\ &=-6 e^{1-2 x}-\frac {1}{8} (e-2 x)^2+(1-4 e) x-\frac {1}{2} (2-e) x+2 e^{1-2 x} x+4 e^{-2 x} x+\frac {1}{2} (5+2 e) x^2+\frac {2 \text {Ei}(2-2 x)}{e}-\frac {2 \text {Ei}(2 (1-x))}{e}+(1-e) \log (1-x)-\frac {1}{4} (2-e)^2 \log (1-x)-2 e^{1-2 x} \log (1-x)+\frac {1}{4} (e-2 x)^2 \log (1-x)+2 e^{-2 x} x \log (1-x)+\frac {2 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}+\frac {4 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}-\frac {6 \int \frac {\text {Ei}(2-2 x)}{-1+x} \, dx}{e^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.09, size = 36, normalized size = 1.06 \begin {gather*} e^{-2 x} \left (2+e^{2 x} x\right ) (e (-3+x)+2 x+(-e+x) \log (1-x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 66, normalized size = 1.94 \begin {gather*} {\left (2 \, {\left (x - 3\right )} e + {\left (2 \, x^{2} + {\left (x^{2} - 3 \, x\right )} e\right )} e^{\left (2 \, x\right )} + {\left ({\left (x^{2} - x e\right )} e^{\left (2 \, x\right )} + 2 \, x - 2 \, e\right )} \log \left (-x + 1\right ) + 4 \, x\right )} e^{\left (-2 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.21, size = 89, normalized size = 2.62 \begin {gather*} x^{2} e + x^{2} \log \left (-x + 1\right ) - x e \log \left (-x + 1\right ) + 2 \, x e^{\left (-2 \, x\right )} \log \left (-x + 1\right ) + 2 \, x^{2} - 3 \, x e + 4 \, x e^{\left (-2 \, x\right )} + 2 \, x e^{\left (-2 \, x + 1\right )} - 2 \, e^{\left (-2 \, x + 1\right )} \log \left (-x + 1\right ) - 6 \, e^{\left (-2 \, x + 1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.56, size = 85, normalized size = 2.50
method | result | size |
risch | \(-\left (x \,{\mathrm e}^{2 x +1}-{\mathrm e}^{2 x} x^{2}+2 \,{\mathrm e}-2 x \right ) {\mathrm e}^{-2 x} \ln \left (1-x \right )+\left (x^{2} {\mathrm e}^{2 x +1}-3 x \,{\mathrm e}^{2 x +1}+2 \,{\mathrm e}^{2 x} x^{2}+2 x \,{\mathrm e}-6 \,{\mathrm e}+4 x \right ) {\mathrm e}^{-2 x}\) | \(85\) |
norman | \(\left (\left (2 \,{\mathrm e}+4\right ) x +\left ({\mathrm e}+2\right ) x^{2} {\mathrm e}^{2 x}+{\mathrm e}^{2 x} \ln \left (1-x \right ) x^{2}+2 x \ln \left (1-x \right )-2 \,{\mathrm e} \ln \left (1-x \right )-3 x \,{\mathrm e} \,{\mathrm e}^{2 x}-{\mathrm e} \,{\mathrm e}^{2 x} \ln \left (1-x \right ) x -6 \,{\mathrm e}\right ) {\mathrm e}^{-2 x}\) | \(88\) |
default | \(\left (\left (2 \,{\mathrm e}+4\right ) x -2 \,{\mathrm e} \ln \left (1-x \right )+2 x \ln \left (1-x \right )-6 \,{\mathrm e}\right ) {\mathrm e}^{-2 x}-{\mathrm e} \ln \left (1-x \right ) x +{\mathrm e} \ln \left (1-x \right )-3 x \,{\mathrm e}-{\mathrm e}-2 \left (1-x \right ) \ln \left (1-x \right )+\frac {3}{2}+\ln \left (1-x \right ) \left (1-x \right )^{2}+2 x^{2}+x^{2} {\mathrm e}-\ln \left (x -1\right ) {\mathrm e}+\ln \left (x -1\right )\) | \(119\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} 16 \, e^{\left (-1\right )} E_{1}\left (2 \, x - 2\right ) + 4 \, e^{\left (-2\right )} E_{1}\left (2 \, x - 2\right ) + \frac {x^{3} {\left (e + 2\right )} - 2 \, x^{2} {\left (2 \, e + 1\right )} + 3 \, x e + 2 \, {\left (x^{2} {\left (e + 2\right )} - 2 \, x {\left (2 \, e + 1\right )}\right )} e^{\left (-2 \, x\right )} + {\left (x^{3} - x^{2} {\left (e + 1\right )} + x e + 2 \, {\left (x^{2} - x {\left (e + 1\right )} + e\right )} e^{\left (-2 \, x\right )}\right )} \log \left (-x + 1\right )}{x - 1} + \int \frac {2 \, {\left (2 \, x {\left (e + 1\right )} - 5 \, e - 2\right )} e^{\left (-2 \, x\right )}}{x^{2} - 2 \, x + 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.78, size = 39, normalized size = 1.15 \begin {gather*} \left (x+2\,{\mathrm {e}}^{-2\,x}\right )\,\left (2\,x-3\,\mathrm {e}+x\,\mathrm {e}-\mathrm {e}\,\ln \left (1-x\right )+x\,\ln \left (1-x\right )\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.61, size = 66, normalized size = 1.94 \begin {gather*} x^{2} \left (2 + e\right ) - 3 e x + \left (x^{2} - e x\right ) \log {\left (1 - x \right )} + \left (2 x \log {\left (1 - x \right )} + 4 x + 2 e x - 2 e \log {\left (1 - x \right )} - 6 e\right ) e^{- 2 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________