# Confusion regarding $|A|^2 \int\limits_{-\infty}^\infty e^{i(p-p')x/h}=|A|^2 2\pi h\delta(p-p')$

The book "Introduction to Quantum Mechanics (Second edition)" by Griffiths says the following on pg 103:

$$|A|^2 \int\limits_{-\infty}^\infty e^{i(p-p')x/h}=|A|^2 2\pi h\delta(p-p')$$

Here $$\delta$$ is the delta function. How is this true? If $$p\neq p'$$, then the above formula says that the integral $$\int\limits_{-\infty}^\infty e^{i(p-p')x/h}=0$$. However, I think that the integral is not well-defined, as opposed to $$0$$.

The meaning of this equality is that $$\lim_{M\rightarrow\infty} \int_{-M}^M e^{i(p-p')x/\hbar} dx = 2\pi \hbar \delta(p-p')$$ where the limit was taken in the sense of distributions, that is for any function (that is sufficiently smooth and integrable) we have $$\lim_{M\rightarrow\infty} \int_{-\infty}^{\infty} \Big(\int_{-M}^M e^{i(p-p')x/\hbar} dx \Big) f(p') dp' = \int_{-\infty}^\infty \Big(2\pi \hbar \delta(p-p') \Big) f(p') dp' = 2\pi \hbar f(p)$$ (in this equality $$\lim$$ is a normal limit in $$\mathbb C$$). You can check that $$\int_{-M}^M e^{i(p-p')x/\hbar} dx = \frac{2 \sin\big((p-p')M/\hbar\big)}{(p-p')/\hbar}$$ and \begin{align} & \lim_{M\rightarrow\infty} \int_{-\infty}^{\infty} \frac{2 \sin\big((p-p')M/\hbar\big)}{(p-p')/\hbar} f(p') dp' =^{z:= (p-p')M/\hbar} \\ &= \lim_{M\rightarrow\infty} \hbar \int_{-\infty}^\infty \frac{2\sin z}{z} f(p - \frac{z\hbar}{M}) dz =^{\text{under some assumptions about }f} \\ &= \hbar \int_{-\infty}^\infty \frac{2\sin z}{z} f(p) dz = \\ &= 2\pi\hbar f(p)\end{align}