Optimal. Leaf size=28 \[ 3-\frac {10+e^{2 x}+x+x^2}{-e^x+e^x x} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.37, antiderivative size = 41, normalized size of antiderivative = 1.46, number of steps
used = 21, number of rules used = 8, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {27, 6874,
2208, 2209, 2228, 2230, 2225, 2207} \begin {gather*} -e^{-x} x-2 e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 2207
Rule 2208
Rule 2209
Rule 2225
Rule 2228
Rule 2230
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (1+e^{2 x} (2-x)+11 x-x^2+x^3\right )}{(-1+x)^2} \, dx\\ &=\int \left (\frac {e^{-x}}{(-1+x)^2}-\frac {e^x (-2+x)}{(-1+x)^2}+\frac {11 e^{-x} x}{(-1+x)^2}-\frac {e^{-x} x^2}{(-1+x)^2}+\frac {e^{-x} x^3}{(-1+x)^2}\right ) \, dx\\ &=11 \int \frac {e^{-x} x}{(-1+x)^2} \, dx+\int \frac {e^{-x}}{(-1+x)^2} \, dx-\int \frac {e^x (-2+x)}{(-1+x)^2} \, dx-\int \frac {e^{-x} x^2}{(-1+x)^2} \, dx+\int \frac {e^{-x} x^3}{(-1+x)^2} \, dx\\ &=\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-\int \left (e^{-x}+\frac {e^{-x}}{(-1+x)^2}+\frac {2 e^{-x}}{-1+x}\right ) \, dx-\int \frac {e^{-x}}{-1+x} \, dx+\int \left (2 e^{-x}+\frac {e^{-x}}{(-1+x)^2}+\frac {3 e^{-x}}{-1+x}+e^{-x} x\right ) \, dx\\ &=\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-\frac {\text {Ei}(1-x)}{e}+2 \int e^{-x} \, dx-2 \int \frac {e^{-x}}{-1+x} \, dx+3 \int \frac {e^{-x}}{-1+x} \, dx-\int e^{-x} \, dx+\int e^{-x} x \, dx\\ &=-e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-e^{-x} x+\int e^{-x} \, dx\\ &=-2 e^{-x}+\frac {12 e^{-x}}{1-x}+\frac {e^x}{1-x}-e^{-x} x\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.73, size = 23, normalized size = 0.82 \begin {gather*} -\frac {e^{-x} \left (10+e^{2 x}+x+x^2\right )}{-1+x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.74, size = 35, normalized size = 1.25
method | result | size |
norman | \(\frac {\left (-10-x -x^{2}-{\mathrm e}^{2 x}\right ) {\mathrm e}^{-x}}{x -1}\) | \(27\) |
risch | \(-\frac {{\mathrm e}^{x}}{x -1}-\frac {\left (x^{2}+x +10\right ) {\mathrm e}^{-x}}{x -1}\) | \(28\) |
default | \(-\frac {12 \,{\mathrm e}^{-x}}{x -1}-\left (3+x \right ) {\mathrm e}^{-x}-\frac {{\mathrm e}^{x}}{x -1}+{\mathrm e}^{-x}\) | \(35\) |
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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 22, normalized size = 0.79 \begin {gather*} -\frac {{\left ({\left (x^{2} + x + 10\right )} e^{\left (-2 \, x\right )} + 1\right )} e^{x}}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 26, normalized size = 0.93 \begin {gather*} \frac {\left (1 - x\right ) e^{x} + \left (- x^{3} - 9 x + 10\right ) e^{- x}}{x^{2} - 2 x + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 30, normalized size = 1.07 \begin {gather*} -\frac {x^{2} e^{\left (-x\right )} + x e^{\left (-x\right )} + 10 \, e^{\left (-x\right )} + e^{x}}{x - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.12, size = 27, normalized size = 0.96 \begin {gather*} -{\mathrm {e}}^{-x}\,\left (x+2\right )-\frac {{\mathrm {e}}^{-x}\,\left ({\mathrm {e}}^{2\,x}+12\right )}{x-1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________