Matrix multiplication is one of the most important operations in mathematics and is widely used in algebra, physics, computer science, engineering, economics, statistics, and data science. It provides a systematic way to combine information represented by two matrices and produce a new matrix.
At first, matrix multiplication can seem more complicated than ordinary multiplication because the numbers are not multiplied in the same positions. Instead, the entries of one row are multiplied by the entries of a column, and the resulting products are added together. Once this row-and-column process is understood, matrix multiplication becomes much easier to perform.
Before multiplying two matrices, it is also important to check their dimensions. Not every pair of matrices can be multiplied. The number of columns in the first matrix must be equal to the number of rows in the second matrix. This condition determines whether multiplication is possible and also tells us the size of the resulting matrix.
In this article, we will learn what matrix multiplication means, how to check whether two matrices can be multiplied, understand its basic formula, work through examples, and examine some important properties and common mistakes.
What Is Matrix Multiplication?
Matrix multiplication is an operation used to multiply two matrices and obtain a third matrix. The entries of the resulting matrix are calculated by combining the rows of the first matrix with the columns of the second matrix.
Consider two matrices, A and B. If the number of columns in A is equal to the number of rows in B, then the product AB can be calculated.
For example, suppose A has dimensions 2 × 3 and B has dimensions 3 × 2. The multiplication is possible because the number of columns in A is 3 and the number of rows in B is also 3.
The resulting matrix will have dimensions 2 × 2.
Text block
A: 2 × 3B: 3 × 2AB: 2 × 2
This gives us the most important dimension rule for matrix multiplication.
The Dimension Rule for Matrix Multiplication
To multiply two matrices, the inner dimensions must be equal.
Suppose:
Text block
A = m × nB = n × p
Then:
Text block
AB = m × p
The two middle numbers, n and n, must be the same.
For example:
Text block
(2 × 3)(3 × 4) = 2 × 4
Matrix multiplication is possible because the inner dimensions are both 3.
Another example is:
Text block
(3 × 2)(2 × 5) = 3 × 5
Again, the inner dimensions are both 2, so multiplication is possible.
However:
Text block
(2 × 3)(2 × 4)
cannot be multiplied because the first matrix has 3 columns while the second matrix has 2 rows.
Therefore, the multiplication is not defined for these two matrices in this order.
Basic Formula of Matrix Multiplication
The basic formula for matrix multiplication follows the row-by-column rule.
Suppose matrix A has entries aᵢⱼ and matrix B has entries bᵢⱼ. Each entry of the product AB is found by multiplying the elements in a particular row of A by the corresponding elements in a particular column of B and adding the results.
Text block
(AB)ᵢⱼ = aᵢ₁b₁ⱼ + aᵢ₂b₂ⱼ + aᵢ₃b₃ⱼ + ... + aᵢₙbₙⱼ
A shorter general form is:
Text block
(AB)ᵢⱼ = Σ aᵢₖbₖⱼ
Here, the symbol Σ means that the products are added together over the required values of k.
For beginners, however, the row-by-column method is usually easier to understand than the compact summation notation.
How Matrix Multiplication Works
The easiest way to understand matrix multiplication is to look at a simple example.
Consider the following two matrices:
Text block
A = [ 1 2 ][ 3 4 ]B = [ 5 6 ][ 7 8 ]
Both matrices are 2 × 2, so their multiplication is possible.
To find the first entry of AB, take the first row of A and the first column of B.
Text block
First row of A: 1 2First column of B: 5 71 × 5 + 2 × 7= 5 + 14= 19
Therefore, the top-left entry of the product is 19.
Now find the top-right entry by using the first row of A and the second column of B.
Text block
1 × 6 + 2 × 8= 6 + 16= 22
The first row of the resulting matrix is therefore 19, 22.
Next, use the second row of A.
For the bottom-left entry:
Text block
3 × 5 + 4 × 7= 15 + 28= 43
For the bottom-right entry:
Text block
3 × 6 + 4 × 8= 18 + 32= 50
Therefore:
Text block
AB = [ 19 22 ][ 43 50 ]
This example demonstrates the central idea of matrix multiplication: row of the first matrix × column of the second matrix.
Matrix Multiplication Formula for Two 2 × 2 Matrices
For two general 2 × 2 matrices, the multiplication can be written as follows.
Text block
A = [ a b ][ c d ]B = [ e f ][ g h ]
The product AB is:
Text block
AB = [ ae + bg af + bh ][ ce + dg cf + dh ]
Each entry is formed by multiplying the appropriate row and column elements and then adding the products.
For example, the top-left element is:
Text block
ae + bg
because the first row of A is combined with the first column of B.
The top-right element is:
Text block
af + bh
because the first row of A is combined with the second column of B.
The same process is repeated for the second row.
Matrix Multiplication of a 2 × 3 and 3 × 2 Matrix
Matrix multiplication becomes more interesting when the matrices have different dimensions.
Consider:
Text block
A = [ 1 2 3 ][ 4 5 6 ]B = [ 7 8 ][ 9 10 ][ 11 12 ]
Matrix A is 2 × 3, while matrix B is 3 × 2.
The multiplication is possible because:
Text block
(2 × 3)(3 × 2)
The inner dimensions are both 3.
The resulting matrix will have dimensions:
Text block
2 × 2
Now calculate each entry.
For the first entry:
Text block
1 × 7 + 2 × 9 + 3 × 11= 7 + 18 + 33= 58
For the second entry:
Text block
1 × 8 + 2 × 10 + 3 × 12= 8 + 20 + 36= 64
For the third entry:
Text block
4 × 7 + 5 × 9 + 6 × 11= 28 + 45 + 66= 139
For the fourth entry:
Text block
4 × 8 + 5 × 10 + 6 × 12= 32 + 50 + 72= 154
Therefore:
Text block
AB = [ 58 64 ][ 139 154 ]
Notice that the resulting matrix has two rows and two columns, exactly as predicted by the dimension rule.
Why Rows and Columns Matter
Rows and columns play different roles in matrix multiplication.
The rows of the first matrix determine the rows of the resulting matrix. The columns of the second matrix determine the columns of the resulting matrix.
For example:
Text block
(3 × 4)(4 × 2) = 3 × 2
The first matrix has 3 rows, so the result has 3 rows. The second matrix has 2 columns, so the result has 2 columns.
The four inner dimensions disappear after confirming that multiplication is possible.
This provides a useful way to remember the rule:
Text block
Outer dimensions → dimensions of the answer(3 × 4)(4 × 2)3 × 2
Matrix Multiplication Is Not Entry-by-Entry Multiplication
One common mistake is to multiply corresponding entries of two matrices.
For example, if:
Text block
A = [ 1 2 ][ 3 4 ]B = [ 5 6 ][ 7 8 ]
ordinary entry-by-entry multiplication would produce:
Text block
[ 1×5 2×6 ][ 3×7 4×8 ]
But this is not the standard matrix product AB.
The standard matrix product is obtained using row-by-column multiplication:
Text block
AB = [ 19 22 ][ 43 50 ]
Entry-by-entry multiplication is a different operation and should not be confused with ordinary matrix multiplication.
Is Matrix Multiplication Commutative?
For ordinary numbers, multiplication is commutative. For example:
Text block
3 × 5 = 5 × 3
However, matrix multiplication generally does not have this property.
In general:
Text block
AB ≠ BA
There are several reasons for this.
First, AB may be defined while BA is not. Even when both products are defined, they may produce different matrices.
For example, using the matrices above:
Text block
A = [ 1 2 ][ 3 4 ]B = [ 5 6 ][ 7 8 ]
we found:
Text block
AB = [ 19 22 ][ 43 50 ]
Now calculate BA:
Text block
BA = [ 23 34 ][ 31 46 ]
Clearly:
Text block
AB ≠ BA
Therefore, the order of matrices matters.
Important Properties of Matrix Multiplication
Matrix multiplication follows several useful mathematical properties.
Associative Property
When the dimensions allow all the products to be calculated, matrix multiplication is associative.
Text block
(AB)C = A(BC)
This means that when multiplying three matrices, the grouping can be changed without changing the final result.
Distributive Property
Matrix multiplication is distributive over matrix addition.
Text block
A(B + C) = AB + AC
Similarly:
Text block
(A + B)C = AC + BC
These properties are useful when simplifying matrix expressions.
Identity Matrix
The identity matrix acts like the number 1 in ordinary multiplication.
For a 2 × 2 matrix, the identity matrix is:
Text block
I = [ 1 0 ][ 0 1 ]
For a suitable matrix A:
Text block
AI = IA = A
The identity matrix leaves the original matrix unchanged.
Matrix Multiplication and Linear Transformations
Matrix multiplication is not only a calculation technique. It also has an important geometric meaning.
Matrices can represent transformations such as rotations, reflections, scaling, and other changes to vectors. When two transformation matrices are multiplied, the resulting matrix represents the combined transformation.
For example, one matrix might represent a rotation while another represents a scaling operation. Their product can represent both operations together.
This is one reason matrix multiplication is so important in computer graphics, robotics, physics, engineering, and computer science.
Applications of Matrix Multiplication
Matrix multiplication is used in many practical fields.
Computer Graphics
Computer graphics use matrices to transform objects. Scaling, rotation, translation, and projection can be represented using matrices.
Physics
Matrices are used to represent transformations, quantum mechanical operators, systems of equations, and many other mathematical structures in physics.
Engineering
Engineers use matrices to model systems, solve simultaneous equations, analyze structures, and perform transformations.
Computer Science
Matrix operations are fundamental in algorithms, machine learning, image processing, computer vision, and artificial intelligence.
Data Science and Machine Learning
Large datasets can be represented using matrices. Matrix multiplication is used in neural networks, linear regression, dimensional transformations, and many machine-learning calculations.
Economics
Matrices can represent relationships between different economic sectors, quantities, and variables. Matrix multiplication can then be used to calculate combined effects.
Common Mistakes in Matrix Multiplication
Understanding the most common errors can make matrix multiplication much easier.
1. Ignoring the Dimensions
Always check whether the number of columns in the first matrix equals the number of rows in the second matrix.
2. Multiplying Corresponding Entries
Do not simply multiply entries in the same positions. Standard matrix multiplication uses rows and columns.
3. Using the Wrong Column
When calculating one entry, make sure you select the correct column from the second matrix.
4. Forgetting to Add the Products
Each entry is usually the sum of several products. Multiplying the numbers without adding them will give an incorrect result.
5. Reversing the Order
Remember that AB and BA are generally different.
6. Getting the Resulting Dimensions Wrong
If:
Text block
(m × n)(n × p)
then the answer must be:
Text block
m × p
The outer dimensions determine the size of the product.
A Simple Method to Multiply Matrices
A reliable method can be summarized in a few steps.
Text block
Step 1: Check the dimensions.Step 2: Confirm that the columns of the first matrixequal the rows of the second matrix.Step 3: Determine the dimensions of the resultusing the outer dimensions.Step 4: Take one row from the first matrix.Step 5: Take one column from the second matrix.Step 6: Multiply corresponding elements.Step 7: Add the products.Step 8: Place the result in the appropriate position.Step 9: Repeat until every entry has been calculated.
Following these steps reduces the chance of mixing up rows and columns.
Summary of Matrix Multiplication
Matrix multiplication is a structured operation based on the interaction between rows and columns. Before multiplying two matrices, their dimensions must be checked carefully. If the first matrix has dimensions m × n and the second has dimensions n × p, their product exists and has dimensions m × p.
The most important formula is based on multiplying the elements of a row in the first matrix by the corresponding elements of a column in the second matrix and adding the products.
Text block
(AB)ᵢⱼ = aᵢ₁b₁ⱼ + aᵢ₂b₂ⱼ + ... + aᵢₙbₙⱼ
The key idea to remember is simple: take a row from the first matrix, take a column from the second matrix, multiply corresponding entries, add the products, and place the result in the correct position.
Matrix multiplication also has important properties such as associativity and distributivity, while it generally does not satisfy the commutative property. Its applications extend far beyond basic mathematics, making it an essential concept in science, engineering, computing, data science, and many other fields.
Once the row-by-column rule becomes familiar, even larger matrix multiplication problems can be approached systematically and accurately.
FAQs
1. What is matrix multiplication?
Matrix multiplication is a mathematical operation used to multiply two matrices and produce a new matrix. Unlike ordinary multiplication, corresponding entries are not simply multiplied together. Instead, each entry in the resulting matrix is found by multiplying the elements of a row from the first matrix by the corresponding elements of a column from the second matrix and then adding the products. Matrix multiplication is possible only when the number of columns in the first matrix equals the number of rows in the second matrix. The resulting matrix has the number of rows of the first matrix and the number of columns of the second matrix.
2. What is the basic formula for matrix multiplication?
The basic formula for matrix multiplication calculates each entry of the product by combining one row of the first matrix with one column of the second matrix. If A and B are matrices, an individual entry of AB is found by multiplying corresponding elements and adding the products. In general, if A has dimensions m × n and B has dimensions n × p, the product AB has dimensions m × p. This row-by-column method is the foundation of matrix multiplication. Understanding this formula makes it easier to multiply both small matrices, such as 2 × 2 matrices, and larger matrices with more rows and columns.
3. When can two matrices be multiplied?
Two matrices can be multiplied when the number of columns in the first matrix is equal to the number of rows in the second matrix. For example, a 2 × 3 matrix can be multiplied by a 3 × 4 matrix because both inner dimensions are 3. The resulting matrix will have dimensions 2 × 4. However, a 2 × 3 matrix cannot be multiplied by a 2 × 4 matrix because the first matrix has three columns while the second matrix has only two rows. Therefore, checking matrix dimensions should always be the first step before performing multiplication.
4. How do you multiply two 2 × 2 matrices?
To multiply two 2 × 2 matrices, take each row of the first matrix and combine it with each column of the second matrix. Multiply corresponding entries and add the resulting products. This produces one entry of the answer. Repeat the same process for every row and column combination. A 2 × 2 matrix multiplied by another 2 × 2 matrix produces another 2 × 2 matrix. For example, the top-left entry comes from the first row of the first matrix and the first column of the second matrix. The same row-by-column process is repeated until all four entries are calculated.
5. What is the row-by-column rule in matrix multiplication?
The row-by-column rule is the main method used to calculate matrix products. To find an entry in the resulting matrix, select one row from the first matrix and one column from the second matrix. Multiply the corresponding elements and add all the products together. The resulting sum becomes one entry of the product matrix. For example, if a row contains three elements, it is multiplied by a column containing three elements, and the three products are added. This process is repeated for every required row and column combination until the complete product matrix is obtained.
6. What are the dimensions of the product of two matrices?
The dimensions of a matrix product are determined by the outer dimensions of the two matrices. If the first matrix has dimensions m × n and the second matrix has dimensions n × p, the product will have dimensions m × p. The inner dimensions, n and n, must match for multiplication to be possible. For example, multiplying a 3 × 4 matrix by a 4 × 2 matrix produces a 3 × 2 matrix. Therefore, the rows of the first matrix determine the rows of the answer, while the columns of the second matrix determine its columns.
7. Is matrix multiplication commutative?
Matrix multiplication is generally not commutative. This means that changing the order of the matrices usually changes the result. In ordinary arithmetic, multiplication follows the commutative property, so changing the order does not affect the answer. However, for matrices, AB is generally not equal to BA. In some cases, one of the products may not even be defined because the dimensions do not satisfy the multiplication rule. Therefore, the order of matrices is important when performing matrix multiplication. Always follow the order given in the expression and check the dimensions before calculating the product.
8. What is the difference between matrix multiplication and entry-by-entry multiplication?
Standard matrix multiplication is different from multiplying corresponding entries. In standard matrix multiplication, each entry is calculated by taking a row from the first matrix, a column from the second matrix, multiplying corresponding elements, and adding the products. Entry-by-entry multiplication simply multiplies elements occupying the same positions. These are different operations and should not be confused. For example, in two 2 × 2 matrices, standard multiplication produces each of the four entries using a row-column calculation. Therefore, simply multiplying the numbers in matching positions does not give the standard matrix product.
9. What are the important properties of matrix multiplication?
Matrix multiplication has several important properties. It is associative, meaning that when dimensions permit the operations, the grouping can be changed without changing the final result. It is also distributive over matrix addition. However, matrix multiplication is generally not commutative, so changing the order of the matrices can change the result. The identity matrix also has an important role because multiplying a suitable matrix by an identity matrix leaves that matrix unchanged. These properties are useful when simplifying matrix expressions and are important in advanced mathematics, linear algebra, computer science, engineering, and many scientific applications.
10. Where is matrix multiplication used in real life?
Matrix multiplication has many practical applications because matrices can represent relationships, transformations, data, and systems of equations. In computer graphics, matrices are used for rotating, scaling, and transforming objects. In physics and engineering, they help represent transformations and solve mathematical models. In computer science, matrix multiplication is used in algorithms, image processing, computer vision, and artificial intelligence. Machine learning also relies heavily on matrix operations when processing datasets and calculating outputs in neural networks. Matrix multiplication is therefore not only an important mathematical procedure but also a fundamental computational tool used in many modern technologies.

















