Solve for $f(A)$ when:
$f(x) = 2 - 5x + x^2$
$$A = \begin{bmatrix}2 & 0\\4 & 5\end{bmatrix}$$ I can get \begin{bmatrix}-10 & 0\\-20 & -25\end{bmatrix} for $-5A$ and \begin{bmatrix}4 & 0\\28 & 25\end{bmatrix} for $A^2$ but after that I don't know what to do with \begin{bmatrix}-6 & 0\\8 & 0\end{bmatrix} because I also have to add $2$ to it? Do I just add $2$ to each entry? The answer is written in the book as \begin{bmatrix}-4 & 0\\8 & 2\end{bmatrix}
Did I make a mistake somewhere?
Hint:
it is $f(A)=A^2-5A+2I_2$