A^3 - 5 A + 4 IdentityMatrix[2] at {A -> DiagonalMatrix[{2, -1}]}