TITLE: Regularization and $\int_{0}^{\infty}\sin x \;\mathrm{d}x$
QUESTION [14 upvotes]: In my grad quantum/E&M classes I had to do intuition-bending regularization of integrals that didn't seem mathematically justified (but got full credit and were repeated in the solutions) like the following:
$$\int_{0}^{\infty}\sin x \;\mathrm{d}x = \lim_{\alpha \to 0^+} \int_{0}^{\infty} e^{-\alpha x} \sin x \;\mathrm{d}x = \lim_{\alpha \to 0^+}\frac{1}{\alpha^2+1} = 1$$
which is unreasonable as $\int_{a}^{b}\sin x \;\mathrm{d}x = \cos(a)-\cos(b)$, or in our case $\lim_{b \to \infty} 1 - \cos(b) = \mathrm{undefined}$ as the limit doesn't converge.
Is there any formal mathematics behind this line of thought claiming divergent things converge with regularization?  (E.g., similar to the infinite sums 1+1+1+... = -1/2 or 1+2+3+4+... = -1/12)?

REPLY [6 votes]: \begin{eqnarray*}
\int_{0}^{\infty}\sin\left(x\right)\,{\rm d}x
& = &
\Im\int_{-\infty}^{\infty}\Theta\left(x\right){\rm e}^{{\rm i}x}\,{\rm d}x
=
\Im\int_{-\infty}^{\infty}
\left({\rm i}\int_{-\infty}^{\infty}{{\rm d}k \over 2\pi}\,{{\rm e}^{-{\rm i}kx} \over k + {\rm i}0^{+}}\right)\,{\rm e}^{{\rm i}x}\,{\rm d}x
\\[3mm]
& = &
\Re\int_{-\infty}^{\infty}{{\rm d}k \over k + {\rm i}0^{+}}
\int_{-\infty}^{\infty}{{\rm d}x \over 2\pi}\,{\rm e}^{-{\rm i}\left(k - 1\right)x}
=
\Re\int_{-\infty}^{\infty}{{\rm d}k \over k + {\rm i}0^{+}}\,\delta\left(k - 1\right)
\\[3mm]
& = &
\Re\left(1 \over 1 + {\rm i}0^{+}\right)
=
\Re\left(1\right) - {\rm i}\,\pi\,\delta\left(1\right)
=
1
\end{eqnarray*}

Why does it work ?: See
$\tt @Sasha$ answer.