Optimal. Leaf size=26 \[ 2+e^{-4-x} \left (3 e-e^x+e^{x^2}\right )^2 \]
________________________________________________________________________________________
Rubi [A] time = 0.62, antiderivative size = 48, normalized size of antiderivative = 1.85, number of steps used = 14, number of rules used = 8, integrand size = 56, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {6741, 6742, 2194, 2236, 2234, 2204, 2209, 2240} \begin {gather*} -2 e^{x^2-4}+6 e^{x^2-x-3}+e^{2 x^2-x-4}+9 e^{-x-2}+e^{x-4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2194
Rule 2204
Rule 2209
Rule 2234
Rule 2236
Rule 2240
Rule 6741
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int e^{-4-x} \left (3 e-e^x+e^{x^2}\right ) \left (-3 e-e^x-e^{x^2}+4 e^{x^2} x\right ) \, dx\\ &=\int \left (-9 e^{-2-x}+e^{-4+x}+e^{-4-x+2 x^2} (-1+4 x)+2 e^{-4-x+x^2} \left (-3 e+6 e x-2 e^x x\right )\right ) \, dx\\ &=2 \int e^{-4-x+x^2} \left (-3 e+6 e x-2 e^x x\right ) \, dx-9 \int e^{-2-x} \, dx+\int e^{-4+x} \, dx+\int e^{-4-x+2 x^2} (-1+4 x) \, dx\\ &=9 e^{-2-x}+e^{-4+x}+e^{-4-x+2 x^2}+2 \int \left (-3 e^{-3-x+x^2}-2 e^{-4+x^2} x+6 e^{-3-x+x^2} x\right ) \, dx\\ &=9 e^{-2-x}+e^{-4+x}+e^{-4-x+2 x^2}-4 \int e^{-4+x^2} x \, dx-6 \int e^{-3-x+x^2} \, dx+12 \int e^{-3-x+x^2} x \, dx\\ &=9 e^{-2-x}+e^{-4+x}-2 e^{-4+x^2}+6 e^{-3-x+x^2}+e^{-4-x+2 x^2}+6 \int e^{-3-x+x^2} \, dx-\frac {6 \int e^{\frac {1}{4} (-1+2 x)^2} \, dx}{e^{13/4}}\\ &=9 e^{-2-x}+e^{-4+x}-2 e^{-4+x^2}+6 e^{-3-x+x^2}+e^{-4-x+2 x^2}-\frac {3 \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (-1+2 x)\right )}{e^{13/4}}+\frac {6 \int e^{\frac {1}{4} (-1+2 x)^2} \, dx}{e^{13/4}}\\ &=9 e^{-2-x}+e^{-4+x}-2 e^{-4+x^2}+6 e^{-3-x+x^2}+e^{-4-x+2 x^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.22, size = 44, normalized size = 1.69 \begin {gather*} e^{-4-x} \left (9 e^2+e^{2 x}+e^{2 x^2}+6 e^{1+x^2}-2 e^{x+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.80, size = 85, normalized size = 3.27 \begin {gather*} \frac {1}{27} \, {\left (9 \, {\left (9 \, e^{4} - 2 \, e^{\left (x^{2} + x + 2\right )}\right )} e^{\left (2 \, x^{2} + 2 \, \log \relax (3) + 2\right )} + e^{\left (4 \, x^{2} + 4 \, \log \relax (3) + 4\right )} + 18 \, e^{\left (3 \, x^{2} + 3 \, \log \relax (3) + 5\right )} + 81 \, e^{\left (2 \, x^{2} + 2 \, x + 4\right )}\right )} e^{\left (-2 \, x^{2} - x - \log \relax (3) - 8\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 46, normalized size = 1.77 \begin {gather*} {\left (e^{\left (2 \, x^{2} - x + 5\right )} + 6 \, e^{\left (x^{2} - x + 6\right )} - 2 \, e^{\left (x^{2} + 5\right )} + e^{\left (x + 5\right )} + 9 \, e^{\left (-x + 7\right )}\right )} e^{\left (-9\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 45, normalized size = 1.73
method | result | size |
risch | \({\mathrm e}^{x -4}+9 \,{\mathrm e}^{-x -2}+{\mathrm e}^{2 x^{2}-x -4}+2 \left (-{\mathrm e}^{x}+3 \,{\mathrm e}\right ) {\mathrm e}^{x^{2}-x -4}\) | \(45\) |
default | \({\mathrm e}^{-4} {\mathrm e}^{x}-2 \,{\mathrm e}^{-4} {\mathrm e}^{x^{2}}+9 \,{\mathrm e}^{-4} {\mathrm e}^{-x} {\mathrm e}^{2}+{\mathrm e}^{2 x^{2}-x -4}+6 \,{\mathrm e}^{x^{2}-x -3}\) | \(55\) |
norman | \(\left ({\mathrm e}^{-4} {\mathrm e}^{2 x}+{\mathrm e}^{-4} {\mathrm e}^{2 x^{2}}+9 \,{\mathrm e}^{-4} {\mathrm e}^{2}+6 \,{\mathrm e}^{-4} {\mathrm e} \,{\mathrm e}^{x^{2}}-2 \,{\mathrm e}^{x} {\mathrm e}^{-4} {\mathrm e}^{x^{2}}\right ) {\mathrm e}^{-x}\) | \(61\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.49, size = 178, normalized size = 6.85 \begin {gather*} \frac {1}{4} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (i \, \sqrt {2} x - \frac {1}{4} i \, \sqrt {2}\right ) e^{\left (-\frac {33}{8}\right )} + 3 i \, \sqrt {\pi } \operatorname {erf}\left (i \, x - \frac {1}{2} i\right ) e^{\left (-\frac {13}{4}\right )} + \frac {1}{4} \, \sqrt {2} {\left (\frac {\sqrt {2} \sqrt {\frac {1}{2}} \sqrt {\pi } {\left (4 \, x - 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {1}{2}} \sqrt {-{\left (4 \, x - 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (4 \, x - 1\right )}^{2}}} + 2 \, \sqrt {2} e^{\left (\frac {1}{8} \, {\left (4 \, x - 1\right )}^{2}\right )}\right )} e^{\left (-\frac {33}{8}\right )} + 3 \, {\left (\frac {\sqrt {\pi } {\left (2 \, x - 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x - 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x - 1\right )}^{2}}} + 2 \, e^{\left (\frac {1}{4} \, {\left (2 \, x - 1\right )}^{2}\right )}\right )} e^{\left (-\frac {13}{4}\right )} - 2 \, e^{\left (x^{2} - 4\right )} + e^{\left (x - 4\right )} + 9 \, e^{\left (-x - 2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.32, size = 47, normalized size = 1.81 \begin {gather*} 9\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^{-2}-2\,{\mathrm {e}}^{x^2}\,{\mathrm {e}}^{-4}+{\mathrm {e}}^{-4}\,{\mathrm {e}}^x+6\,{\mathrm {e}}^{-x}\,{\mathrm {e}}^{x^2}\,{\mathrm {e}}^{-3}+{\mathrm {e}}^{-x}\,{\mathrm {e}}^{-4}\,{\mathrm {e}}^{2\,x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.28, size = 63, normalized size = 2.42 \begin {gather*} \frac {\left (\left (- 2 e^{4} e^{2 x} + 6 e^{5} e^{x}\right ) e^{x^{2}} + e^{4} e^{x} e^{2 x^{2}}\right ) e^{- 2 x}}{e^{8}} + \frac {e^{2} e^{x} + 9 e^{4} e^{- x}}{e^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________