Just like, addition and subtraction of two matrices, we can multiply two or more than two matrices. Matrix multiplication is a binary operation. We can multiply two or more than two matrices and produce another matrix.

Here, we will learn the following in detail:

• Multiplying 2x2 Matrices
• Multiplying 3x3 Matrices
• Matrix Multiplication Rules
• Matrix Multiplication Properties

## Matrix Multiplication Rules

If A and B are the two matrices then, we can multiply A by B if and only if, the number of columns in the first matrix is equal to the number of rows in the second matrix.

The product of matrices is undefined, if the rules for multiplying matrices defined above is not satisfied. After multiplication, the order of the resultant matrix is (number of rows of first matrix) × (number of columns of second matrix).So, if Apxq and Bqxr are two matrices then, the product of these two, say C is a matrix of order pxr. AB = {aij] x [bjk] = [ cik ]pxr, where cik =$\sum_{j=1}^{q} a_{ij}.b_{jk}$

## Multiplying Two Matrices

Here, we will learn how to do matrix multiplication with a few matrix multiplication examples.

Let C = $\begin{bmatrix} 2 &-1 &1 \\ 3 &0 &-4 \end{bmatrix}$ and D = $\begin{bmatrix} 7 &2 \\ 1 &3 \\ -4 &5 \end{bmatrix}$

For matrix multiplication, we have to follow steps given below:

• Step 1: check whether the number of columns in the first matrix = number of rows in the second matrix or if the matrices are of the same order.
• Step 2: Perform the multiplication of two matrices.

For matrices C and D, the above said properties are satisfied. And so, it is possible to multiply the matrices and is given by,
CD = E = $\begin{bmatrix} 2 &-1 &1 \\ 3 &0 &-4 \end{bmatrix}$. $\begin{bmatrix} 7 &2 \\ 1 &3 \\ -4 &5 \end{bmatrix}$

Here, order of E is 2x2. To calculate the elements of E, we multiply the elements of each row of C with the corresponding elements of each column of D and add the product. This is way for multiplying matrices.

E11 : Element of first row and first column-

E12 : Element of first row and second column

E21 : Element of second row and first column

E22 :
Element of second row and second column

Hence, E = $\begin{bmatrix} 9 & 6 \\ 37 & -14 \end{bmatrix}$

## Multiplying 2x2 Matrices

Here, we will learn about 2x2 matrix multiplication. Let A = $\begin{bmatrix} 4 &-1 \\ 2 &3 \end{bmatrix}$ and B = $\begin{bmatrix} 2 &7\\ -5 &8 \end{bmatrix}$ be two matrices. Let us calculate AB.

Here, matrices A and B are of the same order. So, the number of columns of A is the equal to number of rows of B. This means matrix multiplication is possible.

AB = $\begin{bmatrix} 4 &-1 \\ 2 &3 \end{bmatrix}$.$\begin{bmatrix} 2 &7\\ -5 &8 \end{bmatrix}$

Elements of first row and first column

= $\begin{bmatrix} (4)2 +(-1)(-5) &? \\ ? &? \end{bmatrix}$

= $\begin{bmatrix} 13 &? \\ ?&? \end{bmatrix}$

Elements of first row and second column

= $\begin{bmatrix} ? &4(7) + (-1)8 \\ ?&? \end{bmatrix}$

= $\begin{bmatrix} ? &20 \\ ?&? \end{bmatrix}$

Elements of second row and first column

=$\begin{bmatrix} ? &? \\ 2(2) + 3(-5) &? \end{bmatrix}$

= $\begin{bmatrix} ? &? \\ -11 &? \end{bmatrix}$

Elements of second row and second column

= $\begin{bmatrix} ? &? \\ ?&2(7) +3(8) \end{bmatrix}$

= $\begin{bmatrix} ? &? \\ ?&38 \end{bmatrix}$

Hence, AB = $\begin{bmatrix} 13 &20 \\ -11&38 \end{bmatrix}$

## 3x3 Matrix Multiplication

For multiplying 3X3 matrices, let us consider A = $\begin{bmatrix} -1 &2 &-7 \\ 3 &-4 &6 \\ 2 &5 & -1 \end{bmatrix}$ and B = $\begin{bmatrix} 3 &-1 &6 \\ 8 &1 &6 \\ 4 &0 & 5 \end{bmatrix}$

A and B have the same order. So, AB = $\begin{bmatrix} -3 + 16 -28 &1 + 2 + 0 &-6 + 12 -35 \\ 9 -32 + 24 &-3 -4 + 0 &18 -24 + 30 \\ 6 + 40 -4 &-2 + 5 + 0 & 12 + 30 -5 \end{bmatrix}$

