Order Polynomial of Matrix Commutative Property Given a matrix $A$ and a polynomial $P$ as its linear factors $$\prod_{i=1}^{n}(\lambda_i-x)$$
For $P(A)$, does it matter in which order the linear factors are multiplied, seeing as matrix multiplication is generally not commutative? Two polynomials with the same linear factors should yield the same result, shouldn't they?
 A: No and yes.  No, the order of factors doesn't matter, and yes, the matrix $A$ commutes with itself, and with the $\lambda_k I$, so again, the product of the linear factors yields the same result.
For example, we might consider
$(A - \lambda_i I)(A - \lambda_j I) = A(A - \lambda_j I) - \lambda_i I(A - \lambda_j I)$
$= A^2 - \lambda_j A - \lambda_i A + \lambda_i \lambda_j I = A^2 - (\lambda_j + \lambda_i)A + \lambda_i \lambda_j I\tag 1$
and
$(A - \lambda_j I)(A - \lambda_i I) = A(A - \lambda_i I) - \lambda_j I(A - \lambda_i I)$
$= A^2 - \lambda_i A - \lambda_j A + \lambda_j \lambda_i I = A^2 - (\lambda_i + \lambda_j)A + \lambda_j \lambda_i I; \tag 2$
since $\lambda_i$ and $\lambda_j$ are scalar quantities, we have
$\lambda_i + \lambda_j = \lambda_j + \lambda_i \tag 3$
and
$\lambda_i \lambda_j = \lambda_j \lambda_i; \tag 4$
thus
$A^2 - (\lambda_j + \lambda_i)A + \lambda_i \lambda_j =  A^2 - (\lambda_i + \lambda_j)A + \lambda_j \lambda_i I, \tag 5$
and hence
$(A - \lambda_i I)(A - \lambda_j I) = (A - \lambda_j I)(A - \lambda_i I). \tag 6$
