Difficulties understanding a proof of $\int_0^{\infty} \frac{\sin(x)}{x} \, dx = \frac{\pi}{2}$ I got a homework and I've trying to do this problem about 2 days, but I "lost my fight". So I turn to you.
I have to prove that $$\int _0^\infty \frac{\sin (x)}{x} \, dx = \frac{\pi}{2}.$$
I can't use complex numbers, double integral, laplace transforms.
I found Mr. Berry's proof, which is looks good, but I don't understand any steps so I need some explanation.
Proof on the picture.
Thank you!

 A: Note that
$$\underbrace{\int_{i \pi}^{(i+1) \pi} dx \frac{\sin{x}}{x}}_{x=u+i \pi} = \int_0^{\pi} du \frac{\sin{(u+i \pi)}}{u+i \pi} = (-1)^i \int_0^{\pi} du \frac{\sin{u}}{u+i \pi}$$
Then
$$\sum_{i=-\infty}^{\infty} \int_{i \pi}^{(i+1) \pi} dx \frac{\sin{x}}{x} = \sum_{i=-\infty}^{\infty}  (-1)^i \int_0^{\pi} du \frac{\sin{u}}{u+i \pi} = \sum_{i=-\infty}^{\infty}  (-1)^i \int_0^{\pi} du \frac{\sin{u}}{u-i \pi}$$
We may reverse the order of summation and integration, so that the integral is equal to
$$\frac12 \int_0^{\pi} du \, \sin{u} \sum_{i=-\infty}^{\infty}  \frac{(-1)^i}{u-i \pi}  $$
This last sum is $\csc{u}$; one may show this using the Residue Theorem.
A: Since you cannot use complex numbers, double integrals, or Laplace transforms, here is a method that comes to mind. After showing that the improper integral exists, let $A = \int_0^\infty \frac{\sin x}{x}\, dx$. Then $$A = \lim_{n\to \infty} \int_0^{(2n+1)\frac{\pi}{2}} \frac{\sin x}{x}\, dx = \lim_{n\to \infty} \int_0^\pi \frac{\sin \frac{(2n+1)}{2}x}{x}\, dx = \lim_{n\to \infty} \int_0^\pi f(x)g_n(x)\, dx,$$
where $f(x) = \frac{\sin x/2}{x/2}$ and $g_n(x) = \frac{\sin (2n+1)x/2}{2\sin x/2}$. Since $$g_n(x) = \frac{1}{2} + \sum_{k = 1}^n \cos kx$$ for $0 < x < \pi$, we have $$\int_0^\pi g_n(x)\, dx = \frac{\pi}{2}.$$ Therefore 
$$\int_0^\pi f(x)g_n(x)\, dx = \frac{\pi}{2} + \int_0^\pi h(x)\sin \frac{(2n+1)x}{2}\, dx,$$ 
where $h(x) = (f(x) - 1)/(2\sin x/2)$. Not only is $h$ continuous on $(0,\pi)$, but $h$ also has a right-hand limit at $0$. Indeed, $$\lim_{x \to 0^+} h(x) = \lim_{x\to 0^+} \frac{f(x) - 1}{x} \lim_{x\to 0^+} \frac{x/2}{\sin x/2} = \lim_{x\to 0^+} \frac{f(x) - 1}{x} = \lim_{x\to 0^+} \frac{2\sin \frac{x}{2} - x}{x^2},$$ and 
$$\lim_{x\to 0^+} \frac{2\sin \frac{x}{2} - x}{x^2} = \lim_{x\to 0^+} \frac{O(x^3)}{x^2} = \lim_{x\to 0^+} O(x) = 0.$$ Thus $h(x)$ is piecewise continuous on $(0,\pi)$. Hence, by the Riemann-Lebesgue lemma, $\lim_{n\to \infty} \int_0^\pi h(x)\sin \frac{(2n+1)x}{2}\, dx = 0$. Now we deduce $$\lim_{n\to \infty} \int_0^\pi f(x)g_n(x)\, dx = \frac{\pi}{2},$$ in other words, $A = \frac{\pi}{2}$.
