Optimal. Leaf size=23 \[ e^{-x (4+x)} (-2+x) (i \pi -x+\log (6)) \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 0.46, antiderivative size = 138, normalized size of antiderivative = 6.00, number of steps
used = 24, number of rules used = 6, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {6873, 6874,
2272, 2266, 2236, 2273} \begin {gather*} -e^4 \sqrt {\pi } \text {Erf}(x+2)+\frac {1}{2} e^4 \sqrt {\pi } (2+9 i \pi +9 \log (6)) \text {Erf}(x+2)-\frac {9}{2} e^4 \sqrt {\pi } (\log (6)+i \pi ) \text {Erf}(x+2)-e^{-x^2-4 x} x^2+2 e^{-x^2-4 x} x+e^{-x^2-4 x} x (\log (6)+i \pi )-2 e^{-x^2-4 x} (\log (6)+i \pi ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2236
Rule 2266
Rule 2272
Rule 2273
Rule 6873
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int e^{-4 x-x^2} \left (2+9 i \pi -10 x+2 x^3+9 \log (6)-2 x^2 (i \pi +\log (6))\right ) \, dx\\ &=\int \left (-10 e^{-4 x-x^2} x+2 e^{-4 x-x^2} x^3-2 i e^{-4 x-x^2} x^2 (\pi -i \log (6))+2 e^{-4 x-x^2} \left (1+\frac {9}{2} (i \pi +\log (6))\right )\right ) \, dx\\ &=2 \int e^{-4 x-x^2} x^3 \, dx-10 \int e^{-4 x-x^2} x \, dx-(2 i (\pi -i \log (6))) \int e^{-4 x-x^2} x^2 \, dx+(2+9 i \pi +9 \log (6)) \int e^{-4 x-x^2} \, dx\\ &=5 e^{-4 x-x^2}-e^{-4 x-x^2} x^2+e^{-4 x-x^2} x (i \pi +\log (6))+2 \int e^{-4 x-x^2} x \, dx-4 \int e^{-4 x-x^2} x^2 \, dx+20 \int e^{-4 x-x^2} \, dx-(i \pi +\log (6)) \int e^{-4 x-x^2} \, dx+(4 (i \pi +\log (6))) \int e^{-4 x-x^2} x \, dx+\left (e^4 (2+9 i \pi +9 \log (6))\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx\\ &=4 e^{-4 x-x^2}+2 e^{-4 x-x^2} x-e^{-4 x-x^2} x^2-2 e^{-4 x-x^2} (i \pi +\log (6))+e^{-4 x-x^2} x (i \pi +\log (6))+\frac {1}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (2+9 i \pi +9 \log (6))-2 \int e^{-4 x-x^2} \, dx-4 \int e^{-4 x-x^2} \, dx+8 \int e^{-4 x-x^2} x \, dx+\left (20 e^4\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx-(8 (i \pi +\log (6))) \int e^{-4 x-x^2} \, dx-\left (e^4 (i \pi +\log (6))\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx\\ &=2 e^{-4 x-x^2} x-e^{-4 x-x^2} x^2+10 e^4 \sqrt {\pi } \text {erf}(2+x)-2 e^{-4 x-x^2} (i \pi +\log (6))+e^{-4 x-x^2} x (i \pi +\log (6))-\frac {1}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (i \pi +\log (6))+\frac {1}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (2+9 i \pi +9 \log (6))-16 \int e^{-4 x-x^2} \, dx-\left (2 e^4\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx-\left (4 e^4\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx-\left (8 e^4 (i \pi +\log (6))\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx\\ &=2 e^{-4 x-x^2} x-e^{-4 x-x^2} x^2+7 e^4 \sqrt {\pi } \text {erf}(2+x)-2 e^{-4 x-x^2} (i \pi +\log (6))+e^{-4 x-x^2} x (i \pi +\log (6))-\frac {9}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (i \pi +\log (6))+\frac {1}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (2+9 i \pi +9 \log (6))-\left (16 e^4\right ) \int e^{-\frac {1}{4} (-4-2 x)^2} \, dx\\ &=2 e^{-4 x-x^2} x-e^{-4 x-x^2} x^2-e^4 \sqrt {\pi } \text {erf}(2+x)-2 e^{-4 x-x^2} (i \pi +\log (6))+e^{-4 x-x^2} x (i \pi +\log (6))-\frac {9}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (i \pi +\log (6))+\frac {1}{2} e^4 \sqrt {\pi } \text {erf}(2+x) (2+9 i \pi +9 \log (6))\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 24, normalized size = 1.04 \begin {gather*} -e^{-x (4+x)} (-2+x) (-i \pi +x-\log (6)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 6.85, size = 109, normalized size = 4.74
method | result | size |
norman | \(\left (\left (i \pi +\ln \left (6\right )+2\right ) x -x^{2}-2 i \pi -2 \ln \left (6\right )\right ) {\mathrm e}^{-x^{2}-4 x}\) | \(36\) |
risch | \(\left (-2 i \pi -2 \ln \left (2\right )-2 \ln \left (3\right )+i x \pi +x \ln \left (2\right )+x \ln \left (3\right )+2 x -x^{2}\right ) {\mathrm e}^{-\left (4+x \right ) x}\) | \(43\) |
gosper | \(\left (-\frac {63}{3940225}-\frac {1984 i}{3940225}\right ) \left (1984 i x \ln \left (6\right )-63 i x \pi -1984 i x^{2}-3968 i \ln \left (6\right )+126 i \pi +3968 i x -63 x \ln \left (6\right )-1984 \pi x +63 x^{2}+126 \ln \left (6\right )+3968 \pi -126 x \right ) {\mathrm e}^{-x^{2}-4 x}\) | \(70\) |
default | \(\frac {9 i \pi ^{\frac {3}{2}} {\mathrm e}^{4} \erf \left (2+x \right )}{2}-2 i \pi \left (-\frac {x \,{\mathrm e}^{-x^{2}-4 x}}{2}+{\mathrm e}^{-x^{2}-4 x}+\frac {9 \sqrt {\pi }\, {\mathrm e}^{4} \erf \left (2+x \right )}{4}\right )-x^{2} {\mathrm e}^{-x^{2}-4 x}+2 x \,{\mathrm e}^{-x^{2}-4 x}+\ln \left (6\right ) x \,{\mathrm e}^{-x^{2}-4 x}-2 \ln \left (6\right ) {\mathrm e}^{-x^{2}-4 x}\) | \(109\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.46, size = 269, normalized size = 11.70 \begin {gather*} \frac {9}{2} i \, \pi ^{\frac {3}{2}} \operatorname {erf}\left (x + 2\right ) e^{4} + \frac {9}{2} \, \sqrt {\pi } \operatorname {erf}\left (x + 2\right ) e^{4} \log \left (6\right ) + \pi {\left (\frac {i \, {\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 i \, \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 i \, e^{\left (-{\left (x + 2\right )}^{2}\right )}\right )} e^{4} - i \, {\left (\frac {i \, {\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 i \, \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 i \, e^{\left (-{\left (x + 2\right )}^{2}\right )}\right )} e^{4} \log \left (6\right ) + \sqrt {\pi } \operatorname {erf}\left (x + 2\right ) e^{4} + i \, {\left (-\frac {6 i \, {\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 {8 i \, \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}}} + 12 i \, e^{\left (-{\left (x + 2\right )}^{2}\right )} + i \, \Gamma \left (2, {\left (x + 2\right )}^{2}\right )\right )} e^{4} - 5 i \, {\left (\frac {2 i \, \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}}} + i \, e^{\left (-{\left (x + 2\right )}^{2}\right )}\right )} e^{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 33, normalized size = 1.43 \begin {gather*} {\left (-2 i \, \pi + {\left (i \, \pi + 2\right )} x - x^{2} + {\left (x - 2\right )} \log \left (6\right )\right )} e^{\left (-x^{2} - 4 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 61 vs. \(2 (17) = 34\).
time = 0.19, size = 61, normalized size = 2.65 \begin {gather*} \left (- x^{2} e^{- 4 x} + x e^{- 4 x} \log {\left (6 \right )} + 2 x e^{- 4 x} + i \pi x e^{- 4 x} - 2 e^{- 4 x} \log {\left (6 \right )} - 2 i \pi e^{- 4 x}\right ) e^{- x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 44 vs. \(2 (20) = 40\).
time = 0.39, size = 44, normalized size = 1.91 \begin {gather*} {\left (-4 i \, \pi - {\left (x + 2\right )}^{2} - \pi {\left (-i \, x - 2 i\right )} + {\left (x + 2\right )} \log \left (6\right ) + 6 \, x - 4 \, \log \left (6\right ) + 4\right )} e^{\left (-x^{2} - 4 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.14, size = 24, normalized size = 1.04 \begin {gather*} {\mathrm {e}}^{-x^2-4\,x}\,\left (x-2\right )\,\left (\ln \left (6\right )-x+\Pi \,1{}\mathrm {i}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________