Explanation of this integral $$
\int_{-\infty}^{\infty}
\mathrm{e}^{-\frac{\mathrm{i}}{\hbar}\left(p - p'\,\right)x} \,\,\,\mathrm{d}x =
2\pi\hbar\,\delta\left(p - p'\right)
$$
I don't quite understand how this integration leads to the right hand side. Any explanation is appreciated.
 A: $\forall a\in \mathbb{R}^{+}$,
\begin{align}
 \int_{-a}^{a}
 \left[ \color{red}{\int_{-\infty}^{\infty} e^{-ikx} dx} \right] dk &=
 \int_{-\infty}^{\infty}
 \left[ \int_{-a}^{a} e^{-ikx} dk \right] dx \\
 &= 
 \int_{-\infty}^{\infty}
 \left[ -\frac{e^{-ikx}}{ix} \right]_{k=-a}^{a} dx \\
 &= 
 \int_{-\infty}^{\infty}
 \frac{2\sin ax}{x} dx \\
 &= 
 2\int_{-\infty}^{\infty}
  \frac{\sin ax}{ax} \, d(ax) \\
 &= 
 2\int_{-\infty}^{\infty}
  \text{sinc } t\, dt \\
 &=\color{red}{2\pi}
\end{align}
Comparing $\displaystyle
\int_{-a}^{a} \delta (k) \, dk=1$, $\forall a\in \mathbb{R}^{+}$
$$\int_{-\infty}^{\infty} e^{-ikx} dx=2\pi \, \delta (k)$$
Shifting axis,
$$\int_{-\infty}^{\infty} e^{-i(k-k')x} dx=2\pi \, \delta (k-k')$$
By $p=\hbar k$ and note that
$$\int_{-\infty}^{\infty} \delta (k) \, dk =
  \int_{-\infty}^{\infty} \delta (p) \, dp = 1 $$
$$ \implies \delta (k) \, dk = \delta (p) \, dp$$
$$ \implies \delta(k-k')=\hbar\, \delta (p-p') $$
$$ \therefore \quad
   \int_{-\infty}^{\infty}
              \exp \left[-\frac{i(p-p')x}{\hbar} \right] dx=
   2\pi \hbar \, \delta (p-p')$$
A: We should clarify that this formula is not a calculus formula. Instead it is a distribution formula. The right hand side means
$$
2\pi h\delta(p-p')(f)=2\pi h \delta_{p,p'}f(p)
$$
In other words, you can think the right hand side as a 'function' that operates on another function and outputs a value. If $p\not=p'$ then this 'function' vanishes, otherwise it gives you the value of $f$ on $p$ times $2\pi h$. This is an example of a distribution. 
Now for simplification let us take $h=1$. The question is how the left hand side corresponds to the right hand side. To see this we rewrite $f(p)$ using Fourier inversion ignoring normalizing constants:
$$
f(p)=\int_{-\infty}^{\infty}e^{2\pi i tp}dt\int_{-\infty}^{\infty}e^{-2\pi i tp'}f(p')dp'=\int\int e^{2\pi i t(p-p')}f(p')dp'dt
$$
But formally we know that a "good enough" function $F$ also acts as a distribution to other functions via integration:
$$
F(G)=\int F(x)G(x)
$$
So the way we view it is a distribution "acted" on $f$ and produced the value $f(p)$. The function related to the distribution now is 'obviously' formally given by
$$
\int e^{2\pi i t(p-p')}dt
$$
Notice that $x,t$ are just dummy variables anyways, switching their places back we get back the formula you written in the beginning. There are still several things hidden under the rug. First there is the issue of normalizing constants and $h$ (hence some calculus computation), and second we know Fourier inversion is only well-defined for certain class of functions, so we need an appropriate function space. Third if you pursue this line of thinking rigorously, you will find the expression on the left hand side is not even unique. I will leave these to you as further topics for self study. 
A: You can understand it using the formalism of generalized functions. The generalized function $\mathrm{1}$ is defined by the sequence of functions $1_n(x)=\exp(-x^2/n^2)$. In this formalism the Fourier transform of $\mathrm1$ will be another generalized function defined by the sequence of functions, 
$$ \int_{-\infty}^\infty \mathrm{1}_n(x)e^{-ikx} \ \mathrm{d}x, $$
which in this case will be the sequence which defines the $\delta$ function. 
