Matrix and a Linear Function I'm a student of electrical engineering. At our math class we were given following assignment: given a matrix 
$A = \begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}$ and a function $f(x) = x^5 - x^3 + 5x^2 + 8$, compute $f(A)$.
I've checked out this PDF document, but I don't think I understand it properly. I have tried by assuming that first element (let me denote it as $a_{11}$) should equal $$a_{11}=1^5-1^3+5\cdot 1+8=13$$ and second element $a_{12}$ should consequently equal $$a_{12} = 0 + 0+ 0 + 8=8$$
As it turns out (according to professor's solutions), $a_{11}$ really is $13$, but $a_{12}$ is zero. Final solution should be $$f(A) = \begin{pmatrix}
13 & 0 & 24 \\ 0 & 13 & 0 \\ 0 & 0 & 13
\end{pmatrix}$$
Now, I know that this site is not meant for students to ask questions and anticipate full solution to their problems, so instead I'm just asking for a guideline. Can somebody please give me any hint on how to solve this task?

I claim that 
$$A^n = \begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}^n=\begin{pmatrix}
1 & 0 & 2n\\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}.\tag 1$$
By the principle of mathematical induction, first, for $n=2$
$$A^2 = \begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}^2=\begin{pmatrix}
1 & 0 & 4 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}$$
then assuming that 
$$A^{n-1}= \begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}^{n-1}=\begin{pmatrix}
1 & 0 & 2(n-1) \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}$$
we have
$$A^n=A^{n-1}A =$$
$$= \begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}^{n-1}\begin{pmatrix}
1 & 0 & 2 \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}=$$
$$=\begin{pmatrix}
1 & 0 & 2(n-1) \\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}\begin{pmatrix}
1 & 0 & 2\\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}=\begin{pmatrix}
1 & 0 & 2n\\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}.$$

So, $(1)$ is true. Then
$$A^5 =\begin{pmatrix}
1 & 0 & 10\\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix},A^3 =\begin{pmatrix}
1 & 0 & 6\\ 0 & 1 & 0 \\ 0 & 0 & 1
\end{pmatrix}, 5A^2 =\begin{pmatrix}
5 & 0 & 20\\ 0 & 5 & 0 \\ 0 & 0 & 5\end{pmatrix}.  $$
Finally,
$$f(A) = A^5 - A^3 + 5A^2 + 8I=$$
$$=\begin{pmatrix}
13 & 0 & 24\\ 0 & 13 & 0 \\ 0 & 0 & 13\end{pmatrix}.$$
