Symmetric product criterion for symmetric matrices (source code)

= Symmetric product criterion for symmetric matrices
{title2=$(AB)^T=AB\iff AB=BA$}

If $A^T=A$ and $B^T=B$, then $(AB)^T=B^TA^T=BA$. Hence their product is a <symmetric matrix> exactly when they commute. For example, $A=\operatorname{diag}(1,0)$ and $B=\begin{pmatrix}0&1\\1&0\end{pmatrix}$ are symmetric but have nonsymmetric product $\begin{pmatrix}0&1\\0&0\end{pmatrix}$. This criterion differs from asking whether an arbitrary matrix can be factored as a <product of symmetric matrices>.