Matrix Exponent I know that the exponential function for an $n\times n$ non-degenerate square matrix $A$ is:
$$e^{At}=S \operatorname{diag}(e^{\lambda_1t},\dots,e^{\lambda_nt}) \space S^{-1}, $$
where $S$ is the eigenvector matrix and $\lambda_i$ are its eigenvalues.
What is $e^{A}$? Is it
$$e^{A}=S \operatorname{diag}(e^{\lambda_1},\dots,e^{\lambda_n}) \space S^{-1}?$$
Also, what is $\cos(A)$?
 A: With the greatest possible generality, if $A$ is a square matrix and $p(x) = \sum_{k=0}^n a_k x^k$ is a polynomial, then you can define
$$
 p(A) := \sum_{k=0}^n a_k A^k, \quad A^0 := I.
$$
More generally, if $f(x)$ is an analytic function whose Taylor series $f(x) = \sum_{k=0}^\infty a_k x^k$ has radius of convergence $R > \|A\|$, where $\|A\|$ denotes the operator norm of $A$, then you can define
$$
 p(A) := \sum_{k=0}^\infty a_k A^k,
$$
with convergence in the operator norm, and hence, in particular, entry-wise convergence. Thus, since
$$
 e^x = \sum_{k=0}^\infty \frac{1}{k!} x^k, \quad \cos x = \sum_{k=0}^\infty \frac{(-1)^k}{(2k)!}x^{2k}
$$
with infinite radii of convergence, you can, in complete generality, write
$$
 e^A := \sum_{k=0}^\infty \frac{1}{k!}A^k, \quad \cos A = \sum_{k=0}^\infty \frac{(-1)^k}{(2k)!}A^{2k}.
$$
Now, something very nice happens when $A$ is diagonalisable, i.e., when
$$
 A = S \operatorname{diag}(\lambda_1,\dotsc,\lambda_n)S^{-1}
$$
for $S$ invertible and $\lambda_k$ the eigenvalues of $A$. Then, one can check—and you do need to check this on partial sums—that for $f(x) = \sum_{k=0}^\infty a_k x^k$ analytic with sufficiently large radius of convergence,
$$
 f(A) = \sum_{k=0}^\infty a_k A^k = \sum_{k=0}^\infty a_k (S \operatorname{diag}(\lambda_1,\dotsc,\lambda_n)S^{-1})^k\\ = \sum_{k=0}^\infty a_k S \operatorname{diag}(\lambda_1^k,\dotsc,\lambda_n^k)S^{-1}\\ = S \operatorname{diag}\left(\sum_{k=0}^\infty a_k \lambda_1^k,\dotsc, \sum_{k=0}^\infty a_k \lambda_n^k\right) S^{-1}\\ = S\operatorname{diag}(f(\lambda_1),\dotsc,f(\lambda_n))S^{-1}.
$$
Indeed, this motivates, in particular, the definition of $f(A)$ for $f(x)$ arbitrary as
$$
 f(A) := S\operatorname{diag}(f(\lambda_1),\dotsc,f(\lambda_n))S^{-1},
$$
which turns out to be independent of the choice of diagonalisation—this is a baby example of what functional analysts call a functional calculus. Hence, in your case,
$$
 e^A = S\operatorname{diag}(e^{\lambda_1},\dotsc,e^{\lambda_n})S^{-1}, \quad \cos A = S \operatorname{diag}(\cos \lambda_1,\dotsc,\cos \lambda_n)S^{-1}.
$$
