find the function of a matrix Given
$$
J=\begin{bmatrix}
\frac{\pi}{2}&0&0\\
1&\frac{\pi}{2}&0\\
0&1&\frac{\pi}{2}\\
\end{bmatrix}
$$
find $\sin(J) \text{ and } \cos(J)$
I know I need to find the spectral decomposition, but I am not sure what to do because the examples and exercises in the textbook I have all have more than one eigenvalue, here there is only one eigenvalue.
 A: As was discussed in the comments, let $K=e_{21}+e_{32}$. $J=\frac{\pi}{2}I+K$, and certainly $I$ and $K$ commute, so
$$\sin J=\sin\left(\frac{\pi}{2}I+K\right)=\cos\left(\frac{\pi}{2}I\right)\sin K+
\sin\left(\frac{\pi}{2}I\right)\cos K$$
The first term vanishes since $\cos(\pi/2)$ does, and $\sin(\pi/2 I)=I$, so all we need is
$\cos K$. As noted in another answer $K^n=0$ for $n\geq 3,$ so we can compute this directly from the power series:
$$\sin J=\cos K=I-\frac{1}{2}K^2$$
This solution uses the angle-sum formula brought up in the comments, which again is implied by $\exp(A+B)=\exp A\exp B\ $  when $A$ and $B$ commute.
A: No, this is a so called Jordan block, and not much more can be done in its decomposition.
Let $A=\begin{bmatrix} 0&0&0\\1&0&0\\0&1&0 \end{bmatrix}$, and say, we have a matrix $J= A+\alpha\cdot I$. Denote the elements of the standard basis in $\mathbb R^3$ by $e_1,e_2,e_3$. Since $A$ takes $e_1\mapsto e_2$, $e_2\mapsto e_3$, $e_3\mapsto 0$, we have $A^2=\begin{bmatrix} 0&0&0\\0&0&0\\1&0&0 \end{bmatrix}$ and already $A^3=0$.
Hence, $J^2 = A^2+2\alpha A+\alpha^2 I$, $\ J^3=3\alpha A^2+3\alpha^2 A+\alpha^3 I$, and find similarly $J^n$ by the binomial theorem.
Then, substituting it in a power series we will practically get 3 distinct power series for the diagonal lanes (with coefficients of $A^2$, $A$ and $I$). Anyway, at the part 'Functions of matrices' of the wikipage, the result is described, and $f(J)$ will also contain elements related to $f'(\alpha)$ and $f''(\alpha)$. [Now $\alpha=\frac\pi2$ and $f=\sin$.]
