Optimal. Leaf size=22 \[ -2+x+e^{-2 x} x-\frac {x^2}{2-x} \]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 36, normalized size of antiderivative = 1.64, number of steps used = 7, number of rules used = 5, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.106, Rules used = {27, 6688, 2176, 2194, 683} \begin {gather*} -\frac {1}{2} e^{-2 x} (1-2 x)+\frac {e^{-2 x}}{2}+2 x-\frac {4}{2-x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 683
Rule 2176
Rule 2194
Rule 6688
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-2 x} \left (4-12 x+9 x^2-2 x^3+e^{2 x} \left (4-8 x+2 x^2\right )\right )}{(-2+x)^2} \, dx\\ &=\int \left (e^{-2 x} (1-2 x)+\frac {2 \left (2-4 x+x^2\right )}{(-2+x)^2}\right ) \, dx\\ &=2 \int \frac {2-4 x+x^2}{(-2+x)^2} \, dx+\int e^{-2 x} (1-2 x) \, dx\\ &=-\frac {1}{2} e^{-2 x} (1-2 x)+2 \int \left (1-\frac {2}{(-2+x)^2}\right ) \, dx-\int e^{-2 x} \, dx\\ &=\frac {e^{-2 x}}{2}-\frac {1}{2} e^{-2 x} (1-2 x)-\frac {4}{2-x}+2 x\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 18, normalized size = 0.82 \begin {gather*} \frac {4}{-2+x}+2 x+e^{-2 x} x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 31, normalized size = 1.41 \begin {gather*} \frac {{\left (x^{2} + 2 \, {\left (x^{2} - 2 \, x + 2\right )} e^{\left (2 \, x\right )} - 2 \, x\right )} e^{\left (-2 \, x\right )}}{x - 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 31, normalized size = 1.41 \begin {gather*} \frac {x^{2} e^{\left (-2 \, x\right )} + 2 \, x^{2} - 2 \, x e^{\left (-2 \, x\right )} - 4 \, x + 4}{x - 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.33, size = 18, normalized size = 0.82
method | result | size |
risch | \(\frac {4}{x -2}+2 x +{\mathrm e}^{-2 x} x\) | \(18\) |
default | \(\frac {4}{x -2}+2 x -\frac {9 \,{\mathrm e}^{-2 x}}{2}+\frac {\left (2 x +9\right ) {\mathrm e}^{-2 x}}{2}\) | \(29\) |
norman | \(\frac {\left (x^{2}-4 \,{\mathrm e}^{2 x}-2 x +2 \,{\mathrm e}^{2 x} x^{2}\right ) {\mathrm e}^{-2 x}}{x -2}\) | \(33\) |
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*} -\frac {4 \, e^{\left (-4\right )} E_{2}\left (2 \, x - 4\right )}{x - 2} + \frac {2 \, x^{2} + {\left (x^{2} - 2 \, x\right )} e^{\left (-2 \, x\right )} - 4 \, x + 4}{x - 2} - 4 \, \int \frac {e^{\left (-2 \, x\right )}}{x^{2} - 4 \, x + 4}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.10, size = 17, normalized size = 0.77 \begin {gather*} 2\,x+x\,{\mathrm {e}}^{-2\,x}+\frac {4}{x-2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.15, size = 14, normalized size = 0.64 \begin {gather*} 2 x + x e^{- 2 x} + \frac {4}{x - 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________