Why does this expression equal $\pi$? I noticed that the following expression equals $\pi$ and I was curious as to why. Is it just a coincidence, or is there a meaningful explanation?
$$\int_{-\infty}^\infty\frac{1}{x^2+1}~dx=\pi$$

One way to see this is by noting that 
$$\arctan(x)' = \cos^2(\arctan(x)) = {1 \over 1 + \tan^2(\arctan(x))} = {1 \over 1 + x^2}$$
where we used that $\tan(x)' = {1 \over \cos^2(x)}$, the rule for the differentiation of the inverse function and the simple identity $$\tan^2(x) + 1 = {\sin^2(x) + \cos^2(x) \over \cos^2(x)} = {1 \over \cos^2(x)}.$$
Since $\lim\limits_{x \to \pm \pi/2} \tan(x) = \pm \infty$ and $\tan(x)$ is a bijection for $x \in (-\pi/2, \pi/2)$ the claim follows.
Another way to see this is by interpreting the integral as the one along a closed curve in the complex domain where the curve first runs along the real axis and then closes upon itself by making "an infinite half-circle" in the upper half-plane (formally, we take circle of radius $R$ and in the end take the limit $R \to \infty$). Since the integral along the closed curve equals the sum of residues enclosed by it times $2 \pi i$ and since the only pole in the upper half plane is located at $x = i$ it follows that the integral is equal to ${2\pi i \over 2i} = \pi$. If you are not familiar with the residue concept, it's just a coefficient of the function that stands at the $(z-a)^{-1}$ term of the Laurent expansion. In this case we have 
$${1 \over 1 + z^2} = {1 \over (z + i)(z-i)}$$
 so the coefficient at $z=i$ is given by ${1 \over z + i} = {1 \over 2i}$.
