$$\int_0^\infty \dfrac{\sin x}x\,\mathrm dx = \mathrm{Im}\left(\int \dfrac{e^{ix}}x\,\mathrm dx\right)$$ Considering $f(z) = \dfrac{e^{iz}}z$, it has a simple pole at $z = 0$. Residue of $f(z)$ at $z = 0$ is $1$. This imples that
$$\mathrm{Im}\left(\int_0^\infty \dfrac{e^{iz}}z\,\mathrm dz\right) = \dfrac12\int_{-\infty}^\infty\dfrac{e^{iz}}z\,\mathrm dz = \dfrac12(2\pi\cdot1) = \pi$$
I found out that the answer is $\dfrac12\pi$. Why??