- AB and BA both are defined.
Soluton:
Given: $\text{A} = \begin{bmatrix}2& -1 &3\\-4 & 5 & 1 \end{bmatrix} \ \text{B} = \begin{bmatrix}2& 3\\4 & -2 \\1 & 5 \end{bmatrix}$
$\text{AB} = \begin{bmatrix}2& -1 &3\\-4 & 5 & 1 \end{bmatrix} \begin{bmatrix}2& 3 \\4 & -2 \\1 & 5 \end{bmatrix}$
$ \begin{bmatrix}3 & 23\\13 & -17 \end{bmatrix}$
So, AB is defined as of columns in A is equal to number of rows in B.
$\text{BA} = \begin{bmatrix}2&3\\4 &-2\\1 & 5 \end{bmatrix} \begin{bmatrix}2& -1 &3\\-4 & 5 & 1 \end{bmatrix}$
$ = \begin{bmatrix}-8& 13 &9\\16 & -14 & 10\\-18 & 24 & 8 \end{bmatrix}$
So, BA is also defined of columns in B is equal to number of rows in A.