Why in these matrices are $AB=BA$ not equal? What is the logic behind them? We know that in matrices AB=BA.Why in this Matrices $A=\begin{bmatrix} -1 & 3\\
 2 & 0\end{bmatrix}$, $B=\begin{bmatrix} 1 & 2\\
-3 & -5\end{bmatrix}$ are not equal to $AB=BA$. WHY? This is matrix  of order $2\times 2$ for both $A$ and $B$.
 A: It simply isn't true that $AB = BA$, except in very special cases, such as if both $A$ and $B$ are diagonal.
For instance, for general $2\times 2$ matrices $A = \left[\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\right]$ and $B = \left[\begin{smallmatrix}r&s\\t&u\end{smallmatrix}\right]$ we have
$$
AB = \begin{bmatrix}ar + bt & as + bu\\cr + dt & cs + du\end{bmatrix}
$$
while
$$
BA = \begin{bmatrix}ar + cs & br + ds\\at + cu & bt + du\end{bmatrix}
$$
and you can clearly see that there are loads of choices for $a, b, c, d, r, s, t, u$ that makes these two matrices different.
A: Consider what matrices "do". 
For example: the matrix
$$
A := \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}
$$
stretches the $x$-axis by a factor of two, and the matrix
$$
B := \frac{1}{\sqrt{2}} \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}
$$
rotates everything $90^\circ$ anti-clockwise.
Thus 
$$
B A \begin{pmatrix} 1 \\ 0 \end{pmatrix}
$$
first stretches the $x$ component of the vector $(1, 0)^T$ then rotates,
whereas
$$
A B \begin{pmatrix} 1 \\ 0 \end{pmatrix}
$$
first rotates and then stretches the $x$ component.
You can convince yourself that the resulting point is not the same in the two cases. This means that $B A \neq A B$.
A: Matrix multiplication is generally not commutative unless they're both equal or they're inverses (in which case you will obtain the identity).
A: You can think of matrices as linear transformations.  For example, let $T$ be the map which rotates a point ninety degrees counterclockwise.  It is the function from the plane $\mathbb{R}^2$ to itself given by the formula $(x,y) \mapsto (-y,x)$.  It is represented by the matrix $$A  =\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$
in the sense that if you want to compute what $T$ does to a point $v = (x,y)$, just compute the matrix product $Av^{\textrm{tr}}$, where here $v^{\textrm{tr}}$ means $\begin{pmatrix} x \\ y \end{pmatrix}$.  
On the other hand, consider the function $S$ which takes a point $(x,y)$ and reflects it across the $x$-axis, giving you the point $(x,-y)$.  It is represented by the matrix $$B = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$ Under the interpretation of matrices as functions from the plane to itself, the composition $T \circ S$ (that is, $S$ followed by $T$) corresponds to the matrix product $AB$, and $S \circ T$ corresponds to the matrix product $BA$.
But it is intuitively obvious that $T \circ S$ and $S \circ T$ are not the same function: rotating a point ninety degrees counterclockwise, and then reflecting it across the $x$-axis, usually does not do the same thing as first reflecting the point across the $x$-axis, and then rotating it ninety degrees.  Since $T \circ S \neq S \circ T$, we cannot expect to have $AB = BA$, and you can indeed check that these matrices are not equal.
