Matrix Multiplication
Matrix multiplication or multiplication of matrices is one of the operations that can be performed on matrices in linear algebra. Multiplication of matrix A with matrix B is possible when both the given matrices, A and B are compatible. Matrix multiplication is a binary operation, that gives a matrix from two given matrices.
Matrix multiplication was first introduced in 1812 by French mathematician Jacques Philippe Marie Binet, in order to represent linear maps using matrices. Let us understand the rule for multiplication of matrices and matrix multiplication formula in detail in the following sections.
What is Matrix Multiplication?
Matrix multiplication is a binary operation whose output is also a matrix when two matrices are multiplied. In linear algebra, the multiplication of matrices is possible only when the matrices are compatible. In general, matrix multiplication, unlike arithmetic multiplication, is not commutative, which means the multiplication of matrix A and B, given as AB, cannot be equal to BA, i.e., AB ≠ BA. Therefore, the order of multiplication for the multiplication of matrices is important.
Multiplication of Matrices Definition
Suppose we have two matrices A and B, the multiplication of matrix A with Matrix B can be given as (AB). That means, the resultant matrix for the multiplication of for any m × n matrix 'A' with an n × p matrix 'B', the result can be given as matrix 'C' of the order m × p. Let us understand this concept in detail in the next section.
Compatibility of Matrices:
Two matrices A and B are said to be compatible if the number of columns in A is equal to the number of rows in B. That means if A is a matrix of order m×n and B is a matrix of order n×p, then we can say that matrices A and B are compatible.
Rules for Matrix Multiplication
As we studied, two matrices can be multiplied only when they are compatible, which means for the multiplication of matrices to exist the number of columns in the first matrix should be equal to the number of rows in the second matrix, in the above case 'n'. If A is a matrix of order m×n and B is a matrix of order n×p, then the order of the product matrix is m×p.
For example,
a) Multiplying a 4 × 3 matrix by a 3 × 4 matrix is valid and it gives a matrix of order 4 × 4
b) 7 × 1 matrix and 1 × 2 matrices are compatible; the product gives a 7 × 2 matrix.
c) Multiplication of a 4 × 3 matrix and 2 × 3 matrix is NOT possible.
Matrix Multiplication Formula
We can understand the general process of matrix multiplication by the technique, "First rows are multiplied by columns (element by element) and then the rows are filled up." Consider two matrices of order 3×3 as given below,
\( \begin{pmatrix}
a & b & c\\
d & e & f\\
g & h & i
\end{pmatrix}
%
\begin{pmatrix}
j & k & l\\
m & n & o\\
p & q & r
\end{pmatrix}
\)
Here, the matrices have the same dimensions, so the resultant matrix will also have the same dimension 3×3
2×2 Matrix Multiplication
The process is the same for the matrix of any order. We multiply the elements of each row of the first matrix by the elements of each column in the second matrix (element by element) as shown in the image. Finally, we add the products.
3×3 Matrix Multiplication
3×3 Matrix Multiplication can be done using the matrix multiplication formula, such that the given matrices are compatible. The process is exactly the same for the matrix of any order.
Properties of Matrix Multiplication
There are certain properties of matrix multiplication operation in linear algebra in mathematics. These properties are as given below,
 NonCommutative: Matrix multiplication is noncommutative, i.e., for multiplication of two matrices A and B, AB ≠ BA.
 Distributivity: Matrix multiplication follows the distributive property, i.e., multiplication of matrix A and matrix B with another matrix C, A(B + C) = AB + BC, given that A, B, and c are compatible.
 Product with Scalar: If the product of matrices A and B, AB is defined then, c(AB) = (cA)B = A(Bc), such that c is a scalar.
 Transpose: The transpose of the product of matrices A and B can be given as, (AB)^{T} = B^{T}A^{T}, where ^{T} denotes the transpose.
 Complex Conjugate: If A and B are complex entries, then (AB)^{*} = B^{*}A^{*}
 Associativity: Given three matrices A, B and C, such that the products (AB)C and A(BC) are defined, then (AB)C = A(BC).
How to Multiply Matrices?
Multiplication of two compatible matrices can be performed using some general steps as explained above. The steps in matrix multiplication are given as,
 Make sure that the number of columns in the 1^{st} matrix equals the number of rows in the 2^{nd} matrix (compatibility of matrices).
 Multiply the elements of each row of the first matrix by the elements of each column in the second matrix.
 Add the products.
 Place the added products in the respective columns.
Let us understand these steps for multiplication of matrices better using an example.
Example: Multiply the matrices given below, to find their product of \( \begin{pmatrix}
1 & 2 \\
3 & 4 \\ 5 & 1 \\
\end{pmatrix} \text{and}\begin{pmatrix}
2 \\
4 \\
\end{pmatrix}
\)
Solution: The given matrices are of order 3×2 and 2×1. ∵The given matrices are compatible, we can perform the matrix multiplication and the product matrix will be of order 3×1.
\(\begin{pmatrix}
1 & 2 \\
3 & 4 \\ 5 & 1 \\
\end{pmatrix}.\begin{pmatrix}
2 \\
4 \\
\end{pmatrix}\\\\
= \begin{pmatrix}
(1\times2)+(2\times4) \\
(3\times2)+(4\times4) \\ (5\times2)+(1\times4) \\
\end{pmatrix} \\\\ = \begin{pmatrix}
2+8 \\
6+16 \\ 10+4 \\
\end{pmatrix}
\\\\
= \begin{pmatrix}
10 \\
22 \\14\\
\end{pmatrix}\).
Answer: Product matrix is \(\begin{pmatrix}
10 \\
22\\14 \\
\end{pmatrix}
\)
Thinking out of the box:
 By using the matrices shown below, check whether matrix multiplication is commutative or not.
