Need help for the restricted commutative law of matrix multiplication proof I know that there is no general commutative law for matrix multiplication. I am reading a book on Linear Algebra right now, and at some point it says that:
If A is a SQUARE matrix and if p and q are polynomials, then $$p(A)q(A)=q(A)p(A)$$
I understand the rule, yet I am not sure how to prove it. Is it by showing that the (s,t) entry of $p(A)q(A)$ = (s,t) entry of $q(A)p(A)$? 
 A: First notice that for all $n,m \in \mathbb{N}$ you have
$$
 A^n A^m = A^{n+m} = A^{m+n} = A^m A^n.
$$
If $p(t) = \sum_{i=0}^n a_i t^i$ and $q(t) = \sum_{j=0}^m b_j t^j$ it now follows from the distributivity of the matrix multiplication that
\begin{align*}
 p(A) q(A)
 &= \left( \sum_{i=0}^n a_i A^i \right) \left( \sum_{j=0}^m b_j A^j \right)
 = \sum_{i=0}^n \sum_{j=0}^m a_i b_j A^i A^j
 = \sum_{i=0}^n \sum_{j=0}^m a_i b_j A^j A^i \\
 &=  \sum_{j=0}^m \sum_{i=0}^n b_j a_i A^j A^i
 = \left( \sum_{j=0}^m b_j A^j \right) \left( \sum_{i=0}^n a_i A^i \right)
 = q(A) p(A).
\end{align*}
PS: Notice that the idea behind this is to use the distributivity
$$
 (A + B) C = AC + BC
 \quad\text{and}\quad
 A (B+C) = AB + AC
$$
and the compatibility with scalars
$$
 (\lambda A)B = \lambda (AB) = A(\lambda B)
$$
to reduce the statement about polynomials in $A$ to the statement about monomials in $A$. The above two properties together are referred to as the bilinearity of the matrix product.
You can now also use the same idea to show that $p(A)q(B) = q(B)p(A)$ for all commuting square matrices $A$ and $B$ and polynomials $p$ and $q$.
