# Characterization of matrices such that $AX=XA^T$

Let $A \in \mathbb{R}^{n \times n}$. Is $A=aI$, where $a \in \mathbb{R}$, the only class of matrices such that $$AX=XA^T,\quad \forall X\in\mathbb{R}^{n \times n},~X\text{ symmetric}?$$

• With $X=I$ you obtain $A^T=A$. Then the condition rewrites as $\forall X \in \mathbb{R}^{n \times n}$ symmetric: $$A X=X A$$ You can then use that any matrix is the product of two symmetric matrices to conclude but there is probably a simpler way. Apr 14 '18 at 11:33

To explain with more precision my answer:

Taking $X=I$ the problem becomes the following:

What can be said of $A$ if $AX=XA$ for all symmetric matrix $X$ ?

For any symmetric matrices $X_1$ and $X_2$ you have: $$A(X_1 X_2)= X_1 A X_2=(X_1 X_2) A$$ But for any $B \in \mathbb{R}^{n \times n}$ there exists $X_1, X_2$ symmetric matrices such that $B=X_1 X_2$ (see for example here).

So $AB=BA$ for all $B \in \mathbb{R}^{n \times n}$ and then $A= a I$.

Put $X=I$, we see that $A$ is symmetric. Put $X=vv^T$ for some $v\ne0$, we see that $(Av)v^T=vv^TA=vv^TA^T=v(Av)^T$. Hence $Av$ is a scalar multiple of $v$. That is, $A$ is a matrix such that every nonzero vector is its eigenvector. In general, the only matrices (symmetric or not) with this property are the scalar matrices.

• Clear and concise. But how did you know what matrices to choose for testing ? Apr 14 '18 at 14:21
• @Widawensen Rank-1 symmetric matrices span the set of all symmetric matrices, so it's natural to ask what happens if $X=vv^T$. Apr 14 '18 at 14:29
• Good to know, thank you for the explanation... Apr 14 '18 at 14:39

As @Delta-u said, with $X=I_n$, you get $A=A^T$. By the spectral theorem, there is an orthogonal matrix $P$ and a diagonal matrix $D$ such that $P^TDP=A$.

Making the change of variables $Y=P^TXP$, we see that $D$ must commute with any symmetric matrix $Y$. Write $D=diag (d_1,\ldots, d_n)$. Assume that $D$ has two different entries. Conjugating by a suitable transposition matrix (which is orthogonal), we may assume that $d_1\neq d_2$ without any loss of generality.

Then the block diagonal symmetric matrix $Y=\begin{pmatrix}0 & 1 & \cr 1 & 0 & \cr & & I_{n-2}\end{pmatrix}$ does not commute to $D$, hence a contradiction. Therefore, $D=d I_n$. Now $A=dP^TP=dI_n$ since $P$ is orthogonal.