Improper Lebesgue integral $\int_{\mathbb R}\frac{\sin(x)}x~\mathrm dx$ While thinking over the idea of an improper Lebesgue integral, I came up with the following:
$$\int_0^\infty\mu\{x~|~f(x)>t\}-\mu\{x~|~f(x)<-t\}~\mathrm dt$$
with $\mu$ being the Lebesgue measure.
And I wanted to tackle this integral:
$$\int_{\mathbb R}\frac{\sin(x)}x~\mathrm dx$$
Though I'm not even sure if this converges, and if so, to what? I can't make very good progress on this due to a lack of theory behind this sort of improper integral.

This can be interpreted as finding
$$\lim_{\epsilon\to0^+}\int_{\mathbb R}f_\epsilon(x)~\mathrm dx$$
where
$$f_\epsilon(x)=\begin{cases}\frac{\sin(x)}x-\epsilon\operatorname{sgn}(\sin(x)),&\left|\frac{\sin(x)}x\right|\ge\epsilon\\0,&\left|\frac{\sin(x)}x\right|<\epsilon\end{cases}$$

Partial answer:
We can attempt to compare the difference of the improper Lebesgue integral and the improper Riemann integral as follows:
\begin{align}R(n)&=\int_{-2N\pi}^{2N\pi}\frac{\sin(x)}x~\mathrm dx-\int_{\mathbb R}f_{1/2N\pi}(x)~\mathrm dx\\&=2\int_0^{2N\pi}\min\left\{\frac1{2N\pi},\left|\frac{\sin(x)}x\right|\right\}\operatorname{sgn}(\sin(x))~\mathrm dx\\&=2\sum_{n=0}^{2N-1}\int_{n\pi}^{(n+1)\pi}\min\left\{\frac1{2N\pi},\left|\frac{\sin(x)}x\right|\right\}\operatorname{sgn}(\sin(x))~\mathrm dx\\&=2\sum_{n=0}^{N-1}\int_0^\pi\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+2n\pi}\right\}-\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+(2n+1)\pi}\right\}~\mathrm dx\end{align}
It is notable that for the majority of the time, we have
$$\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+2n\pi}\right\}-\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+(2n+1)\pi}\right\}=0$$
and when we don't, we have
$$\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+2n\pi}\right\}-\min\left\{\frac1{2N\pi},\frac{\sin(x)}{x+(2n+1)\pi}\right\}=\mathcal O(\min\{1/N,1/n^2\})$$
which is not strong enough to deduce the limit. I suspect something can be done on each interval to show that the integral over it is $\mathcal O(1/N^2)$ or something like that, since the amount of values where we have a large difference gets smaller and smaller.

Intuitively the error from the integral is dictated by the left and right sides of $[0,\pi]$, where the function forms a triangular-ish shape. For small $n$, these triangles have $\mathcal O(1/N^2)$ area. For large $n$, we can use the above and get $\mathcal O(1/n^2)$ error.