= $\begin{bmatrix} -15 &3 &-29 \\ 1 &-7 &24 \\ 42 &3& 37 \end{bmatrix}$

## Multiplying 3 Matrices

Multiplication of 3 matrices is not so easy. We have to multiply two at a time and get the result. Then, we have to multiply the resultant matrix with the remaining matrix according to the given conditions.
Let A2x3 = $\begin{bmatrix} 4 &-1 &3 \\ -2 &0 &1 \end{bmatrix}$ , B3x2 = $\begin{bmatrix} 2 &0 \\ -3 &5 \\ -6 &7 \end{bmatrix}$ and C2X2 = $\begin{bmatrix} -1 &1 \\ 1 &-1 \end{bmatrix}$

To calculate ABC, first we have to take matrices A and B and find the product AB. Here, number of rows in A = number of columns in B.

AB = $\begin{bmatrix} 4 &-1 &3 \\ -2 &0 &1 \end{bmatrix}$ . $\begin{bmatrix} 2 &0 \\ -3 &5 \\ -6 &7 \end{bmatrix}$

= $\begin{bmatrix} 8+3-18 &0-5+21 \\ -4+0-6 &0+0+7 \end{bmatrix}$

= $\begin{bmatrix} -7 &16 \\ -10 &7 \end{bmatrix}$

Now, ABC = (AB)C = $\begin{bmatrix} -7 &16 \\ -10 &7 \end{bmatrix}$ . $\begin{bmatrix} -1 &1 \\ 1 &-1 \end{bmatrix}$

= $\begin{bmatrix} 23 &-23\\ 17 &-17 \end{bmatrix}$

## Matrix Multiplication Properties

Given below are some of the properties of matrix multiplication.

### Associative Property of Matrix Multiplication:

If A,B and C are three matrices then, A(BC) = (AB)C

Proof:

Let A3x2 = $\begin{bmatrix} 4 &-1 \\ 0 & 2\\ -2 &1 \end{bmatrix}$, B2x3 = $\begin{bmatrix} 1 &2 &3 \\ -4 &5 &6 \end{bmatrix}$ and C3x2 = $\begin{bmatrix} 5 &0 \\ -1 &1 \\ 0 &2 \end{bmatrix}$

Then, A(BC) = A . $\begin{bmatrix} 1 &2 &3 \\ -4 &5 &6 \end{bmatrix}$ . $\begin{bmatrix} 5 &0 \\ -1 &1 \\ 0 &2 \end{bmatrix}$

= A $\begin{bmatrix} 3 &8 \\ -25 & 17 \end{bmatrix}$

= $\begin{bmatrix} 4 &-1 \\ 0 & 2\\ -2 &1 \end{bmatrix}$ . $\begin{bmatrix} 3 &8 \\ -25 & 17 \end{bmatrix}$

= $\begin{bmatrix} 37 &15 \\ -50 & 34\\ -31 &1 \end{bmatrix}$ ....................................................(i)

A(BC) = $\begin{bmatrix} 37 &15 \\ -50 & 34\\ -31 &1 \end{bmatrix}$

Again, (AB)C = $\begin{bmatrix} 4 &-1 \\ 0 & 2\\ -2 &1 \end{bmatrix}$ . $\begin{bmatrix} 1 &2 &3 \\ -4 &5 &6 \end{bmatrix}$ . C

= $\begin{bmatrix} 8 &3 &6 \\ -8 &10 &12 \\ -6 &1& 0 \end{bmatrix}$ . C

= $\begin{bmatrix} 8 &3 &6 \\ -8 &10 &12 \\ -6 &1& 0 \end{bmatrix}$ . $\begin{bmatrix} 5 &0 \\ -1 &1 \\ 0 &2 \end{bmatrix}$

= $\begin{bmatrix} 37 &15 \\ -50 & 34\\ -31 &1 \end{bmatrix}$ ...............................................................(ii)

From (i) and (ii), A(BC) = (AB)C. This answers the question "Is Matrix Multiplication Associative?".

### Distributive Property of Matrix Multiplication:

If A, B and C are the given matrices then, A(B + C) = AB + AC

Proof:

Let A3x2, B2x2 and C2x2 be 3 matrices which are defined as follows:

A = $\begin{bmatrix} 1 &2 \\ -3 &5 \\ 1 &8 \end{bmatrix}$, B = $\begin{bmatrix} 3 &-2\\ 7 &-4 \end{bmatrix}$ and C = $\begin{bmatrix} 5 &-6\\ 4 &-1 \end{bmatrix}$

Now, B + C = $\begin{bmatrix} 3 &-2\\ 7 &-4 \end{bmatrix}$ + $\begin{bmatrix} 5 &-6\\ 4 &-1 \end{bmatrix}$

