I'm interested in evaluating the following limit $$\lim_{T\to\infty}\frac{1}{T}\int_0^T dt\;e^{i(\varepsilon'-\varepsilon)t},$$ with $\varepsilon$ and $\varepsilon'$ being real numbers. Performing the integral first yields $$\frac{-i}{\varepsilon'-\varepsilon}\left(e^{i(\varepsilon'-\varepsilon)T}-1\right).$$ Dividing by $T$ and taking the limit, seems to converge to zero. This does not look correct at first glance.
It is suspiciously temping to using the principle value of the exponential as $$\int_0^\infty dt\;e^{i(\varepsilon'-\varepsilon)t}=\pi\delta(\varepsilon'-\varepsilon)+\frac{i}{\varepsilon'-\varepsilon}$$ Would that be of any use? Setting $\varepsilon=\varepsilon'$ in the first equation, the limit evaluates to 1, hinting at the fact that zero may not be correct.
Let $\omega = \epsilon - \epsilon '$. Then we wish to find $\lim_{T\to \infty} \frac{1}{T}\int _0^T dt\cdot e^{i\omega t}$
After Integrating: $ \lim_{T\to \infty} \frac{-i}{\omega T}(e^{i\omega T}-1)=\frac{e^{i\omega T /2}}{\omega T}(2\sin{\frac{\omega T}{2}})=\frac{\sin {\omega T}}{\omega T}+i\frac{2\sin^2{\omega T /2}}{\omega T}$
If $\omega$ is non-zero, then the denominator dominates and the limit is zero for both the real and imaginary parts. If $\omega$ is zero applications of l'hopital's rule yield 1 for the real part and $0$ for the imaginary part.
So $\lim(...)= \delta(\omega)$