Evaluating the integral $\int_0^\infty \frac{\sin x} x \,\mathrm dx = \frac \pi 2$?

I believe this can also be solved using double integrals.

It is possible (if I remember correctly) to justify switching the order of integration to give the equality:

$$\int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dy \Bigg)\, dx = \int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dx \Bigg)\,dy$$ Notice that $$\int_{0}^{\infty} e^{-xy} \sin x\,dy = \frac{\sin x}{x}$$

This leads us to

$$\int_{0}^{\infty} \Big(\frac{\sin x}{x} \Big) \,dx = \int_{0}^{\infty} \Bigg(\int_{0}^{\infty} e^{-xy} \sin x \,dx \Bigg)\,dy$$ Now the right hand side can be found easily, using integration by parts.

$$\begin{align*} I &= \int e^{-xy} \sin x \,dx = -e^{-xy}{\cos x} - y \int e^{-xy} \cos x \, dx\\ &= -e^{-xy}{\cos x} - y \Big(e^{-xy}\sin x + y \int e^{-xy} \sin x \,dx \Big)\\ &= \frac{-ye^{-xy}\sin x - e^{-xy}\cos x}{1+y^2}. \end{align*}$$ Thus $$\int_{0}^{\infty} e^{-xy} \sin x \,dx = \frac{1}{1+y^2}$$ Thus $$\int_{0}^{\infty} \Big(\frac{\sin x}{x} \Big) \,dx = \int_{0}^{\infty}\frac{1}{1+y^2}\,dy = \frac{\pi}{2}.$$


Here's another way of finishing off Derek's argument. He proves $$\int_0^{\pi/2}\frac{\sin(2n+1)x}{\sin x}dx=\frac\pi2.$$ Let $$I_n=\int_0^{\pi/2}\frac{\sin(2n+1)x}{x}dx= \int_0^{(2n+1)\pi/2}\frac{\sin x}{x}dx.$$ Let $$D_n=\frac\pi2-I_n=\int_0^{\pi/2}f(x)\sin(2n+1)x\ dx$$ where $$f(x)=\frac1{\sin x}-\frac1x.$$ We need the fact that if we define $f(0)=0$ then $f$ has a continuous derivative on the interval $[0,\pi/2]$. Integration by parts yields $$D_n=\frac1{2n+1}\int_0^{\pi/2}f'(x)\cos(2n+1)x\ dx=O(1/n).$$ Hence $I_n\to\pi/2$ and we conclude that $$\int_0^\infty\frac{\sin x}{x}dx=\lim_{n\to\infty}I_n=\frac\pi2.$$


Here's one more, just for the fun of it. For $\theta$ not an integer multiple of $2 \pi$, we have $$\sum \frac{e^{i n \theta}}{n} = -\log(1-e^{i \theta}).$$ Taking imaginary parts, for $0 < \theta < \pi$, we have $$\sum \frac{\sin (n \theta)}{n} = -\mathrm{arg}(1-e^{i \theta}) = \pi/2-\frac{\theta}{2}.$$ Draw the isosceles triangle with vertices at $0$, $1$ and $e^{i \theta}$ to see the second equality.

So $\displaystyle \sum \theta \cdot \frac{\sin (n \theta)}{n \theta} = \pi/2-\frac{\theta}{2}$. The right hand side is a right-hand Riemann sum for $\int \frac{\sin t}{t} dt$, with intervals of width $\theta$. So, taking the limit as $\theta \to 0$, we get $$\int\limits_0^\infty \frac{\sin t}{t} dt=\frac{\pi}{2}$$.