TITLE: Why does integrating a complex exponential give the delta function?
QUESTION [33 upvotes]: How come, when we integrate a complex exponential from $ -\infty $ to $ \infty $, we get a scaled delta function?
$$
\begin{align}
\int_{-\infty}^{\infty} e^{i k x} \; dk & = 2 \pi \delta \left ( x \right )
\end{align}
$$
Specifically, why do we say that the integral converges for $ x \neq 0 $ to $ 0 $? Doesn't it just continue to oscillate?
Thanks!

REPLY [5 votes]: The answer of @Statics attacks with the argument that "if you think Fourier Transformation is correct, then you should accept this definition of Dirac Delta Function." But why the Fourier Transformation works at the first place, is because we have this Dirac Delta definition. So the argument using FT isn't sound to me.
The distribution explanation is correct. And the delta function makes sense under an integral sign. We can arrive to this formula by constructing a sequence of distribution $\delta_n(x)$, such that:
$$\lim_{n\rightarrow\infty}\int^\infty_{-\infty}\delta_n(x-a)f(x)dx = f(a)$$
Then the limit of the sequence is $\delta(x)$, i.e.
$$\lim_{n\rightarrow\infty}\delta_n(x) = \delta(x)$$
There are many ways to construct $\delta_n(x-a)$. One common example is:
$$\delta_n(x-a)=\sqrt{\frac{n}{\pi}}e^{-n(x-a)^2}$$
$$=\frac{1}{2\pi}\int^\infty_{-\infty}e^{-\frac{k^2}{4n}}e^{i(x-a)k}dk$$
As you can see, the integral converge to 
$$\frac{1}{2\pi}\int^\infty_{-\infty}e^{i(x-a)k}dk$$
as $n\rightarrow\infty$. And integrate $f(x)$ with a Gaussian distribution will give the value $f(a)$ (for a rigorous proof, check textbooks on functional analysis). Therefore, we can safely use 
$$\frac{1}{2\pi}\int^\infty_{-\infty}e^{i(x-a)k}dk=\delta(x-a)$$
This is a sketch of proof, and definitely not a rigorous one. But hopefully, you can get some flavor out of it.