Help with a contour integration I've been trying to derive the following formula
$$\int_\mathbb{R} \! \frac{y \, dt}{|1 + (x + iy)t|^2} = \pi$$
for all $x \in \mathbb{R}, y > 0$. I was thinking that the residue formula is the way to go (and would prefer a solution by this method), but I keep getting stuck either proceeding with the function as is and choosing the correct contour or finding a substitution which makes things easier. I would greatly appreciate some help on how best to proceed. Thanks in advance.

Note that
$$|1+(x+i y)t|^2=1+2 x t +(x^2+y^2) t^2$$
The integral is therefore a straightforward application of the residue theorem, if you want.   That is, evaluate
$$\int_{-\infty}^{\infty} \frac{dt}{1+2 x t +(x^2+y^2) t^2}$$
The poles are at $t_{\pm}=(-x \pm i y)/(x^2+y^2)$.  If we close in the upper half plane with a semicircle of radius $R$, and let $R\to\infty$, the integral about the circular arc vanishes as $\pi/((x^2+y^2)R)$, and by the residue theorem, the integral is
$$i 2 \pi \frac1{2 (x^2+y^2) t_++2 x} = \frac{i 2 \pi}{2 (-x+i y)+2 x} = \frac{\pi}{y}$$
as claimed.
