# Computing a Gaussian integral

1. Sep 19, 2014

### homer

1. The problem statement, all variables and given/known data
Let $a,b$ be real with $a > 0$. Compute the integral
$$I = \int_{-\infty}^{\infty} e^{-ax^2 + ibx}\,dx.$$

2. Relevant equations
Equation (1):
$$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$

Equation (2):
$$-ax^2 + ibx = -a\Big(x - \frac{ib}{2a}\Big)^2 - \frac{b^2}{4a}$$

3. The attempt at a solution
Completing the square in $-ax^2 + ibx$ gives me Equation (2), so that my integral is now
$$I = e^{-b^2/4a}\int_{-\infty}^{\infty} e^{-a(x-ib/2a)^2}\,dx.$$
Making the substitution $u = \sqrt{a}(x-ib/2a)$ I get $du = \sqrt{a}\,dx$ so tht my integral becomes
$$I = \frac{1}{\sqrt{a}}\,e^{-b^2/4a}\int_{-\infty - ib/2\sqrt{a}}^{\infty - ib/2\sqrt{a}} e^{-u^2}\,du.$$

But this doesn't seem right.

2. Sep 19, 2014

### ZetaOfThree

You've got it right. Just note that $-\infty - ib/2\sqrt{a}=-\infty$ and $\infty - ib/2\sqrt{a}=\infty$, and you're basically done.

3. Sep 20, 2014

### homer

Thanks Zeta. Huge brain fart on my part in making it rigorous. The integral I was trying to compute is the limit of

$$I(R_1, R_2) = \int_{-R_1}^{R_2} e^{-ax^2 + bx}\,dx$$

as $R_1, R_2 \to \infty$. Then I can make a subsitution $z = \sqrt{a}(x-ib/2a)$ to get the integral

$$I(R_1,R_2) = \frac{1}{\sqrt{a}}\,e^{-b^2/4a}\int_{-\sqrt{a}R_1-ib/2\sqrt{a}}^{\sqrt{a}R_2 - ib/2\sqrt{a}}e^{-z^2}\,dz.$$

The integrand $e^{-z^2}$ is analytic on the entire complex plane, so the integral is path independent. So in particular I can take it on a contour consisting of:

(1) A straight line up from $z = -\sqrt{a}R_1 - ib/\sqrt{a}$ up to the real axis at point $z = -\sqrt{a}R_1$.

(2) A straight line on the real axis from $z = -\sqrt{a}R_1$ to $z = \sqrt{a}R_2$.

(3) A straight line down from the real axis at point $z = \sqrt{a}R_2$ to $z = \sqrt{a}R_2 - ib/2\sqrt{a}$.

Taking the limit as $R_1, R_2 \to \infty$ the integrals on contour sections (1) and (3) vanish since $\lvert z\rvert \to \infty$ and thus $e^{-z^2} \to 0$ on these two vertical lines. The integral on contour (2) then becomes

$$\lim_{R_1, R_2 \to \infty}\int_2 e^{-z^2}\,dz = \int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}.$$

Thus we have

\begin{align*}
\int_{-\infty}^{\infty} e^{-ax^2 + bx}\,dx
& = \lim_{R_1,R_2 \to \infty} I(R_1,R_2) \\
& =
\lim_{R_1,R_2 \to \infty} \frac{1}{\sqrt{a}}\,e^{-b^2/4a}\int_{-\sqrt{a}R_1-ib/2\sqrt{a}}^{\sqrt{a}R_2 - ib/2\sqrt{a}}e^{-z^2}\,dz \\
& = \frac{1}{\sqrt{a}}\,e^{-b^2/4a}\sqrt{\pi}.
\end{align*}

4. Sep 20, 2014

### homer

Oops, contour (1) should be from $z = -\sqrt{a}R_1 - ib/2\sqrt{a}$ to $z = -\sqrt{a}R_1$.