Skip to content
Related Articles

Related Articles

How to Multiply Matrices
  • Last Updated : 13 Jan, 2021

The knowledge of matrices is necessary for various branches of mathematics. Matrices are one of the most powerful tools in mathematics. In this article, we discuss the Multiplication of Matrices by matrices. Matrix multiplication is a very simple thing in mathematics. If do multiply with a number then just multiply the number with all the elements present in the matrix. But if we multiply a matrix with another matrix then we must see some rules.  

Rules: 

We can multiply two matrices if the number of rows in the 1st matrix is the same as the number of columns in the 2nd matrix, otherwise, we cannot apply multiplication between the matrices.

  1. Let’s say a matrix of size 2×3 and another matrix is of size 3×2, then we can apply the multiplication between those matrices because the number of columns and rows are the same in both the matrices. And the resultant matrix will be of 2×2
  2. Let’s say a matrix of size 3×3 and another matrix is of size 4×2, then we cannot apply the multiplication between those matrices because the number of columns and rows are not the same in both the matrices.

Multiplying Matrices by Matrices

Let’s say 2 matrices of 3×3 have elements a[i, j] and b[i, j] respectively. The multiplication will be like the below image:



There is some rule,

  1. Take the first matrix’s 1st row and multiply the values with the second matrix’s 1st column. Don’t multiply the rows with the rows or columns with the columns.
  2. In 1st iteration, multiply the row value with the column value and sum those values. Here in this picture, a[0, 0] is multiplying with b[0, 0], then the 2nd value of the 1st column of 1st matrix a[1, 0] is multiplying with 2nd value of the 1st row of the 2nd matrix b[0,1].  Similarly, all the values are multiplying.
  3. Then after one iteration all the production values are sum up together and placed as the elements of the resultant matrix as the picture shows.

Examples

Question 1. Let A =\begin{bmatrix} 1 & 8 & 3\\ 9 & 4 & 5 \\ 6 & 2 & 7 \end{bmatrix} and B =\begin{bmatrix} 6 & 7 & 4\\ 1 & 3 & 2 \\ 5 & 9 & 8 \end{bmatrix} Find AxB?

Solution: 

A \times B =\begin{bmatrix} 1 & 8 & 3\\ 9 & 4 & 5 \\ 6 & 2 & 7 \end{bmatrix} \times \begin{bmatrix} 6 & 7 & 4\\ 1 & 3 & 2 \\ 5 & 9 & 8 \end{bmatrix}     

=\begin{bmatrix} (1*6 + 8*1 + 3*5) & (1*7 + 8*3 + 3*9) & (1*4 + 8*2 + 3*8)\\ (9*6 + 4*1 + 5*5) & (9*7 + 4*3 + 5*9) & (9*4 + 4*2 + 5*8) \\ (6*6 + 2*1 + 7*5) & (6*7 + 2*3 + 7*9) & (6*4 + 2*2 + 7*8) \end{bmatrix}

=\begin{bmatrix} 29 & 58 & 44\\ 83 & 120 & 84 \\ 73 & 111 & 84 \end{bmatrix}

Question 2. Let  A =\begin{bmatrix} 1 & 5 & 4\\ 9 & 3 & 8 \end{bmatrix} and B =\begin{bmatrix} 6 & 7 \\ 1 & 3   \\ 5 & 9 \end{bmatrix}. Find AxB?

Solution:



A \times B =\begin{bmatrix} (1*6 + 5*1 + 4*5) & (1*7 + 5*3 + 4*9) \\ (9*6 + 3*1 + 8*5) & (9*7 + 3*3 + 8*9)\end{bmatrix}

 =\begin{bmatrix} 31 & 58 \\ 97 & 144\end{bmatrix}

Question 3. Let A=\begin{bmatrix} 2 & 0 & -3\\ 1 & 4 & 5 \end{bmatrix},  B=\begin{bmatrix} 3 & 1\\ -1 & 0 \\ 4 & 2\end{bmatrix}  and C=\begin{bmatrix} 4 & 7\\ 2 & 1 \\ 1 & -1\end{bmatrix}. Find (AB + AC)?

Solution:

A \times B = \begin{bmatrix} 2 & 0 & -3\\ 1 & 4 & 5 \end{bmatrix}\times \begin{bmatrix} 3 & 1\\ -1 & 0 \\ 4 & 2\end{bmatrix} \\ = \begin{bmatrix} (2*3 + 0*(-1) + (-3)*4) & (2*1 + 0*0 + (-3)*2) \\ (1*3 + 4*(-1) + 5*4) & (1*1 + 4*0 + 5*2)\end{bmatrix}

=\begin{bmatrix} -6 & -4 \\ 19 & 11\end{bmatrix}

A \times C = \begin{bmatrix} 2 & 0 & -3\\ 1 & 4 & 5 \end{bmatrix}\times \begin{bmatrix} 4 & 7\\ 2 & 1 \\ 1 & -1\end{bmatrix} \\ = \begin{bmatrix} (2*4 + 0*2 + (-3)*1) & (2*7 + 0*1 + (-3)*(-1)) \\ (1*4 + 4*2 + 5*1) & (1*7 + 4*1 + 5*(-1))\end{bmatrix}

=\begin{bmatrix} 5 & 17 \\ 17 & 6\end{bmatrix}

Now calculate  (AB + AC)

= \begin{bmatrix} -6 & -4 \\ 19 & 11\end{bmatrix} + \begin{bmatrix} 5 & 17 \\ 17 & 6\end{bmatrix}

(AB +BC)= \begin{bmatrix} -1 & 13 \\ 36 & 17\end{bmatrix}

Question 4. Let A=\begin{bmatrix} 2  & -2\\ -2 & 2\end{bmatrix} , and A^2=pA, Then find the value of p?

Solution:

First, calculate A2,

A^2 = A\times A=\begin{bmatrix} 2  & -2\\ -2 & 2\end{bmatrix} \times \begin{bmatrix} 2  & -2\\ -2 & 2\end{bmatrix}

=\begin{bmatrix} (2*2 + (-2)*(-2)) & ((2*(-2) + (-2)*2)  \\ ((-2)*2 + 2*(-2)) & ((-2)*(-2) + 2*2)\end{bmatrix}

=\begin{bmatrix} 8 & -8\\ -8 & 8\end{bmatrix}

Given A^2=pA

By placing the value of A2 in the equation, we get

\begin{bmatrix} 8 & -8\\ -8 & 8\end{bmatrix} = p\begin{bmatrix} 2 & -2\\ -2 & 2\end{bmatrix}

=\begin{bmatrix} 8 & -8\\ -8 & 8\end{bmatrix} = \begin{bmatrix} 2p & -2p\\ -2p & 2p\end{bmatrix}

Now, we can write, 

8 = 2p and, -8 = -2p

So, p = 4

The value of p is 4.

My Personal Notes arrow_drop_up
Recommended Articles
Page :