Spectral Measures: Stone's Formula Hilbert Space: $\mathcal{H}$
Hamiltonian:
$$H:\mathcal{D}(H)\to\mathcal{H}:\quad H=H^*$$
Spectral Measure:
$$E:\mathcal{B}(\mathbb{R})\to\mathcal{B}(\mathcal{H}):\quad H=\int\lambda\mathrm{d}E(\lambda)$$
Resolvent Map:
$$R(z):=(H-z)^{-1}=\int\frac{1}{\lambda-z}\operatorname{dE(\lambda)}$$

Stone's Formula:
  $$\frac12\{E[a,b]+E(a,b)\}\\
=\lim_{\varepsilon\to0^+}\frac{1}{2\pi i}\int_a^b\{R(s+i\varepsilon)-R(s-i\varepsilon)\}\operatorname{ds}$$
  (Bounded Interval!)

How to check this by spectral measures?
 A: For $\epsilon > 0$, and $a < b$, and $R(\lambda)=(H-\lambda I)^{-1}$,
$$
    \left(\frac{1}{2\pi i}\int_{a}^{b}R(s+i\epsilon)-R(s-i\epsilon)ds\cdot x,y\right) \\
    = \frac{1}{2\pi i}\int_{a}^{b}(R(s+i\epsilon)x-R(s-i\epsilon)x,y)ds \\
    = \frac{1}{2\pi i}\int_{a}^{b}\int_{-\infty}^{\infty}\frac{1}{t-s-i\epsilon}-\frac{1}{t-s+i\epsilon}d(E(t)x,y)ds \\
    = \frac{1}{\pi}\int_{-\infty}^{\infty}\left(\int_{a}^{b}\frac{\epsilon}{(s-t)^{2}+\epsilon^{2}}ds\right)d(E(t)x,y) \\
    = \int_{-\infty}^{\infty}\frac{1}{\pi}\left[\tan^{-1}\left(\frac{b-t}{\epsilon}\right)-\tan^{-1}\left(\frac{a-t}{\epsilon}\right)\right]d(E(t)x,y) \\
    = \left(\int_{-\infty}^{\infty}\frac{1}{\pi}\left[\tan^{-1}\left(\frac{b-t}{\epsilon}\right)-\tan^{-1}\left(\frac{a-t}{\epsilon}\right)\right]dE(t)x,y\right)
$$
Because this holds for all $x, y \in \mathcal{H}$,
$$
   \frac{1}{2\pi i}\int_{a}^{b}R(s+i\epsilon)-R(s-i\epsilon)ds \\
   = \int_{-\infty}^{\infty}\frac{1}{\pi}\left[\tan^{-1}\left(\frac{b-t}{\epsilon}\right)-\tan^{-1}\left(\frac{a-t}{\epsilon}\right)\right]dE(t)
$$
It's easy to check that the final integrand is uniformly bounded by $1$ for all $t$. For $t > b$ or for $t < a$, the integrand converges to $0$ as $\epsilon\downarrow 0$. For $a < t < b$, the integrand converges to $1$ as $\epsilon\downarrow 0$. Finally, at $t=a$ or at $t=b$, the integrand converges to $1/2$ as $\epsilon\downarrow 0$. In other words, the integrand remains uniformly bounded by $1$ and converges pointwise everywhere to
$$
            l(t)=\frac{1}{2}\chi_{[a,b]}(t)+\frac{1}{2}\chi_{(a,b)}(t).
$$
By the dominated convergence theorem, the following tends to $0$ as $\epsilon\downarrow 0$:
$$
    \left\|\frac{1}{2\pi i}\int_{a}^{b}\left(R(s+i\epsilon)x-R(s-i\epsilon)x \right)ds-\int_{-\infty}^{\infty}l(t)dE(t)x\right\|^{2} \\
   = \int_{-\infty}^{\infty}\left|\frac{1}{\pi}\left[\tan^{-1}\frac{b-t}{\epsilon}-\tan^{-1}\frac{a-t}{\epsilon}\right]-l(t)\right|^{2}d\|E(t)x\|^{2}.
$$
Note: It is important that the integrand converges to $0$ everywhere as $\epsilon\downarrow 0$ because no assumption is made about the Borel measure $d\|E(t)x\|^{2}$ other than the fact that it is finite. The conclusion is that the following vector limit exists for all $x \in \mathcal{H}$:
$$
   \lim_{\epsilon\downarrow 0}\frac{1}{2\pi i}\int_{a}^{b}\{R(s+i\epsilon)x-R(s-i\epsilon)x\}ds \\
      = \int_{-\infty}^{\infty} l(t)dE(t)x = \frac{1}{2}\{E[a,b]+E(a,b)\}x.
$$
It is not true that the convergence is necessarily in the operator topology, but the convergence does always occur in the strong operator topology.
