Integral computation with Mathematica and Sympy differ

54 Views Asked by At

To compute the integral: $I = \int_{0}^{+oo} ue^{Au^{2}+Bu}du$ where $A<0$ and $B>0$

I have tried both Mathematica and Sympy but they yield different results:

Mathematica yields: $ I = \frac{\sqrt{\pi}\sqrt{-A}Be^{-\frac{B^{2}}{4A}}erfc(-\frac{B}{2\sqrt{A}})-2A}{4A^{2}}$

Sympy yields: $\frac{1}{\sqrt{\pi} B^{2}} \left(\frac{2 i}{A^{\frac{3}{2}}} \sqrt{\pi} B^{3} \left(\frac{i \sqrt{A}}{4 B e^{- \frac{B^{2}}{4 A}}} - \frac{\sqrt{\pi}}{8} erf{\left (\frac{i B}{2 \sqrt{A}} \right )}\right) e^{- \frac{B^{ 2}}{4 A}} + \frac{i \pi B^{3}}{4 A^{\frac{3}{2}}} e^{- \frac{B^{2}}{4 A}}\right)$

Why?