# Integration of complex exponential

I'm trying to prove the following integral: $$\int \frac{d^n k}{(2\pi)^n} e^{isk^2 - i\vec{k} \cdot \vec{y}} = \frac{i}{(4 \pi)^{n/2}} (is)^{-n/2} e^{ \frac{y^2}{4is}},$$

where $$|\vec{k}|^2 \equiv k^2$$ and $$|\vec{y}|^2 \equiv y^2$$. I've tried the following: I changed the integration to spherical coordinates and chose $$\vec{k} \cdot \vec{y} = ky\cos{\theta}$$ so that the integral became $$\int_0^{2\pi} \int_0^{\pi} \int_0^{\infty} \frac{d\phi d\theta dk}{(2\pi)^n}k^2 \sin{\theta} e^{isk^2 - iky\cos{\theta}} =\frac{1}{(2\pi)^{n-1}} \int_0^{\infty} e^{isk^2 } k^2 dk \int_0^{\pi} e^{-iky\cos{\theta}} \sin{\theta}d\theta,$$ integrating the second integral using the substition $$u = \cos{\theta}$$, I got $$\frac{2}{(2\pi)^{n-1}} \int_0^{\infty}dk e^{isk^2 } k^2 \frac{1}{ky} \sin{ky},$$

but I saw by inspection that this integral diverges. Where am I wrong? What should I do?

Notice that when you use your spherical coordinates, you are assuming that $$n=3$$. To do the integral for arbitrary $$n\ge 1$$, you want to complete the square in the exponential. Write the exponent of the integrand as (I write the norm of vector $$k\in \mathbb{R}^n$$ simply as $$k^2$$) $$is(k^2-k\cdot y/s) = is(k- \frac{1}{2} y/s)^2 - i y^2/4s.$$ Hence, your integral becomes $$(2\pi)^{-n} e^{- is y^2/4s} \int_{\mathbb{R}^n} e^{-is(k- \frac{1}{2} y)^2}dk = (2\pi)^{-n} e^{- i y^2/4s} \pi^{n/2}(is)^{-n/2} = (4is\pi)^{-n/2}e^{-y^2/4is}.$$