Solution (source code)

= Solution

For fixed $n>0$, Tonelli gives
$$
\int_0^n\int_0^\infty |\sin x|e^{-tx}\,dt\,dx=\int_0^n\frac{|\sin x|}{x}\,dx<\infty,
$$
because the quotient is <bounded> near zero. Fubini therefore permits reversing the order for this finite $x$ <interval>. Direct integration in $x$ yields
$$
\int_0^n e^{-tx}\sin x\,dx=\frac{1-e^{-nt}(t\sin n+\cos n)}{1+t^2}.
$$
Thus the desired integral equals $\pi/2$ minus the integral of the exponential remainder. Its absolute value is at most
$$
\int_0^\infty e^{-nt}(t+1)\,dt=\frac1{n^2}+\frac1n\longrightarrow0.
$$
Consequently $\boxed{\lim_{n\to\infty}\int_0^n\sin x/x\,dx=\pi/2}$. The truncation is essential: Fubini is not being applied to an absolutely <integrable function> over the whole infinite rectangle.