I am trying to understand this equality below, but I can't seem to wrap my head around it. The Hamiltonian is defined as $\vec H=-\frac {\gamma B \hbar}{2}\sigma_x$, which gives the eigenvalues $\pm \frac {\gamma B \hbar}{2}$.
$$|\psi (t)\rangle = e^{-iHt/ \hbar} \chi_+ = \left(\cos\left(\frac{Ht}{\hbar}\right)-i\sin\left(\frac{Ht}{\hbar}\right)\right)\chi_+=$$
$$ =\left(\cos\left(\frac{B\gamma t}{2}\right)I-i\sin\left(\frac{B\gamma t}{2}\right)\sigma_x\right)\chi_+$$
It's the last equality I'm stuck at. Any help would be greatly appreciated.
I've tried writing it all out as matrices, and this is what I get from the left part of the equality:
$$\left(\cos\left(\frac{Ht}{\hbar}\right)-i\sin\left(\frac{Ht}{\hbar}\right)\right)\begin{pmatrix} 1 \\ 0 \end{pmatrix}= \begin{pmatrix} \cos\left(\frac{Ht}{\hbar}\right)-i\sin\left(\frac{Ht}{\hbar}\right)\\0 \end{pmatrix}$$ The above should be equal to the right hand side of the equality, but this is what I get instead: $$ \left( \cos\frac {B\gamma t}{2} \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} -i\sin\frac{B\gamma t}{2}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\right) \begin{pmatrix} 1 \\ 0 \end{pmatrix}=\begin{pmatrix} \cos\left(\frac{B\gamma t}{2}\right) \\ -i\sin\left(\frac{B\gamma t}{2}\right) \end{pmatrix}$$