Why is it true that $\int_0^\infty \sin(qx) dx = 1/q$.

I think this is called either dimensional reduction, exponential regularization, or laplace (transform) regularization. The integral does not converge in any classical sense, but we are defining it via the above exponential regularization. This is a fairly common technique (trick?) in physics, where integrals tend to diverge without such considerations. The idea is that the integral with the exponential defines an analytic function for $\lambda>0$ and can be "extended" to $\lambda\rightarrow 0$.

This is not entirely unjustified because rarely do physical quantities oscillate as such to infinity. For example in an electromagnetic cavity, even though we assume an infinite sequence of modes exist, their energies would be ridiculous so there has to be some kind of cutoff or regularization. Feynman integrals are notorious for this kind of divergence (ultraviot and infrared divergenve especially), so that's why there's a flurry of regularization techniques to assign sensible values to them.


Since $$ \newcommand{\Im}{\operatorname{Im}} \int_0^\infty\sin(qx)\,\mathrm{d}x= \Im\left(\int_0^\infty e^{iqx}\,\mathrm{d}x\right)\tag1 $$ in the spirit of analytic continuation, we can look at $$ f(q)=\int_0^\infty e^{iqx}\,\mathrm{d}x\tag2 $$ which is well-defined for $\Im(q)\gt0$, and see how $f$ behaves as $\Im(q)\to0$.

When $\Im(q)\gt0$, we get, via contour integration, $$ \begin{align} f(q) &=\frac iq\int_0^{-iq\infty} e^{-x}\,\mathrm{d}x\tag{3a}\\ &=\frac iq\int_0^\infty e^{-x}\,\mathrm{d}x\tag{3b}\\ &=\frac iq\tag{3c} \end{align} $$ Explanation:
$\text{(3a)}$: substitute $x\mapsto\frac{ix}q$
$\text{(3b)}$: integration over $\gamma=[0,R]\cup[R,-iqR]\cup[-iqR,0]$ is $0$
$\text{(3c)}$: integrate

enter image description here

Then, by analytic continuation, as $\Im(q)\to0$, $\frac iq$ behaves nicely. Therefore, we say for real $q$: $$ \int_0^\infty(\cos(qx)+i\sin(qx))\,\mathrm{d}x=\frac iq\tag4 $$ which says not only that $\int_0^\infty\sin(qx)\,\mathrm{d}x=\frac1q$, but also that $\int_0^\infty\cos(qx)\,\mathrm{d}x=0$ (even though neither of these integrals converges in the classical sense).


Let's verify the integral of $\cos(qx)$: $$ \begin{align} \int_0^\infty\cos(qx)\,\mathrm{d}x &=\int_0^\infty\sin(\pi/2+qx)\,\mathrm{d}x\tag{5a}\\[6pt] &=\int_{\frac\pi{2q}}^\infty\sin(qx)\,\mathrm{d}x\tag{5b}\\ &=\color{#C00}{\int_0^\infty\sin(qx)\,\mathrm{d}x}\color{#090}{-\int_0^{\frac\pi{2q}}\sin(qx)\,\mathrm{d}x}\tag{5c}\\[3pt] &=\color{#C00}{\frac1q}\color{#090}{+\left.\frac1q\cos(qx)\,\right|_0^{\frac\pi{2q}}}\tag{5d}\\[9pt] &=0\tag{5e} \end{align} $$ Explanation:
$\text{(5a)}$: $\cos(x)=\sin(\pi/2+x)$
$\text{(5b)}$: substitute $x\mapsto x-\frac\pi{2q}$
$\text{(5c)}$: difference of integrals
$\text{(5d)}$: integrate
$\text{(5e)}$: evaluate