\( \begin{pmatrix}
1 & 0 \\
2 & 4 \\
\end{pmatrix} \text{and}\begin{pmatrix}
6 & 8 \\
4 & 3 \\
\end{pmatrix}
\)  Is matrix multiplication associative?
Important Notes on Multiplication of Matrices:
 To multiply matrices, the given matrices should be compatible.
 The order of a product matrix can be obtained by the following rule:
If A is a matrix of order m×n and B is a matrix of order n×p, then the order of the product matrix is m×p.  Matrix multiplication indicates rows by columns multiplication.
Examples on Multiplication of Matrices

Example 1: Using the matrix multiplication formula, find the product of the matrices:
\[ \begin{pmatrix}
1 & 0 \\
2 & 4 \\
\end{pmatrix} \text{and}\begin{pmatrix}
6 & 8 \\
4 & 3 \\
\end{pmatrix}
\]Solution:
The given matrices are of order 2×2. ∵They are compatible, we can find the multiplication of the matrices and their product matrix will also be 2×2.
\( \text {Product of matrices }\left(\begin{array}{ll}1 & 0 \\ 2 & 4\end{array}\right) \text { and }\left(\begin{array}{ll}6 & 8 \\ 4 & 3\end{array}\right) \text { is: }\)
\(\begin{pmatrix}
1 & 0 \\
2 & 4 \\
\end{pmatrix}.\begin{pmatrix}
6 & 8 \\
4 & 3 \\
\end{pmatrix}\\\\
= \begin{pmatrix}
(1\times6)+(0\times4) & (1\times8)+(0\times3) \\
(2\times6)+(4\times4) & (2\times8)+(4\times3) \\
\end{pmatrix} \\\\ = \begin{pmatrix}
6+0 && 8+0 \\
12+16&& 16+12 \\
\end{pmatrix}
\\\\
= \begin{pmatrix}
6 & 8 \\
28& 28 \\
\end{pmatrix}\)Answer: Product matrix is \(\begin{pmatrix}
6 & 8 \\
28 & 28 \\
\end{pmatrix}
\) 
Example 2: There are three ways to travel from City A to City B: car, train, and plane. The travel fee is different for adults and children and the prices are different for journeys in the morning and afternoon. Below are two tables summarizing the total cost of the trip during the mornings and afternoons.
ADULT Car Train Plane Morning fare 200 160 235 Afternoon fare 250 150 270 CHILD Car Train Plane Morning fare 140 110 185 Afternoon fare 200 120 160 Represent the information using the cost matrix for adult and child.
Solution:
We can represent the above information with the help of two matrices.
Rows: by car, by train, by plane
Columns: adult, child
The fare in the morning is shown as Matrix M: \(\begin{pmatrix}
200 & 140 \\
160 & 110 \\235 & 185
\end{pmatrix}
\)The fare in the afternoon is shown as Matrix N:\(\begin{pmatrix}
250 & 200 \\
150 & 120 \\270 & 160
\end{pmatrix}
\)Answer: M and N represent the respective cost matrices.

Example 3: Matrix A is of 4×1 order. Matrix B is of 1×3 order. Are both the products AB and BA defined?
Solution:
Matrix A is of order 4×1
Matrix B is of order 1×3The product AB is defined as the number of columns of A is the same as the number of rows of B. Using the multiplication of matrices rule, the product matrix hence obtained is of order 4×3. The product BA is not defined as the number of columns of B is not equal to the number of rows of A. So, we can say that matrix multiplication is not commutative, AB is not necessarily equal to BA and sometimes one of the products may not be defined also.
Answer: Product AB is defined but not BA.
FAQs on Matrix Multiplication
What is Matrix Multiplication in Linear Algebra?
Multiplication is one of the binary operations that can be applied to matrices in linear algebra. For the matrix multiplication to exist for two matrices A and B, the number of columns in matrix A should be equal to the number of rows in matrix B. ⇒AB exists.
How do you Multiply Matrices of Order 3×3?
3x3 matrices in mathematics can be multiplied by multiplying the rows of the first matrix are multiplied with the columns of the second matrix to obtain the corresponding elements of the product matrix.
What is the Formula of Matrix Multiplication?
The matrix multiplication formula is used to perform the multiplication of matrices in general. For 2x2 matrix multiplication, this formula is given by multiplying the elements in rows by elements in columns.
Can you Multiply Matrices of Order 2x3 and 2x2?
No, we cannot multiply a 2x3 and 2x2 matrix because in order to perform matrix multiplication, two matrices should be compatible. Since the number of columns in the first matrix(3) is not equal to the number of rows in the second matrix(2), we cannot perform matrix multiplication for this case.
What is the Purpose of Matrix Multiplication?
Matrix multiplication is important for facilitating computations in linear algebra and are used for representing linear maps. It is an important tool in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering.
Can you Multiply Matrices of Order 2×1 and 2×2?
No, they can't be multiplied as those matrices are not compatible. The number of columns of the first matrix is not equal to the number of rows of the second matrix.
When is Matrix Multiplication Possible?
Matrix multiplication is possible only if the matrices are compatible i.e., matrix multiplication is valid only if the number of columns of the first matrix is equal to the number of rows of the second matrix.
Is Matrix Multiplication Always Commutative?
Matrix multiplication, in general, is not commutative. This means that the order of multiplication for matrices is important.
Is Matrix Multiplication Always Defined?
Matrix multiplication is possible only when the matrices are compatible. For the multiplication of matrices to exist the number of columns in the first matrix should be equal to the number of rows in the second matrix