Question: 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.

Answer: 
Let $z = x + iy$
$$
f(w) = \frac{y}{(1+zw)(1+\overline{z}w)}
$$
Let $\gamma$ be the contour consisting of the real axis from $-R$ to $R$ followed by the semi-circle in the upper half plane from $R$ to $-R$.  

$f$ has a one simple pole in the upper half plane at $w = -\frac{\overline{z}}{|z|^2} = -\frac{1}{z}$.  

The residue of $f$ at this pole is $\frac{1}{2i}$. Apply the Residue Theorem and let $R \to \infty$. In the limit, the integral on the portion of $\gamma$ in the upper half plane goes to zero using the simple estimate given by the max of the modulus of $f$ on the curve multiplied by the length of the curve.
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.