TITLE: A strange integral: $\int_{-\infty}^{+\infty} {dx \over 1 + \left(x + \tan x\right)^2} = \pi.$
QUESTION [77 upvotes]: While browsing on Integral and Series, I found a strange integral posted by @Sangchul Lee. His post doesn't have a response for more than a month, so I decide to post it here. I hope he doesn't mind because the integral looks very interesting to me. I hope for you too. :-)

$$\mbox{How does one prove}\quad
\int_{-\infty}^{\infty}
{{\rm d}x \over 1 + \left[\,x + \tan\left(\, x\,\right)\,\right]^{2}} = \pi\quad
{\large ?}
$$
Please don't ask me, I really have no idea how to prove it. I hope users here can find the answer to prove the integral. I'm also interested in knowing any references related to this integral. Thanks in advance.

REPLY [10 votes]: The Inverse Function Theorem gives us
$$
\int_{-\infty}^{+\infty}f(g(x))\,\mathrm{d}x=\int_{-\infty}^{+\infty}\sum_{g(x)=\alpha}\frac1{\left|g'(x)\right|}\,f(\alpha)\,\mathrm{d}\alpha\tag{1}
$$
If we integrate along squares, centered at the origin, whose sides are parallel to the $x$ and $y$ axes with length $2k\pi$, as $k\to\infty$, we get
$$
\begin{align}
\sum_{x+\tan(x)=\alpha}\frac1{1+\sec^2(x)}
&=\frac1{2\pi i}\oint\frac{\mathrm{d}z}{z+\tan(z)-\alpha}\\[6pt]
&=1\tag{2}
\end{align}
$$
Letting $g(x)=x+\tan(x)$, $(1)$ and $(2)$ give
$$
\int_{-\infty}^{+\infty}f(x+\tan(x))\,\mathrm{d}x=\int_{-\infty}^{+\infty}f(x)\,\mathrm{d}x\tag{3}
$$
Therefore, applying $(3)$ to $f(x)=\frac1{1+x^2}$ yields
$$
\begin{align}
\int_{-\infty}^{+\infty}\frac{\mathrm{d}x}{1+(x+\tan(x))^2}
&=\int_{-\infty}^{+\infty}\frac{\mathrm{d}x}{1+x^2}\\[6pt]
&=\pi\tag{4}
\end{align}
$$