Left and right multiplying of matrices I am new to matrix multiplication and trying to understand something. Suppose you have a matrix equation $ A x=b $. I know to solve for $x$ you should left multiply by the inverse of A. But what is the reason you can't solve for $b$ like this: $ A A^{-1} x=b A^{-1} $ so that  $ x=b A^{-1} $? 
I tried with an example to see that it doesn't work but I don't have a good understanding of the mechanics why not.
What if you had something like this instead:
$ A x = By $
could you solve like this?
$ AA^{-1} x = BA^{-1}y $
and then get the solution 
$  x = BA^{-1}y $
or do you have to solve like this
$ A^{-1}A x = A^{-1}By $
to get the solution
$  x = A^{-1}By $

Your second explanation is the right one. When multiypling with matricies you have to think of multipling from left $A^{-1} \cdot$ or from the right $ \cdot A^{-1}$. In your first calculation you multiplied from the right $Ax\cdot A^{-1} = By \cdot A^{-1}$. This would not solve your problem, as you cant use commutativity on matricies like $AB\neq BA$. 
