matrices such that $A^2B+BA^2=2ABA$ Let be $A$, $B$ two matrices $3 \times 3$ with complex entries.
Prove that if $$A^2B+BA^2=2ABA$$
THEN
$$B^2A+AB^2=2BAB$$
I tried it and do not know how to continue.
If $A$ is invertible then
$$AB^2+A^{-1}BA^2B=2BAB$$
so I have to prove that
$$B^2A=A^{-1}BA^2B$$
How to continue and also have to discuss the case when $A$ is not invertible
 A: The statement in question is equivalent to $[A,[A,B]]=0\rightarrow[[A,B],B]=0$ and it is false. Here is a counterexample taken from the last section of Irving Kaplansky, Jacobson's Lemma Revisited, Journal of Algebra, 62, 473-476 (1980):
\begin{aligned}
A&=\pmatrix{1&1&0\\ 0&1&0\\ 0&0&1},\quad B=\pmatrix{0&0&0\\ 0&0&1\\ 1&0&0},\\
[A,B]&=\pmatrix{1&1&0\\ 0&1&0\\ 0&0&1}\pmatrix{0&0&0\\ 0&0&1\\ 1&0&0}-\pmatrix{0&0&0\\ 0&0&1\\ 1&0&0}\pmatrix{1&1&0\\ 0&1&0\\ 0&0&1}\\
&=\pmatrix{0&0&1\\ 0&0&1\\ 1&0&0}-\pmatrix{0&0&0\\ 0&0&1\\ 1&1&0}
=\pmatrix{0&0&1\\ 0&0&0\\ 0&-1&0},\\
[A,[A,B]]&=A[A,B]-[A,B]A=[A,B]-[A,B]=0,\\
[[A,B],B]&=\pmatrix{0&0&1\\ 0&0&0\\ 0&-1&0}\pmatrix{0&0&0\\ 0&0&1\\ 1&0&0}-\pmatrix{0&0&0\\ 0&0&1\\ 1&0&0}\pmatrix{0&0&1\\ 0&0&0\\ 0&-1&0}\\
&=\pmatrix{1&0&0\\ 0&0&0\\ 0&0&-1}-\pmatrix{0&0&0\\ 0&-1&0\\ 0&0&1}
=\pmatrix{1&0&0\\ 0&1&0\\ 0&0&-2}\ne0.
\end{aligned}
A: If $A$ and $B$ commute, the result is immediate.
Note that $(A+B)^3 = A^3 + (A^2B + BA^2) + ABA + (B^2A + AB^2) + BAB + B^3$.
If the result holds, that turns into $(A+B)^3 = A^3 + A^2B + AB^2 + B^3$.  This suggests that $A$ and $B$ might have to commute for the given to hold.
If $A$ and $B$ do not commute, let $AB-BA = C$.
Rewrite that as $BA = AB - C$ and as $AB = BA + C$.
Plugging in, we get
$$B^2A = B(AB-C) = BAB-BC$$and
$$AB^2 = (C+BA)B = CB + BAB$$
so
$$B^2A + A^2B = 2BAB - BC + CB$$ without even using the given.  Turning to that, we get
$$A^2B + BA^2 = 2ABA + AC-CA$$ by the same reasoning.
This implies $AC-CA = 0$.  So now our goal is to get from $AC=CA to BC=CB.$. But according to the other answer by @user1551, the claim isn't true in the first place!
A: We'll work with commutators, $[X,\,Y]:=XY-YX$. Given $[A,\,[A,\,B]]=O$, we want to prove $[[A,\,B],\,B]=O$. Since $A,\,[A,\,B]$ are simultaneously diagonalisable, we need only show any base diagonalising both - we'll work hereafter in such a base - also diagonalises $B$. The easiest case is one in which $A$ has no repeated eigenvalues: if $i\ne j$,$$0=[A,\,B]_{ij}=(\underbrace{A_{ii}-A_{jj})}_{\ne0}B_{ij}\implies B_{ij}=0.$$The general case follows by such "nondegenerate" $A$ being dense in $\Bbb C^{3\times3}$.
