Solution (source code)

= Solution

The <vectors> $(1,0,1)^T,(0,1,0)^T,(1,0,-1)^T$ are <eigenvectors> of $B$ with <eigenvalues> $2,1,0$. Applying the exponential to these eigenspaces gives
$$
e^B=\begin{pmatrix}(1+e^2)/2&0&(e^2-1)/2\\0&e&0\\(e^2-1)/2&0&(1+e^2)/2\end{pmatrix}.
$$