Proof that $\frac{\sin x}{x}, x\in (0,\infty)$ is improperly Riemann integrable. This is the beginning of the proof that $\frac{\sin x}{x}, x\in (0,\infty)$ is improperly Riemann integrable.
However, I don't understand how to attain the second identity below. 
In the first inequality, I can see that $|\lim_{a\to \infty} \int_{N\pi}^a \frac{\sin x}{x}dx| \le \lim_{a\to \infty} \int_{N\pi}^{(N+1)\pi} |\frac{\sin x}{x}|dx$, but how do we get the same inequality for $N\to \infty$? What justifies this change in variables? 
Also, similarly, how does this enable us to conclude the second identity? 
To get the second identity, we would need $\lim_{a\to \infty} \int_0^{N(a)\pi} \frac{\sin x}{x}dx = \lim_{n\to \infty} \int_0^{n\pi} \frac{\sin x}{x}dx$, but how do we get this?
I mean, I don't understand how we are able to switch the limit from $a\to \infty$ to $N \to \infty$. I can see this intuitively but I would appreciate if anyone could explain how this works rigorously.
For $a>0$ we can find $N=N(a)\in \mathbb{N}$ such that $N\pi \le a <(N+1)\pi$. Thus 
$$\int_0^\infty \frac{\sin x}{x}dx = \lim_{a\to \infty} \bigg( \int_0^{N\pi} \frac{\sin x}{x}dx + \int_{N\pi}^a \frac{\sin x}{x}dx\bigg) 
=\lim_{N\to \infty} \sum_{i=0}^{N-1} \int_{i\pi}^{(i+1)\pi} \frac{\sin x}{x}dx,$$
where we use 
$$\Bigg| \lim_{a\to \infty} \int_{N\pi}^a \frac{\sin x}{x}dx \Bigg| \le \lim_{N\to \infty} \int_{N\pi}^{(N+1)\pi} \Bigg| \frac{\sin x}{x}\Bigg| dx \le \lim_{N\to \infty} \frac{\pi}{N\pi}=0.$$
 A: A more correct chain of inequalities would be
$$\Bigg| \int_{N\pi}^a \frac{\sin x}{x}dx \Bigg| \le  \int_{N\pi}^{a} \Bigg| \frac{\sin x}{x}\Bigg| dx \le \int_{N\pi}^{(N+1)\pi} \Bigg| \frac{\sin x}{x}\Bigg| dx \le \frac{1}{N\pi}\int_{N\pi}^{(N+1)\pi} | \sin x| dx\\= \frac{2}{N\pi}=
\frac{2(N+1)}{N}\frac{1}{(N+1)\pi}\le \frac{4}{a},$$
where $1/(N+1)\pi <1/a \le 1/N\pi$. And now you send $a\to\infty$ to get $0$.
A: Perhaps it would be more clear if you maintained the explicit dependence of $N$ on $a$ throughout.  Adding a couple extra steps for clarity, we have that $N(a)\pi\le a\lt(N(a)+1)\pi$ implies
$$\left|\int_{N(a)\pi}^a{\sin x\over x}dx\right|\le\int_{N(a)\pi}^a\left|\sin x\over x\right|dx\le\int_{N(a)\pi}^a\left|\sin x\over x\right|dx+\int_a^{(N(a)+1)\pi}\left|\sin x\over x\right|dx\\=\int_{N(a)\pi}^{(N(a)+1)\pi}\left|\sin x\over x\right|dx\le\int_{N(a)\pi}^{(N(a)+1)\pi}\left|1\over N(a)\pi\right|dx={\pi\over N(a)\pi}$$
Finally, it's clear that $N(a)\to\infty$ as $a\to\infty$ (and vice versa).
A: HINT:
You should estimate the integral on a given interval $[a,b]$ and see what happens when that interval moves to infinity. For this, use integration by parts:
$$\int_a^b \frac{\sin x}{x} d x = \int_ a^b (-\cos x)' \frac{1}{x} d x = = - \cos x \cdot \frac{1}{x} \mid_a^b - \int_a^b (-\cos x)(- \frac{1}{x^2})dx= \\=\frac{\cos a}{a} - \frac{\cos b}{b} - \int_a^b \frac{\cos x}{x^2} dx $$
We conclude that
$$\left |\int_a^b \frac{\sin x}{x} d x \right |\le \frac{1}{a} + \frac{1}{b} + \frac{1}{a}- \frac{1}{b} = \frac{2}{a}$$
