# Method to compute $\int_0^{+\infty} ue^{-Au^2+Bu}du$

I have been able to solve:

$\int_0^{+\infty} ue^{-Au^2+Bu}du, ~A>0, B>0$ by means of symbolic calculus library such as Mathematica or Sympy.

However, I am wondering what is the classical method to solve such a definite integral.

I have also looked in the Gradshteyn and Ryzhik's Table of Integrals, Series, and Products, but I did not find it as only the result of $\int_{-\infty}^{+\infty} ue^{-Au^2+Bu}du$ is presented.

• i think this is a solution $$\frac{\sqrt{\pi } b e^{\frac{b^2}{4 a}} \left(\text{erf}\left(\frac{b}{2 \sqrt{a}}\right)+1\right)+2 \sqrt{a}}{4 a^{3/2}}$$ – Dr. Sonnhard Graubner Oct 7 '17 at 11:59

Start by completing the square in the exponent:

$$-Au^2+Bu=u(-Au+B)=-A(u-B/2A)^2+B^2/4A$$

and substituting $x=u-a$ where $a=-B/2A$ to get

$$I=e^{B^2/4A}\int_a^\infty(x-a)e^{-Ax^2}~\mathrm dx$$

Note that

$$\int_a^\infty xe^{-Ax^2}~\mathrm dx=\frac12\int_{a^2}^\infty e^{-At}~\mathrm dt=\frac1{2A}e^{-Aa^2}$$

and

$$\int_a^\infty e^{-Ax^2}~\mathrm dx=\frac1{\sqrt A}\int_{a\sqrt A}^\infty e^{-t^2}~\mathrm dt=\frac\pi{2\sqrt A}\big(1-\operatorname{erf}(a\sqrt A)\big)$$

Hint:

The factor $u$ can be seen as a term from the derivative of the exponent,

$$\frac{-2Au+B}{-2A},$$ which you easily integrate, giving a term $$\frac B{2A}.$$

Then the correction is the exponential of a quadratic polynomial, that you can turn to a Gaussian by a linear change of variable. As the lower bound is no more $0$, you need to resort to the antiderivative of a Gaussian, known as the function $\Phi$.