# Complex gaussian, complete the square

## Homework Statement

Evaluate this integral (in essence the Fourier transform of the Gaussian):

$$\int_{-\infty}^{+\infty} e^{-ax^2} e^{ikx}\, dx$$

2. The attempt at a solution
One way is to complete the square, so that

$$-ax^2 + ikx = -a(x-ik/2a)^2 - (k/2a)^2$$

so the integral becomes
$$e^{-(k/2a)^2} \int_{-\infty}^{+\infty} e^{-a(x-ik/2a)^2}\, dx$$

then change the variable $$x \rightarrow x-ik/2a$$, so that the integral becomes like the usual Gaussian and the result is $$\sqrt{\pi/a} e^{-(k/2a)^2}$$.

3. Nuissance
The problem is that I have changed a real variable x into a complex one, while still keeping the same integration limits, which is plus minus infinity (on the real axis, not the complex plane). I don't see any legal reason behind this. What is more, if we use Euler's formula $$e^{ikx} = \cos(kx) + i\sin (kx)$$ and integrate the real and imaginary parts separately, the imaginary part vanishes because it's odd with respect to the origin, while cosine in the real part can be expanded as a Taylor series, each term then can be integrated with the Gaussian, we sum back the results and the final formula is exactly the same as with the supposedly illegal completion of the square, so evidently we can complete the square, with a good justification. What is the justification?

## Answers and Replies

Related Calculus and Beyond Homework Help News on Phys.org
You either have to use Cauchy's theorem that says that the contour integral of an analytic function is zero to move the integration path back on the real axis, or you can use the principle of analytic continuation to analytically continue the real Gaussian integral to the complex case.

OK, I see that Cauchy's integral theorem can do the trick. Unfortunately I don't have sufficient knowledge of complex analysis, but still I would like to have an elegant solution, as it is part of a bigger problem.
As far as I can understand, I define a contour on a complex plane, then the total integral is zero due to Cauchy, the real line displaced by -ik/2a is my integral, then I also know the Gaussian integral on the real axis, and finally I have two segments at plus and minus real infinity connecting these two lines. How can I show that they cancel?

OK, I see that Cauchy's integral theorem can do the trick. Unfortunately I don't have sufficient knowledge of complex analysis, but still I would like to have an elegant solution, as it is part of a bigger problem.
As far as I can understand, I define a contour on a complex plane, then the total integral is zero due to Cauchy, the real line displaced by -ik/2a is my integral, then I also know the Gaussian integral on the real axis, and finally I have two segments at plus and minus real infinity connecting these two lines. How can I show that they cancel?
If you are rigorous, then the integral from minus to plus infinity first has to be written as the integral from minus R to plus R and then you take the limit of R to infinity. You apply Cauchy's theorem on the integrals inside the limits. What you then see is that the contributions of the two line segments from ±R to ±R - ik/(2a) tend to zero in the limit of R to infinity.