= $\begin{bmatrix} 8 &-8\\ 11 &-5 \end{bmatrix}$

A(B + C) = $\begin{bmatrix} 1 &2 \\ -3 &5 \\ 1 &8 \end{bmatrix}$ . $\begin{bmatrix} 8 &-8\\ 11 &-5 \end{bmatrix}$

= $\begin{bmatrix} 30 & -18 \\ 31 & -1 \\ 96 &-48 \end{bmatrix}$ ..........................................................(a)

Now, AB = $\begin{bmatrix} 1 &2 \\ -3 &5 \\ 1 &8 \end{bmatrix}$ . $\begin{bmatrix} 3 &-2\\ 7 &-4 \end{bmatrix}$

= $\begin{bmatrix} 17 &-10\\ 26 &-14 \\ 59 &-34 \end{bmatrix}$ ..........................................................(b)

AC = $\begin{bmatrix} 1 &2 \\ -3 &5 \\ 1 &8 \end{bmatrix}$ . $\begin{bmatrix} 5 &-6\\ 4 &-1 \end{bmatrix}$

= $\begin{bmatrix} 13 &-8 \\ 5 &13 \\ 37 &-14 \end{bmatrix}$ ............................................................(c)

From (b) and (c), we get
AB + AC = $\begin{bmatrix} 30 & -18 \\ 31 & -1 \\ 96 &-48 \end{bmatrix}$ ...........................................................(d)

It is clear from (a) and (d) that A(B + C) = AB + AC

### Property for Scalar Multiplication:

If A is a given matrix and p, q are the given scalars then, (pq)A = p(qA).

Proof:

Let A2x2 = $\begin{bmatrix} a &b\\ c &d \end{bmatrix}$ be any matrix and p, q are the scalars.

By the use of scalar multiplication on a matrix, we know that we have to multiply each element of the matrix by the scalar. So,

(pq)A = pq . $\begin{bmatrix} a &b\\ c &d \end{bmatrix}$

= $\begin{bmatrix} apq &bpq\\ cpq &dpq \end{bmatrix}$ .................................................(1)

And p(qA) = (p)q . $\begin{bmatrix} a &b\\ c &d \end{bmatrix}$

= p $\begin{bmatrix} aq &bq\\ cq &dq \end{bmatrix}$

= $\begin{bmatrix} apq &bpq\\ cpq &dpq \end{bmatrix}$ ................................................(2)

Then, from (1) and (2), we get (pq)A = p(qA)

## Is Matrix Multiplication Commutative?

If A and B are two matrices, then AB $\neq$ BA i.e. matrix multiplication is not commutative.

Proof:

To prove non-commutativity of multiplication of matrices, lets take

A2x3 = $\begin{bmatrix} 2 &-1 &-3 \\ -4 &2 &-5 \end{bmatrix}$ and B3x2 = $\begin{bmatrix} 3 & -2 \\ -1 & 1 \\ 0 &1 \end{bmatrix}$

Here, A is 2x3 order matrix and B is 3x2 order matrix. Hence, AB and BA both are defined.

AB = $\begin{bmatrix} 2 &-1 &-3 \\ -4 &2 &-5 \end{bmatrix}$ . $\begin{bmatrix} 3 & -2 \\ -1 & 1 \\ 0 &1 \end{bmatrix}$ = $\begin{bmatrix} 7 &-8\\ -14 &5 \end{bmatrix}$

Now, BA = $\begin{bmatrix} 3 & -2 \\ -1 & 1 \\ 0 &1 \end{bmatrix}$ . $\begin{bmatrix} 2 &-1 &-3 \\ -4 &2 &-5 \end{bmatrix}$ = $\begin{bmatrix} 14 &-7 &1 \\ -6 &3 &-2\\ -4 &2&-5 \end{bmatrix}$

Clearly, AB $\neq$ BA
Here, both AB and BA are of different order. Perhaps, AB = BA if they are of the same order. But, its not always true. Lets have a look at an example, where AB and BA are of the same order but AB $\neq$ BA.

Let A2x2 = $\begin{bmatrix} 2 &0\\ 0 &-2 \end{bmatrix}$ and B2x2 = $\begin{bmatrix} 0&2\\ 2&0 \end{bmatrix}$

Then, AB = $\begin{bmatrix} 0&4\\ -4 &0 \end{bmatrix}$ and BA = $\begin{bmatrix} 0 &-4\\ 4 &0 \end{bmatrix}$.

In the above example,order of AB and BA are the same. But, AB $\neq$ BA. Thus, matrix multiplication is not commutative.

For matrix multiplication,
• Number of columns of first matrix = Number of rows of second matrix.
• Multiply each element of the rows of first matrix with the corresponding elements of the columns of second matrix and then add.
• Matrix multiplication is not commutative