Trying to construct simple example of a 'spectral measure' $\mu_\psi$ for the expression $(\psi,f(A)\psi) = \int_{\sigma(A)} f(\lambda)d\mu_\psi$? I'm trying to construct a simple explicit example of a 'spectral measure'. Here is the definition I have.

Let $A$ be a bounded self-adjoint opreator. Let $\psi \in H$ where $H$
  is a Hilbert space. Then $f\to (\psi,f(A)\psi)$ is a positive linear
  functional on $C(\sigma(A))$. Thus by the Riesz-Markov theorem there
  exists a unique measure $\mu_\psi$ on the compact set $\sigma(A)$ such
  that $$(\psi,f(A)\psi) = \int_{\sigma(A)} f(\lambda)d\mu_\psi.$$
  $\mu_\psi$ is the spectral measure associated with $\psi$.

So take $H = \mathbb{R}$. Let $f(x) = x^2$ and let
$$A=\begin{pmatrix}3 & 0 \\ 0 & 1\end{pmatrix}\quad \text{and} \quad \psi = \begin{pmatrix}1 \\ 1\end{pmatrix},
$$
which means $\sigma(A) = \{3,1\}$. Then
$$
\begin{align}
(\psi,f(A)\psi) & = (\begin{pmatrix}1 \\ 1\end{pmatrix},\begin{pmatrix}3 & 0 \\ 0 & 1\end{pmatrix}^2\begin{pmatrix}1 \\ 1\end{pmatrix}) \\
& = (\begin{pmatrix}1 \\ 1\end{pmatrix},\begin{pmatrix}9 & 0 \\ 0 & 1\end{pmatrix}\begin{pmatrix}1 \\ 1\end{pmatrix}) \\
& = 9 + 1 = 10.
\end{align}
$$
So we should have
$$
\int_{\sigma(A)} f(\lambda)d\mu_\psi(\lambda) = \int_{\{3,1\}} \lambda^2 d\mu_\psi(\lambda) = \text{something...} = 10.
$$
But what is this 'something'? To be precise, what is an explicit expression for $\mu_\psi$ and then how do I interpret an integral over the discrete set $\{3,1\}$ with respect to this measure $\mu_\psi$?
 A: The integral is (by definition of Lebesgue integral)
$$\tag1
\int_{\{3,1\}}f(\lambda)\,d\mu(\lambda)=f(3)\,\mu_\psi(\{3\})+f(1)\,\mu_\psi(\{1\}). 
$$
This is supposed to agree with 
$$\tag2
\langle \psi,f(A)\psi\rangle=f(3)+f(1).
$$
As $(1)$ and $(2)$ are agree for all $f$, we get $\mu_\psi(\{3\})=\mu_\psi(\{1\})=1$. 
In this example, because the form of $A$ is so simple, one can calculate the spectral measure and thus obtain $d\mu_\psi$ for any $\psi$. Because
$$
f(A)=f(3)E_{11}+f(1)E_{22}=\int_{\sigma(A)} f(\lambda)\,d\mu,
$$
where $\mu$ is the spectral measure $\mu(\{3\})=E_{11}$, $\mu(\{1\})=E_{22}$. And then 
$$\tag3
\mu_\psi(R)=\langle \psi,\mu(R)\psi\rangle
$$
for any Borel set $R\subset \sigma(A)$ (in this case the only possibilities are $\varnothing$, $\{1\}$, $\{3\}$, $\{1,3\}$). 
A: In this case, the spectral measure is discrete, with atoms at $3$ and at $1$. $\mu\{3\}$ is the orthogonal projection onto the eigenspace associated with eigenvalue $3$, and similarly for $\mu\{1\}$. So
$$
              \mu\{1\}x = \mu\{1\}\left[\begin{array}{c}x_1\\x_2\end{array}\right]=x_2\left[\begin{array}{c}0 \\ 1\end{array}\right], \\
              \mu\{3\}x = \mu\{3\}\left[\begin{array}{c}x_1\\x_2\end{array}\right]= x_1\left[\begin{array}{c}1 \\ 0\end{array}\right].
$$
Then,
$$
        \int f(\lambda)d\mu(\lambda)x=f(1)\mu\{1\}x+f(3)\mu\{3\}x.
$$
For example,
$$        \int \lambda^2 d\mu(\lambda)x=1^2\mu\{1\}x+3^2\mu\{3\}x = \left[\begin{array}{cc}3^2 & 0 \\ 0 & 1^2\end{array}\right]\left[\begin{array}{c}x_1\\x_2\end{array}\right]
$$
