Direct proof : $A.B=xA+yB+zI_2 \implies B.A=x'A+y'B+z'I_2 $ 
Let $A,B\in M_2(\mathbb R)$. Assume there exist  $(x,y,z)\in \mathbb R^3$ such that $A.B=xA+yB+zI_2$.
Show that there exist  $(x',y',z') \in \mathbb R^3$ such that $B.A=x'A+y'B+z'I_2$

My attempt:
We have, $$AB=xA+yB+zI \iff (A-yI)(B-xI)=(yx+z)I$$
Then if $yx+z=0$, I can write out the matrix explicitly and solve the corresponding system ( a bit 'long')

*

*If $yx+z\ne 0$
Then,$\quad(B-xI)(A-yI)=(yx-z)I$
Thus, $BA\in lin(A,B,I)$
So I think I have proved this exercise,
Question: Can I do this exercice directly ? Without calculus perhaps ?
 A: Note that by Cayley–Hamilton theorem, for every $M\in M_n(\Bbb R)$, $M$ can be written as a linear combination of $I, M,\cdots, M^{n-1}$. In particular, when $n=2$, we always have 
$$M^2=({\rm tr}M)\cdot M-(\det M)\cdot I.\tag{1}$$
Now given $A,B\in M_2(\Bbb R)$, note that
$$AB+BA= (A+ B)^2 -A^2-B^2.\tag{2}$$
Combining $(1)$ and $(2)$, we can conclude that $AB+BA$ can be written as a linear combination of $A$, $B$ and $I$, which implies your statement.
A: The condition $AB=xA+yB+zI$ implies that $(A-yI)(B-xI)=(xy+z)I$. If $\newcommand{\rank}{\text{rank}}\rank(A-yI)\in\{0,2\}$ or $\rank(B-xI)\in\{0,2\}$, clearly $BA$ is a linear combination of $A,B,I$.
So it remains to consider the case where $\rank(A-yI)=\rank(B-xI)=1$. Let $M=A-yI$ and $N=B-xI$. Then the condition $(A-yI)(B-xI)=(xy+z)I$ implies that $MN=0$. Now, the statement that $BA$ is a linear combination of $A,B,I$ is equivalent to the statement that $NM$ is a linear combination of $N,M,I$.
Suppose the statement is false. Then $NM,N,M,I$ spans $M_2(\mathbb R)$. Since $N$ has rank 1, it follows that the span of $NMN,N^2,MN,N$ is a 2-dimensional matrix space. However, as $MN=0$, the span of $NMN,N^2,MN,N$ is actually the span of $N^2,N$, which is one-dimensional because $\rank(N)=1$. So we arrive at a contradiction and we conclude that $NM$ lies in the span of $N,M,I$.
