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!

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.