The multiplication of matrices means rows of matrix is multiplied to columns of to obtain a third matrix . We also evaluate the matrix multiplication with respect to fundamental properties of mathematics such as commutative, associative property, identity property.

Contents

### Conditions for Matrix Multiplication

If and are two matrices with sizes and respectively. The following conditions apply to matrix multiplication,

- Row or column of matrix must be equal to column or row of matrix .
- Multiplying matrix to matrix is not same as multiplying matrix i.e., .
- If condition 2 and 3 are true, then we can multiply 2 or more matrices.

### Matrix Multiplication

Let and be two matrices with elements. Then the matrix multiplication can be done as follows.

```
```

In the above example, has size where and has size where the resultant matrix has size of which is .

Now, we consider the second case, where we multiply to .

```
```

### Matrix Multiplication Examples

In this section, we will show you few examples with different kinds of matrices.

**Example #1 **

```
// Multiplying Square Matrix
```

The size of matrix is where and size of matrix is also where . Therefore, resultant matrix after multiplication has a size of where . In other words, .

**Example #2**

```
```

The size of the matrix is where and the size of the matrix is where . Therefore, the resultant matrix has a size of which is .

**Example #3**

```
```

The matrix has a size of where and matrix B&s=1$ has a size of where . The size of resultant matrix is which is .

### Properties of Matrix Multiplication

Since, matrix operation is mathematical operations, therefore, matrix multiplication must preserve all or some of the properties with respect to multiplication operator.

**Commutative Law**

Suppose we multiply two matrix and ,

```
Similarly,
BA =
```

From the example above, it is clear that the product of is not equal to the product of . Hence, the commutative law does not work in the case of matrix multiplication.

**Associative Law of Matrix Multiplication**

The associative law in matrix multiplication involves more than two matrices in following ways.

```
Let A, B, and C be three matrices that meet the conditions of matrix multiplication.Then,
```

We can test the above property with the help of an example. Let and be 3 square matrices of size .

```
Similarly,
Therefore,
```

The above example, both side of the equation gives same results. Thus, the associative law is true for matrix multiplication.

In mathematics, an identity element is a value when added element ‘a’ will give ‘a’ itself. We know that identity of addition is 0.

```
For multiplication,
```

Since, 1 is the identity element of multiplication, we need a matrix with main diagonals as 1s, such a matrix is called an identity matrix or unit matrix denoted by where is the size . Therefore, identity matix is a square matrix.

```
Let A be a square matrix of size 2 x 2 and I be identity matrix of size 2 x 2. Then
```

The unit matrix when multiplied with matrix gives the same matrix as result. Therefore, identity law is true for matrix multiplication.

**Commutative Property For Identity Law**

We mentioned ealier that the commutative property does not apply for matrix multiplication. However, in the case of multiplying a matrix with an indentity matrix , the commutative property is true.

For example, let us take previous example where we found following results.

We must find to verify our claim that the commutative law does work when multiplied with an identity matrix.

```
Let A be a square matrix of size 2 x 2 and I be identity matrix of size 2 x 2. Then
```

Clearly, commutative law is true in the case of matrix multiplication if one of the matrix is identity matrix. You can try to perform the multiplication with more than two matrices. Therefore, .

In the next post, we will discuss about taking transpose of a matrix.