Matrix Multiplication Calculator
Multiply matrices when their inner dimensions are compatible.
Free online tool by SOCE. Check inputs and results before using them for important decisions.
Matrix Multiplication Calculator
Multiply two matrices easily with the SOCE Matrix Multiplication Calculator. Matrix multiplication is a fundamental operation in linear algebra used in engineering mathematics, structural analysis, finite element analysis, numerical methods, physics, and computer science.
Whether you are multiplying 2×2 matrices, working with rectangular matrices, or solving engineering mathematics problems, understanding the correct multiplication procedure is essential.
This page explains the matrix multiplication formula, compatibility conditions, step-by-step calculation method, worked examples, important properties, and practical applications.
What Is Matrix Multiplication?
Matrix multiplication is a mathematical operation in which two matrices are multiplied to produce a third matrix, known as the product matrix.
Unlike ordinary multiplication of numbers, matrix multiplication follows a specific row-by-column rule. Each element of the resulting matrix is calculated by multiplying the corresponding elements of a row from the first matrix by a column from the second matrix and adding the products.
If A and B are two matrices, their product is represented by:
C = AB
Here, C is the resulting product matrix.
Condition for Matrix Multiplication
Two matrices can be multiplied only when the number of columns in the first matrix equals the number of rows in the second matrix.
Suppose:
- Matrix A has dimensions m × n.
- Matrix B has dimensions n × p.
Then the product AB is defined and the resulting matrix C has dimensions:
C = AB, with dimensions m × p.
The shared inner dimension n must be equal.
Example:
A 2×3 matrix can be multiplied by a 3×2 matrix.
The resulting matrix will have dimensions 2×2.
However, a 2×3 matrix cannot be multiplied by a 2×3 matrix in that order because the inner dimensions do not match.
Matrix Multiplication Formula
For two matrices A and B, the element in row i and column j of the product matrix C is calculated using:
Cᵢⱼ = Σ AᵢₖBₖⱼ
where:
- Cᵢⱼ is the element in row i and column j of the product matrix.
- Aᵢₖ is an element of the ith row of matrix A.
- Bₖⱼ is an element of the jth column of matrix B.
- k represents the shared dimension over which the products are summed.
In simple terms, each result element is the dot product of one row of A and one column of B.
How to Multiply Two Matrices
Follow these steps to multiply two matrices:
- Check the dimensions of both matrices.
- Confirm that the number of columns in matrix A equals the number of rows in matrix B.
- Select a row from matrix A.
- Select a column from matrix B.
- Multiply their corresponding elements.
- Add all the products to obtain one element of the result matrix.
- Repeat the process for every row-column combination.
The completed values form the product matrix.
Example 1: Multiplication of Two 2×2 Matrices
Consider two matrices:
A = [[1, 2], [3, 4]]
B = [[5, 6], [7, 8]]
The product is:
C = AB
Calculate each element:
C₁₁ = (1 × 5) + (2 × 7) = 19
C₁₂ = (1 × 6) + (2 × 8) = 22
C₂₁ = (3 × 5) + (4 × 7) = 43
C₂₂ = (3 × 6) + (4 × 8) = 50
Therefore:
AB = [[19, 22], [43, 50]]
Example 2: Multiplication of Rectangular Matrices
Consider:
A = [[1, 2, 3], [4, 5, 6]]
B = [[7, 8], [9, 10], [11, 12]]
Matrix A has dimensions 2×3, while matrix B has dimensions 3×2.
Since the number of columns in A equals the number of rows in B, multiplication is possible.
Calculate the result:
C₁₁ = (1 × 7) + (2 × 9) + (3 × 11) = 58
C₁₂ = (1 × 8) + (2 × 10) + (3 × 12) = 64
C₂₁ = (4 × 7) + (5 × 9) + (6 × 11) = 139
C₂₂ = (4 × 8) + (5 × 10) + (6 × 12) = 154
Therefore:
AB = [[58, 64], [139, 154]]
The resulting matrix has dimensions 2×2.
Important Properties of Matrix Multiplication
Matrix multiplication follows several important algebraic properties.
1. Associative Property
Matrix multiplication is associative when the matrix dimensions permit the operations:
(AB)C = A(BC)
2. Distributive Property
Matrix multiplication is distributive over matrix addition:
A(B + C) = AB + AC
Similarly:
(A + B)C = AC + BC
3. Identity Property
For a compatible identity matrix I:
AI = IA = A
4. Non-Commutative Property
Matrix multiplication is generally not commutative:
AB ≠ BA
The order of multiplication matters. In some cases, reversing the order may also make the multiplication undefined.
5. Scalar Multiplication
For a scalar k:
k(AB) = (kA)B = A(kB)
6. Transpose of a Product
The transpose of a matrix product reverses the multiplication order:
(AB)ᵀ = BᵀAᵀ
Different Types of Matrix Multiplication
Square Matrix Multiplication
Both matrices have the same number of rows and columns. For example, two 3×3 matrices can be multiplied to produce another 3×3 matrix.
Rectangular Matrix Multiplication
Matrices with different numbers of rows and columns can also be multiplied if their inner dimensions match.
Matrix and Vector Multiplication
A matrix can be multiplied by a compatible column or row vector. This operation is widely used in engineering and mathematical modelling.
Matrix Multiplication by a Scalar
Every element of a matrix is multiplied by the same scalar value. This is different from multiplying two matrices.
Applications of Matrix Multiplication
Matrix multiplication is widely used in mathematics, engineering, science, and computational applications.
- Structural Engineering: Matrix formulations for structural stiffness, coordinate transformations, and system equations.
- Finite Element Analysis: Element and global matrix operations, transformation matrices, and numerical solution procedures.
- Computer Graphics: Geometric transformations such as rotation, scaling, and translation using matrix representations.
- Linear Algebra: Linear transformations, systems of equations, and vector-space calculations.
- Numerical Methods: Computational algorithms and matrix-based numerical solutions.
- Machine Learning: Matrix operations in data processing, neural networks, and mathematical models.
- Physics: Coordinate transformations and mathematical representations of physical systems.
Frequently Asked Questions (FAQs)
1. What is matrix multiplication?
Matrix multiplication is an operation that combines two compatible matrices to produce a product matrix using the row-by-column multiplication rule.
2. What is the condition for multiplying two matrices?
The number of columns in the first matrix must equal the number of rows in the second matrix.
3. What is the resulting matrix dimension?
If matrix A has dimensions m×n and matrix B has dimensions n×p, their product AB has dimensions m×p.
4. Can rectangular matrices be multiplied?
Yes. Rectangular matrices can be multiplied as long as the number of columns in the first matrix equals the number of rows in the second matrix.
5. Is matrix multiplication commutative?
No. In general, AB is not equal to BA. The order of multiplication is important.
6. Is matrix multiplication associative?
Yes. Matrix multiplication is associative when the required dimensions are compatible: (AB)C = A(BC).
7. What is the difference between matrix multiplication and scalar multiplication?
Matrix multiplication combines two matrices using row-by-column calculations. Scalar multiplication multiplies every element of a matrix by a single number.
8. Can two matrices of different dimensions be multiplied?
Yes. They do not need to have identical dimensions. Their inner dimensions must match for multiplication in the selected order to be defined.
Multiply Matrices Online with SOCE
Use the SOCE Matrix Multiplication Calculator to simplify matrix multiplication problems and support your studies in linear algebra, engineering mathematics, and numerical methods.
Understanding matrix multiplication is essential for working with matrix addition, matrix transpose, matrix inverse, determinants, structural analysis, and finite element methods.
Explore more free mathematics and engineering tools at SOCE.