Optimal. Leaf size=18 \[ e^{1+x+(1+x)^2} x \left (5+e^x+x\right ) \]
________________________________________________________________________________________
Rubi [B] time = 0.44, antiderivative size = 51, normalized size of antiderivative = 2.83, number of steps used = 24, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {6742, 2234, 2204, 2240, 2241, 2288} \begin {gather*} e^{x^2+3 x+2} x^2+5 e^{x^2+3 x+2} x+\frac {e^{x^2+4 x+2} \left (x^2+2 x\right )}{x+2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2204
Rule 2234
Rule 2240
Rule 2241
Rule 2288
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (5 e^{2+3 x+x^2}+17 e^{2+3 x+x^2} x+13 e^{2+3 x+x^2} x^2+2 e^{2+3 x+x^2} x^3+e^{2+4 x+x^2} \left (1+4 x+2 x^2\right )\right ) \, dx\\ &=2 \int e^{2+3 x+x^2} x^3 \, dx+5 \int e^{2+3 x+x^2} \, dx+13 \int e^{2+3 x+x^2} x^2 \, dx+17 \int e^{2+3 x+x^2} x \, dx+\int e^{2+4 x+x^2} \left (1+4 x+2 x^2\right ) \, dx\\ &=\frac {17}{2} e^{2+3 x+x^2}+\frac {13}{2} e^{2+3 x+x^2} x+e^{2+3 x+x^2} x^2+\frac {e^{2+4 x+x^2} \left (2 x+x^2\right )}{2+x}-2 \int e^{2+3 x+x^2} x \, dx-3 \int e^{2+3 x+x^2} x^2 \, dx-\frac {13}{2} \int e^{2+3 x+x^2} \, dx-\frac {39}{2} \int e^{2+3 x+x^2} x \, dx-\frac {51}{2} \int e^{2+3 x+x^2} \, dx+\frac {5 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{\sqrt [4]{e}}\\ &=-\frac {9}{4} e^{2+3 x+x^2}+5 e^{2+3 x+x^2} x+e^{2+3 x+x^2} x^2+\frac {e^{2+4 x+x^2} \left (2 x+x^2\right )}{2+x}+\frac {5 \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (3+2 x)\right )}{2 \sqrt [4]{e}}+\frac {3}{2} \int e^{2+3 x+x^2} \, dx+3 \int e^{2+3 x+x^2} \, dx+\frac {9}{2} \int e^{2+3 x+x^2} x \, dx+\frac {117}{4} \int e^{2+3 x+x^2} \, dx-\frac {13 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{2 \sqrt [4]{e}}-\frac {51 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{2 \sqrt [4]{e}}\\ &=5 e^{2+3 x+x^2} x+e^{2+3 x+x^2} x^2+\frac {e^{2+4 x+x^2} \left (2 x+x^2\right )}{2+x}-\frac {27 \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (3+2 x)\right )}{2 \sqrt [4]{e}}-\frac {27}{4} \int e^{2+3 x+x^2} \, dx+\frac {3 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{2 \sqrt [4]{e}}+\frac {3 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{\sqrt [4]{e}}+\frac {117 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{4 \sqrt [4]{e}}\\ &=5 e^{2+3 x+x^2} x+e^{2+3 x+x^2} x^2+\frac {e^{2+4 x+x^2} \left (2 x+x^2\right )}{2+x}+\frac {27 \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (3+2 x)\right )}{8 \sqrt [4]{e}}-\frac {27 \int e^{\frac {1}{4} (3+2 x)^2} \, dx}{4 \sqrt [4]{e}}\\ &=5 e^{2+3 x+x^2} x+e^{2+3 x+x^2} x^2+\frac {e^{2+4 x+x^2} \left (2 x+x^2\right )}{2+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.22, size = 18, normalized size = 1.00 \begin {gather*} e^{2+3 x+x^2} x \left (5+e^x+x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 21, normalized size = 1.17 \begin {gather*} {\left (x^{2} + x e^{x} + 5 \, x\right )} e^{\left (x^{2} + 3 \, x + 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.15, size = 35, normalized size = 1.94 \begin {gather*} x e^{\left (x^{2} + 4 \, x + 2\right )} + \frac {1}{4} \, {\left ({\left (2 \, x + 3\right )}^{2} + 8 \, x - 9\right )} e^{\left (x^{2} + 3 \, x + 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 21, normalized size = 1.17
method | result | size |
risch | \(\left (x^{2}+{\mathrm e}^{x} x +5 x \right ) {\mathrm e}^{\left (2+x \right ) \left (x +1\right )}\) | \(21\) |
default | \(5 x \,{\mathrm e}^{x^{2}+3 x +2}+x^{2} {\mathrm e}^{x^{2}+3 x +2}+x \,{\mathrm e}^{x^{2}+4 x +2}\) | \(38\) |
norman | \(x^{2} {\mathrm e}^{x^{2}+3 x +2}+{\mathrm e}^{x} x \,{\mathrm e}^{x^{2}+3 x +2}+5 x \,{\mathrm e}^{x^{2}+3 x +2}\) | \(40\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.46, size = 372, normalized size = 20.67 \begin {gather*} -\frac {5}{2} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + \frac {3}{2} i\right ) e^{\left (-\frac {1}{4}\right )} - \frac {1}{2} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + 2 i\right ) e^{\left (-2\right )} + \frac {1}{8} \, {\left (\frac {36 \, {\left (2 \, x + 3\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )}{\left (-{\left (2 \, x + 3\right )}^{2}\right )^{\frac {3}{2}}} - \frac {27 \, \sqrt {\pi } {\left (2 \, x + 3\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 3\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 3\right )}^{2}}} + 54 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )} - 8 \, \Gamma \left (2, -\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )\right )} e^{\left (-\frac {1}{4}\right )} - \frac {13}{8} \, {\left (\frac {4 \, {\left (2 \, x + 3\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )}{\left (-{\left (2 \, x + 3\right )}^{2}\right )^{\frac {3}{2}}} - \frac {9 \, \sqrt {\pi } {\left (2 \, x + 3\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 3\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 3\right )}^{2}}} + 12 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{4}\right )} - \frac {17}{4} \, {\left (\frac {3 \, \sqrt {\pi } {\left (2 \, x + 3\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 3\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 3\right )}^{2}}} - 2 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 3\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{4}\right )} - {\left (\frac {{\left (x + 2\right )}^{3} \Gamma \left (\frac {3}{2}, -{\left (x + 2\right )}^{2}\right )}{\left (-{\left (x + 2\right )}^{2}\right )^{\frac {3}{2}}} - \frac {4 \, \sqrt {\pi } {\left (x + 2\right )} {\left (\operatorname {erf}\left (\sqrt {-{\left (x + 2\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (x + 2\right )}^{2}}} + 4 \, e^{\left ({\left (x + 2\right )}^{2}\right )}\right )} e^{\left (-2\right )} - 2 \, {\left (\frac {2 \, \sqrt {\pi } {\left (x + 2\right )} {\left (\operatorname {erf}\left (\sqrt {-{\left (x + 2\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (x + 2\right )}^{2}}} - e^{\left ({\left (x + 2\right )}^{2}\right )}\right )} e^{\left (-2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.04, size = 16, normalized size = 0.89 \begin {gather*} x\,{\mathrm {e}}^{x^2+3\,x+2}\,\left (x+{\mathrm {e}}^x+5\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.19, size = 20, normalized size = 1.11 \begin {gather*} \left (x^{2} + x e^{x} + 5 x\right ) e^{x^{2} + 3 x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________