Function of Pauli matrices Let $\hat{n}$ be a 3D unit vector and let $\vec{\sigma}$ be a vector of the Pauli matrices
\begin{align}
\vec{\sigma} = \left( \left(\begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix}\right)\ ,\ \left(\begin{matrix}0 & - i \\ i & 0 \end{matrix}\right)\ ,\ \left(\begin{matrix} 1 & 0 \\ 0 & -1\end{matrix}\right)\right)
\end{align}
Let $\theta \in \mathbb{R}$ and $f$ be a function taking complex matrices to complex matrices. Show that
\begin{align}
f(\theta\ \hat{n} \cdot \vec{\sigma}) = \frac{f(\theta) + f(-\theta)}{2}I + \frac{f(\theta) - f(-\theta)}{2}\hat{n} \cdot \vec{\sigma}
\end{align}
I have tried expressing $f$ as a Fourier Series in order to exploit the known fact that 
\begin{align}
\exp(i\theta \hat{n} \cdot \vec{\sigma}) = \cos\theta I + i\sin\theta \hat{n} \cdot \vec{\sigma}
\end{align}
but I'm not sure if matrix-valued Fourier Series are even a thing. Could I please get some suggestions on how to prove this?
 A: First thing to note is that, eigen values of $\hat{n}\cdot \vec{\sigma}$ is 1 and -1. Because,
$$\hat{n}\cdot \vec{\sigma} = 
\begin{bmatrix}
n_3 & n_1-n_2i\\
n_1 + n_2i & -n_3
\end{bmatrix}
$$
$$
\det(\hat{n}\cdot \vec{\sigma}-\lambda I) = \lambda^2 - (n_1^2 + n_2^2 + n_3^2) = \lambda^2 - 1 = 0
$$
By spectral decomposition theorem, we have two orthonormal eigen vectors and diagonalization as:
$$\hat{n}\cdot \vec{\sigma} = |e_1\rangle\langle e_1| - |e_2\rangle\langle e_2|$$
By Sylvester's formula for functions that are analytic functions. We have
$$f(\theta~\hat{n}\cdot \vec{\sigma}) = f(\theta) |e_1\rangle\langle e_1| + f(-\theta) |e_2\rangle\langle e_2|$$
Since the same orthonormal vectors form a basis, we have completeness relation that gives:
$$ I = |e_1\rangle\langle e_1| + |e_2\rangle\langle e_2| $$
That implies,
$$ |e_1\rangle\langle e_1| = \frac{I + \hat{n}\cdot \vec{\sigma}}{2}$$
$$ |e_2\rangle\langle e_2| = \frac{I - \hat{n}\cdot \vec{\sigma}}{2}$$
Substituting, we get:
$$f(\theta~\hat{n}\cdot \vec{\sigma}) = f(\theta)\frac{I + \hat{n}\cdot \vec{\sigma}}{2}  + f(-\theta)\frac{I - \hat{n}\cdot \vec{\sigma}}{2} $$
Rewriting:
$$f(\theta~\hat{n}\cdot \vec{\sigma}) = \frac{f(\theta)+f(-\theta)}{2}I  + \frac{f(\theta)-f(-\theta)}{2}\hat{n} \cdot \vec{\sigma} $$
