Optimal. Leaf size=27 \[ 8-e^{-((-2+x) x)} \left (3-9 (-5+x)+e^5 \log (2+x)\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.92, antiderivative size = 46, normalized size of antiderivative = 1.70, number of steps used = 18, number of rules used = 9, integrand size = 55, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.164, Rules used = {6741, 6742, 2234, 2205, 2240, 2241, 2236, 2554, 12} \begin {gather*} 9 e^{2 x-x^2} x-48 e^{2 x-x^2}-e^{-x^2+2 x+5} \log (x+2) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2205
Rule 2234
Rule 2236
Rule 2240
Rule 2241
Rule 2554
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{2 x-x^2} \left (-174 \left (1+\frac {e^5}{174}\right )+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx\\ &=\int \left (\frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3\right )}{2+x}+2 e^{5+2 x-x^2} (-1+x) \log (2+x)\right ) \, dx\\ &=2 \int e^{5+2 x-x^2} (-1+x) \log (2+x) \, dx+\int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3\right )}{2+x} \, dx\\ &=-e^{5+2 x-x^2} \log (2+x)-2 \int -\frac {e^{5+2 x-x^2}}{2 (2+x)} \, dx+\int \left (-87 e^{2 x-x^2}+114 e^{2 x-x^2} x-18 e^{2 x-x^2} x^2-\frac {e^{5+2 x-x^2}}{2+x}\right ) \, dx\\ &=-e^{5+2 x-x^2} \log (2+x)-18 \int e^{2 x-x^2} x^2 \, dx-87 \int e^{2 x-x^2} \, dx+114 \int e^{2 x-x^2} x \, dx\\ &=-57 e^{2 x-x^2}+9 e^{2 x-x^2} x-e^{5+2 x-x^2} \log (2+x)-9 \int e^{2 x-x^2} \, dx-18 \int e^{2 x-x^2} x \, dx+114 \int e^{2 x-x^2} \, dx-(87 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx\\ &=-48 e^{2 x-x^2}+9 e^{2 x-x^2} x+\frac {87}{2} e \sqrt {\pi } \text {erf}(1-x)-e^{5+2 x-x^2} \log (2+x)-18 \int e^{2 x-x^2} \, dx-(9 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx+(114 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx\\ &=-48 e^{2 x-x^2}+9 e^{2 x-x^2} x-9 e \sqrt {\pi } \text {erf}(1-x)-e^{5+2 x-x^2} \log (2+x)-(18 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx\\ &=-48 e^{2 x-x^2}+9 e^{2 x-x^2} x-e^{5+2 x-x^2} \log (2+x)\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.48, size = 23, normalized size = 0.85 \begin {gather*} e^{-((-2+x) x)} \left (-48+9 x-e^5 \log (2+x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.71, size = 35, normalized size = 1.30 \begin {gather*} 3 \, {\left (3 \, x - 16\right )} e^{\left (-x^{2} + 2 \, x\right )} - e^{\left (-x^{2} + 2 \, x + 5\right )} \log \left (x + 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.31, size = 43, normalized size = 1.59 \begin {gather*} 9 \, x e^{\left (-x^{2} + 2 \, x\right )} - e^{\left (-x^{2} + 2 \, x + 5\right )} \log \left (x + 2\right ) - 48 \, e^{\left (-x^{2} + 2 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.19, size = 25, normalized size = 0.93
method | result | size |
norman | \(\left (-48+9 x -\ln \left (2+x \right ) {\mathrm e}^{5}\right ) {\mathrm e}^{-x^{2}+2 x}\) | \(25\) |
risch | \(-\ln \left (2+x \right ) {\mathrm e}^{-x^{2}+2 x +5}+3 \left (3 x -16\right ) {\mathrm e}^{-\left (x -2\right ) x}\) | \(33\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.51, size = 31, normalized size = 1.15 \begin {gather*} {\left (3 \, {\left (3 \, x - 16\right )} e^{\left (2 \, x\right )} - e^{\left (2 \, x + 5\right )} \log \left (x + 2\right )\right )} e^{\left (-x^{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.18, size = 24, normalized size = 0.89 \begin {gather*} -{\mathrm {e}}^{2\,x-x^2}\,\left (\ln \left (x+2\right )\,{\mathrm {e}}^5-9\,x+48\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.48, size = 20, normalized size = 0.74 \begin {gather*} \left (9 x - e^{5} \log {\left (x + 2 \right )} - 48\right ) e^{- x^{2} + 2 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________