# Fourier transform of an exponential function

In my textbook, I saw an example about Fourier Transform and I was not able to figure out something in it.

\begin{gather*} \mathcal{F}({e^{-ax^{2}}})=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{-ikx}e^{-ax^{2}}dx \\ =\int_{-\infty}^{\infty}e^{-ikx-ax^{2}}dx \end{gather*}

Okay, until now, it is very obvious. But now, the next step is confusing:

$$\mathcal{F}({e^{-ax^{2}}})=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}exp[-a(x+\frac{ik}{2a})^{2}-\frac{k^{2}}{4a}]dx$$

I dont understand here. How could he obtain that?

And the next steps are again clear:

\begin{gather*} \mathcal{F}({e^{-ax^{2}}}) = \frac{1}{\sqrt{2\pi}}exp(-\frac{k^{2}}{4a})\int_{-\infty}^{\infty}e^{-ay^{x}}dy\end{gather*} where $y=(x+\frac{ik}{2a}) \implies$

\begin{gather*}\mathcal{F}({e^{-ax^{2}}}) = \sqrt{\frac{1}{2a}}exp(-\frac{k^{2}}{4a}) \end{gather*}

This is a very common math trick: $x = (x - y) +y$. More precisely: $$-a(x+\frac{ik}{2a})^2 - \frac{k^2}{4a}= -a(x^2+\frac{ikx}{a}+\frac{i^2k^2}{4a^2})-\frac{k^2}{4a} = -ax^2-ikx,$$ since $i^2=-1$.