Optimal. Leaf size=21 \[ e^{2-2 e^x+2 x}+2 x-x^2 \]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2282, 12, 2196, 2176, 2194} \begin {gather*} -x^2+2 x+e^{2 x-2 e^x+2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2176
Rule 2194
Rule 2196
Rule 2282
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=2 x-x^2+\int e^{-2 e^x+2 x} \left (2 e^2-2 e^{2+x}\right ) \, dx\\ &=2 x-x^2+\operatorname {Subst}\left (\int 2 e^{2-2 x} (1-x) x \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int e^{2-2 x} (1-x) x \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int \left (e^{2-2 x} x-e^{2-2 x} x^2\right ) \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int e^{2-2 x} x \, dx,x,e^x\right )-2 \operatorname {Subst}\left (\int e^{2-2 x} x^2 \, dx,x,e^x\right )\\ &=-e^{2-2 e^x+x}+e^{2-2 e^x+2 x}+2 x-x^2-2 \operatorname {Subst}\left (\int e^{2-2 x} x \, dx,x,e^x\right )+\operatorname {Subst}\left (\int e^{2-2 x} \, dx,x,e^x\right )\\ &=-\frac {1}{2} e^{2-2 e^x}+e^{2-2 e^x+2 x}+2 x-x^2-\operatorname {Subst}\left (\int e^{2-2 x} \, dx,x,e^x\right )\\ &=e^{2-2 e^x+2 x}+2 x-x^2\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 21, normalized size = 1.00 \begin {gather*} e^{2-2 e^x+2 x}+2 x-x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.54, size = 27, normalized size = 1.29 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, {\left (x e^{2} - e^{\left (x + 2\right )}\right )} e^{\left (-2\right )} + 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 19, normalized size = 0.90 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, x - 2 \, e^{x} + 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 20, normalized size = 0.95
method | result | size |
risch | \(2 x -x^{2}+{\mathrm e}^{2-2 \,{\mathrm e}^{x}+2 x}\) | \(20\) |
norman | \(2 x -x^{2}+{\mathrm e}^{2} {\mathrm e}^{-2 \,{\mathrm e}^{x}+2 x}\) | \(24\) |
default | \(2 x +2 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{-2 \,{\mathrm e}^{x}}}{4}\right )-2 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{2 x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{-2 \,{\mathrm e}^{x}}}{4}\right )-x^{2}\) | \(67\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.38, size = 19, normalized size = 0.90 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, x - 2 \, e^{x} + 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.97, size = 21, normalized size = 1.00 \begin {gather*} 2\,x-x^2+{\mathrm {e}}^{2\,x}\,{\mathrm {e}}^2\,{\mathrm {e}}^{-2\,{\mathrm {e}}^x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.17, size = 19, normalized size = 0.90 \begin {gather*} - x^{2} + 2 x + e^{2} e^{2 x - 2 e^{x}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________