Let $A $ and $B$ be real symmetric matrices of order $n$, satisfying $A^2B=ABA.$ Proof that $AB=BA.$ Let $A $ and $B$ be real symmetric matrices of order $n$, satisfying $A^2B=ABA.$ Proof that $AB=BA.$
I only find that $A^2B=BA^2=ABA.$ Then I don't know what to do next.Can you help me solve this puzzle?
 A: If $A$ is invertible or $A=0$ then it is obvious. Assume now that $A\ne 0$ and $\det A=0$.
$A$ is symmetric and hence diagonalizabe by an orthnormal matrix $U$. Set $A=U^{-1}LU$, where$L$ is diagonal. Expressing $L$ and $\hat B=UBU^{-1}$ (which is also symmetric) in block form,
$$
L=\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right),\qquad
UBU^{-1}=\left(
\begin{array}{cc}B_1 & B_2 \\ B_3 & B_4\end{array}
\right)=\hat B,
$$
where $D$ is diagonal and invertible, we have
$$
U^{-1}L^2\hat B U=U^{-1}L^2UB=A^2B=ABA=U^{-1}LUBU^{-1}LU=U^{-1}L\hat BLU
$$
or
$$
L^2\hat B=L\hat BL
$$
or
$$
\left(
\begin{array}{cc}D^2 & 0 \\ 0 & 0\end{array}
\right)\left(
\begin{array}{cc}B_1 & B_2 \\ B_3 & B_4\end{array}
\right)=\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)\left(
\begin{array}{cc}B_1 & B_2 \\ B_3 & B_4\end{array}
\right)\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)
$$
or
$$
\left(
\begin{array}{cc}D^2B_1 & D^2B_2 \\ 0 & 0\end{array}
\right)=\left(
\begin{array}{cc}DB_1D & 0 \\ 0 & 0\end{array}
\right).
$$
Hence $B_2=0$ and $DB_1=B_1D$, and also $B_3=B_1^T=0$, in which case
$$
BA=U^{-1}\hat BUU^{-1}\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)U=
U^{-1}\hat B\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)U=U^{-1}\left(
\begin{array}{cc}B_1 & 0 \\ 0 & B_4\end{array}
\right)\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)U=U^{-1}\left(
\begin{array}{cc}B_1D & 0 \\ 0 & 0\end{array}
\right)U=U^{-1}\left(
\begin{array}{cc}DB_1 & 0 \\ 0 & 0\end{array}
\right)U=U^{-1}\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)\left(
\begin{array}{cc}B_1 & 0 \\ 0 & B_4\end{array}
\right)U=U^{-1}\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)\hat BU=U^{-1}\left(
\begin{array}{cc}D & 0 \\ 0 & 0\end{array}
\right)UBU^{-1}U=AB
$$
A: Since $A^{2}B=ABA$ and both these matrices are symmetric, we obtain $A^{2}B=BA^{2}$.
Multiply by $A$ on both sides to obtain $BA^{3}=A^{3}B$ (Using the relation $ABA=A^{2}B$).
Carrying this process out repeatedly, we see that $A^{n}B=BA^{n} \forall n \geq 2$.
Using Cayley-Hamilton, we see that the characteristic polynomial kills $A$, i.e. $p(A)=0$. So, now we can write $A$ as a linear combination of $I$ and $A^{n}$ for $n \geq 2$. Using the fact we proved above, we're done.
