In evaluating an integral in path integrals in QFT, I am stuck with this integral (that came up from evaluating a functional integral),
$$I = \bigg( \frac{m}{2\pi i\tau}\bigg) \int dx_1e^{\frac{im\tau}{2} \bigg((x_{2} - x_1)^2+(x_{1} - x_0)^2\bigg)}$$
After some manipulation, I end up with an integral of the form (apart from some constants)
$$\int_{0}^{\infty} e^{iax^2}\;dx$$ And on further evaluation using the substitution $s= -iax^2 $, I get
$$ \int_{0}^{i\infty} \frac{ds}{\sqrt{-ias}} e^{-s} $$
what kind of contour can we choose for evaluating this one. A diagram would be really helpful.


I will calculate your integral $$ I=\int_{-\infty}^\infty e^{i\alpha x^2}=2\int_0^\infty e^{i\alpha x^2}dx $$ by using some residue methods. This will be a general proof for you, you can put in the constant factors at the end where you need them. \begin{equation} F(\alpha)\equiv C(\alpha)+iS(\alpha)=\int_{-\infty}^{\infty} e^{i\alpha x^2}dx \end{equation} for real $\alpha$. These are the Fresnel integrals, S($\alpha$) and C($\alpha$) which are two transcendental functions. The integral is even so we can write $$ F(\alpha)= 2\int_{0}^\infty {e^{i\alpha x^2}} dx. $$ Consider the complex function $f(z)= e^{i\alpha z^2}$, $z=re^{i\theta}$, $f(z=re^{i\theta})=e^{i\alpha r^2 e^{2i\theta}}.$ If we stare at $$ f(z=re^{i\theta})=e^{i\alpha r^2 e^{2i\theta}} $$ we notice an amazing result, for $\theta=\pi/4$, this is just a real Gaussian integral ($\alpha >0$)!! If $\theta =0$ we have $f(re^{i\theta})=e^{i\alpha r^2}$. Thus our contour is split up into three contours making an angle between imaginary and real axis of $45^o$. The contour I am using is shown here http://en.wikipedia.org/wiki/File:Fresnel_Integral_Contour.svg. We know there are no poles inside and $f(z)$ is holomorphic, thus by the Cauchy-Goursat theorem we know \begin{equation} 0=\oint f(z) dz=\int_{0}^{\infty} e^{i\alpha x^2} dx +\int_{0}^{\pi/4} ire^{i\theta} d\theta e^{i\alpha r^2(\cos(2\theta)+i\sin(2\theta))}+\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr \end{equation} where the integral is broken up into three contours shown in the illustration and I used $z=re^{i\theta}, \ dz= e^{i\theta }dr$. The difficult integral to evaluate is $$ \int_{0}^{\pi/4} ire^{i\theta} d\theta e^{i\alpha r^2(\cos(2\theta)+i\sin(2\theta))}, $$ however it vanishes as $r \to \infty$. We need to show that it vanishes, it is similar to Jordan's inequality, but that just places an upper bound on the integral, $$ \int_{0}^{\pi} e^{-r\sin\theta}d\theta \ < \frac{\pi}{r} \ (r >0). $$ We will prove this now by showing that $$ \lim_{r\to \infty} \bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg|=0. $$
We know that $$ \bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg| \leq \int_{0}^{\pi/4} \big|e^{i\alpha r^2 e^{2i\theta}}\big| \big|ir e^{i\theta}d\theta\big|=\int_{0}^{\pi/4} rd\theta \big| e^{i\alpha r^2\cos(2\theta)-\alpha r^2\sin(2\theta)} \big|=\int_{0}^{\pi/4}rd\theta \big|e^{i \alpha r^2\cos(2\theta)}\big|\big|e^{-\alpha r^2 \sin(2\theta)}\big| $$ where I used $e^{2i\theta}=\cos 2\theta +i\sin 2\theta$. We can simplify this to obtain $$ \int_{0}^{\pi/4} r d\theta \big|e^{i \alpha r^2\cos(2\theta)}\big|\big|e^{-\alpha r^2\sin(2\theta)}\big|=\int_{0}^{\pi/4} rd\theta e^{-\alpha r^2\sin(2\theta)}. $$ Thus we need to show that this vanishes as $r \to \infty.$ If we make the substitution $\xi=2\theta , d\theta=d\xi/2$ and changing the bounds of integration we obtain $$ \int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\lambda r^2\sin \xi}. $$ We can see that for $\xi \in [0,\pi/2]$, $\sin\xi \geq 2\xi/\pi$. Since $e^{-\alpha r^2\cdot 2\xi/\pi} \geq e^{-\alpha r^2 \sin \xi} $ (since exponential is bigger for a smaller exponent), we can write $$ \int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\alpha r^2\sin \xi} \leq \int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\alpha r^2 \cdot 2/\pi}=\frac{\pi}{4 \alpha r}(1-e^{-\alpha r^2}). $$ Thus it is clear that $$ \lim_{r\to \infty}\frac{\pi}{4 \alpha r}(1-e^{-\alpha r^2})=0, $$ thus we have shown that $$ \lim_{r\to \infty} \bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg|=0. $$ We are left with $$ 0=\int_{0}^{\infty} e^{i\alpha x^2} dx +\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr. $$ Re-arranging this expression we obtain $$ \int_{0}^{\infty} e^{i\alpha x^2} dx=-\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr=\int_{0}^{\infty}e^{-\alpha r^2}e^{i\pi/4}dr $$ where I switched the bounds of integration to remove the minus sign. This is a fabulous result, we have reduced the Fresnel integral to a real Gaussian integral which is trivial, the result is $$ \int_{0}^{\infty} e^{i\alpha x^2} dx=\int_{0}^{\infty}e^{-\alpha r^2}e^{i\pi/4}dr=\frac{1}{2}e^{i\pi/4} \sqrt{\frac{\pi}{\alpha}} $$ for $\alpha> 0.$(proof at end of this part.) Thus using the property that the integrand is even, we revert back to the original integral in to obtain the desired result given by \begin{equation} \int_{-\infty}^{\infty} e^{i\alpha x^2}dx=e^{i\pi/4} \sqrt{\frac{\pi}{\alpha}} , \ \ \alpha>0. \end{equation} Now we notice that $F(-\alpha)={F}^*(\alpha)$, thus we can write $$ F(\alpha)=e^{-i\pi/4} \sqrt{\frac{\pi}{\alpha}}, \ \ \alpha<0. $$ For $\alpha=0$, the integral is divergent since $$ \int_{-\infty}^{\infty} dx=\infty. $$ We can now calculate $C(\alpha)$ and $S(\alpha)$ by writing $$ F(\alpha=C(\alpha)+iS(\alpha)=e^{\pm i\pi/4}\sqrt{\frac{\pi}{\alpha}}=\sqrt{\frac{\pi}{\alpha}}\bigg( \frac{1}{\sqrt{2}}\pm \frac{i}{\sqrt{2}}\bigg). $$ Thus we conclude that \begin{equation} {\boxed{ F(\alpha)=\sqrt{\frac{\pi}{\alpha}}\cdot \left\{ \begin{array}{ll} e^{i\pi/4} \ ,\ \alpha > 0 \\ e^{-i\pi/4} \ , \ \alpha < 0.\\ \end{array} \right., \ C(\alpha)=\sqrt{\frac{\pi}{2\alpha}}, \ \alpha \neq 0, \ S(\alpha)=\sqrt{\frac{\pi}{\alpha}}\cdot \left\{ \begin{array}{ll} \frac{1}{\sqrt{2}} \ ,\ \alpha > 0 \\ -\frac{1}{\sqrt{2}} \ , \ \alpha < 0.\\ \end{array} \right. }} \end{equation}