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.
 A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{%
? \equiv \int_{\mathbb{R}}{y\,\dd t \over \verts{1 + (x + \ic y)t}^{2}}}$

\begin{align}
\color{#0000ff}{\large ?} &= y\int_{-\infty}^{\infty}{\dd t \over \pars{1 + xt}^{2} + \pars{yt}^{2}}
= y\int_{-\infty}^{\infty}{\dd t \over \pars{x^{2} + y^{2}}t^{2} + 2xt + 1}
\\[3mm]&=
{y \over x^{2} + y^{2}}
\int_{-\infty}^{\infty}
{\dd t \over t^{2} + 2\bracks{x/\pars{x^{2} + y^{2}}}t + 1/\pars{x^{2} + y^{2}}}
\\[3mm]&=
{y \over x^{2} + y^{2}}
\int_{-\infty}^{\infty}
{\dd t \over \bracks{t + x/\pars{x^{2} + y^{2}}}^{2} - x^{2}/\pars{x^{2} + y^{2}}^{2} + 1/\pars{x^{2} + y^{2}}}
\\[3mm]&=
{y \over x^{2} + y^{2}}
\int_{-\infty}^{\infty}
{\dd t \over t^{2} + y^{2}/\pars{x^{2} + y^{2}}^{2}}
=
{y \over x^{2} + y^{2}}\,{1 \over \verts{y}/\pars{x^{2} + y^{2}}}
\int_{-\infty}^{\infty}
{\dd t \over t^{2} + 1}
\\&=\color{#0000ff}{\large\sgn\pars{y}\pi}
\end{align}

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