My physics textbook states that $$ \int_{-\infty}^{\infty} e^{i(p-p')x/\hbar}dx = 2\pi \hbar \,\delta(p-p')$$
Whereas $\delta(p-p')$ is the delta-distribution. I see that for $p=p'$ the integral diverges. But how do I see that for $p \neq p'$ it evaluates to zero and how do I get the factor $2\pi\hbar$ ?
${}{}{}{}$
The mathematical answer uses distribution theory. The operator (called the unitary Fourier transform):
$$(F(f))(\xi)=\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty e^{-i x \xi} f(x) dx$$
maps $L^2$ to $L^2$. (In QM jargon it maps wavefunctions to wavefunctions; specifically it switches from the position representation to the momentum representation.) It has an inverse given by
$$(F^{-1}(f))(x)=\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty e^{i x \xi} f(\xi) d \xi.$$
The unitary Fourier transform has the property:
$$\langle F(f),F(g) \rangle = \langle f,g \rangle$$
for any $f,g \in L^2$, where $\langle \cdot,\cdot \rangle$ is the $L^2$ inner product. This property is why we call it unitary.
We extend the Fourier transform to the space of tempered distributions using this property. Namely, if $d$ is a tempered distribution, then we want to define $F(d)$ such that
$$\langle F(d),F(g) \rangle = \langle d,g \rangle$$
where now $\langle \cdot,\cdot \rangle$ is the pairing between tempered distributions and Schwarz functions (which agrees with the $L^2$ inner product where both are defined). Replacing $g$ by $F^{-1}(g)$ gives
$$\langle F(d),g \rangle = \langle d,F^{-1}(g) \rangle.$$
So this tells us how to compute the Fourier transform of a tempered distribution. You just apply your original distribution to the inverse Fourier transform of your test function.
OK, so now we will compute the Fourier transform of the Dirac delta. We find
$$\langle F(\delta),g \rangle = \langle \delta,F^{-1}(g) \rangle \\ = (F^{-1}(g))(0) \\ = \left. \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty e^{i x \xi} g(\xi) d \xi \right |_{x=0} \\ = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty g(\xi) d \xi.$$
Therefore the Fourier transform of the Dirac delta is (identified with) the constant function $\frac{1}{\sqrt{2 \pi}}$.
Now your question, in the sense of distribution theory, is to find the inverse Fourier transform of the constant function $\sqrt{2 \pi}$. By linearity that and our preceding calculation, that is just $2 \pi \delta(\xi)$, where in your case $\xi=(p-p')/\hbar$. Now you use the identity $\delta(ax)=\frac{1}{|a|} \delta(x)$ if $a$ is a nonzero constant.