Answer
a. $AB=\left[\begin{array}{ll}
0 & 16\\
12 & 8
\end{array}\right]$
b. $BA=\left[\begin{array}{ll}
-7 & 3\\
29 & 15
\end{array}\right]$
Work Step by Step
The product of an $m\times\underline{n}$ matrix $A$ and an $\underline{n}\times p$ matrix $B$ is an $m\times p$ matrix $AB$.
The element in the ith row and $j\mathrm{t}\mathrm{h}$ column of $AB$ is found by
multiplying each element in the
ith row of $A$ by the corresponding element in the $j\mathrm{t}\mathrm{h}$ column of $B$
and adding the products.
-----------------
a.
$A$ is a $2\times\underline{2}$ matrix, B is a $\underline{2}\times 2$ matrix
$AB$ exists, and is a 2$\times$2 matrix.
$AB=\left[\begin{array}{ll}
1(3)+3(-1) & 1(-2)+3(6)\\
5(3)+3(-1) & 5(-2)+3(6)
\end{array}\right]=\left[\begin{array}{ll}
0 & 16\\
12 & 8
\end{array}\right]$
b.
$B$ is a $2\times\underline{2}$ matrix, $A$ is a $\underline{2}\times 2$ matrix
$BA$ exists, and is a 2$\times$2 matrix.
$BA=\left[\begin{array}{ll}
3(1)+(-2)(5) & 3(3)+(-2)(3)\\
-1(1)+6(5) & -1(3)+6(3)
\end{array}\right]=\left[\begin{array}{ll}
-7 & 3\\
29 & 15
\end{array}\right]$