TITLE: Do two symmetric matrix of the same size commute?
QUESTION [7 upvotes]: If i have two symmetric matrix A and B of the same size, do A and B commute?
If not, what is a counter example?
This is related to a problem in my intro to linear alg class.
Thanks.

REPLY [21 votes]: $$\begin{bmatrix}1&1\\1&1\end{bmatrix}\begin{bmatrix}1&0\\0&2\end{bmatrix}=\begin{bmatrix}1&2\\1&2\end{bmatrix}$$
$$\begin{bmatrix}1&0\\0&2\end{bmatrix}\begin{bmatrix}1&1\\1&1\end{bmatrix}=\begin{bmatrix}1&1\\2&2\end{bmatrix}$$

REPLY [4 votes]: If $ A = \left( \begin{array}{cc}
a & b \\
b & c\\
\end{array} \right) $
and $ B = 
\left( \begin{array}{cc}
x & y \\
y & z\\
\end{array} \right) $
then $AB = \left( \begin{array}{cc}
ax+by & ay+bz \\
bx+cy & by+cz\\
\end{array} \right) $
so $BA = \left( \begin{array}{cc}
ax + by & bx + cy\\
ay + bz & by + cz\\
\end{array} \right)$.
So, as an example, try taking $A$ with $b=c=0$.