For some nice function $f(x)$, how to show the following using contour integration? $$ \lim_{\epsilon\to 0^+} \int_{-\infty}^\infty f(x) \frac{\epsilon}{\epsilon^2+x^2} dx = \pi f(0) $$
The way I would approach this integral is by $\frac{d}{dx} \tan^{-1} \frac{x}{\epsilon} = \frac{\epsilon}{\epsilon^2+x^2}$ and integrating by parts. This assumes $f$ does not increase too quickly, as for example when $f(x)=x$, the integral on the LHS does not converge.
I'm hoping to see a method that can be extended to an integral of the form $$ \lim_{\epsilon\to 0^+} \int_{-\infty}^\infty f(x) \frac{\epsilon}{(\epsilon^2+x^2)(x^2 - (\omega+i\epsilon)^2)} dx $$
where $f$ has some poles in the complex plane.
Also found a similar question here: Dirac delta as a limit of sequence of functions