# Multiplying Matrices

## Multiplying Matrices - How it Works - Video

### Example 1 - Step 1 - Part 1

Example 1 - Step 1:

Here we multiply the first row of the first matrix and the first column in the second matrix. The resultant element will be in the first row and first column of the resultant matrix.

So we multiply (-1) x 1 and 3 x (-4).

### Example 1 - Step 2 - Part 1

Example 1 - Step 2 - Part 1:

Here we multiply the first row of the first matrix and the second column in the second matrix. The resultant element will be in the first row and second column of the resultant matrix.

So we multiply (-1) x (-2) and 3 x 0.

### Example 1 - Step 3 - Part 1

Example 1 - Step 3 - Part 1:

Here we multiply the second row of the first matrix and the first column in the second matrix. The resultant element will be in the second row and first column of the resultant matrix.

So we multiply 7 x 1 and (-2) x (-4).

### Example 1 - Step 4 - Part 1

Example 1 - Step 4 - Part 1:

Here we multiply the first row of the first matrix and the first column in the second matrix. The resultant element will be in the first row and first column of the resultant matrix.

So we multiply 7 x (-2) and (-2) x 0.

### Example 1 - Step 1 - Part 2

Example 1 - Step 1 - Part 2:

Here we multiply the first row of the first matrix and the first column in the second matrix. The resultant element will be in the first row and first column of the resultant matrix.

So we multiply (-1) x 1 and 3 x (-4).

Now we simplify.

(-1) x 1 ==> -1

3 x (-4) ==> -12

Now we add (-1) and (-12) ==> -13, which will be C1,1.

### Example 1 - Step 2 - Part 2

Example 1 - Step 2 - Part 2:

Here we multiply the first row of the first matrix and the second column in the second matrix. The resultant element will be in the first row and second column of the resultant matrix.

So we multiply (-1) x (-2) and 3 x 0.

Now we simplify.

(-1) x (-2) ==> 2

3 x 0 ==> 0

Now we add 2 and 0 ==> 2, which will be C1,2.

### Example 1 - Step 3 - Part 2

Example 1 - Step 3 - Part 2:

Here we multiply the second row of the first matrix and the first column in the second matrix. The resultant element will be in the second row and first column of the resultant matrix.

So we multiply 7 x 1 and (-2) x (-4).

Now we simplify.

7 x 1 ==> 7

(-2) x (-4) ==> 8

Now we add 7 and 8 ==> 15, which will be C2,1.

### Example 1 - Step 4 - Part 2

Example 1 - Step 4 - Part 2:

Here we multiply the first row of the first matrix and the first column in the second matrix. The resultant element will be in the first row and first column of the resultant matrix.

So we multiply 7 x (-2) and (-2) x 0.

Now we simplify.

7 x (-2) ==> -14

(-2) x 0 ==> 0

Now we add -14 and 0 ==> -14, which will be C2,2.

Now we have our final answer -13 and 2 in the first row and 15 and -14 in the second row.

### Example 2

Example 2:

Here in this example it is not possible to multiply the matrices.

Let's take a look at the image on the left. When we multiply the first row of the first matrix and the second row of the second matrix, there is not enough corresponding elements. In matrix A in row 1 there is only one element and in matrix B in column in 2 there are 2 elements. So we have a1,1 * b1,2 and ? * b2,2. There isn't an element for b2,2 to multiply.

Now let's take a look at the image on the right. That is why we can just look at the last dimension of the first matrix and the first dimension of the second matrix to tell if we can multiply two matrices.