The integral of the Sinc function over $\mathbb{R}$ is well-known, $$\int_{-\infty}^{\infty} \frac{\sin(x)}{x} dx = \pi$$But if I try to evaluate this using integration by parts, I get $$\int_{-\infty}^{\infty} \frac{\sin(x)}{x} dx = \left.-\frac{\cos(x)}{x} \right|_{-\infty}^{\infty} - \int_{-\infty}^{\infty} \frac{\cos(x)}{x^2} dx$$ The first part is $0$, and the second part diverges.
What's going on? Is integration by parts just not kosher here? If so, why not?
