In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix, known as the matrix product, has the number of rows of the first and the number of columns of the second matrix. The product of matrices and is denoted as .
Matrix multiplication was first described by the French mathematician Jacques Philippe Marie Binet in 1812, to represent the composition of linear maps that are represented by matrices. Matrix multiplication is thus a basic tool of linear algebra, and as such has numerous applications in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering. Computing matrix products is a central operation in all computational applications of linear algebra.
Notation
This article will use the following notational conventions: matrices are represented by capital letters in bold, e.g. ; vectors in lowercase bold, e.g. ; and entries of vectors and matrices are italic (they are numbers from a field), e.g. and . Index notation is often the clearest way to express definitions, and is used as standard in the literature. The entry in row , column of matrix is indicated by , or . In contrast, a single subscript, e.g. , is used to select a matrix (not a matrix entry) from a collection of matrices.
Definition
If is an matrix and is an matrix,
the matrix product (denoted without multiplication signs or dots) is defined to be the matrix
such that
for and .
That is, the entry of the product is obtained by multiplying term-by-term the entries of the th row of and the th column of , and summing these products. In other words, is the dot product of the th row of and the th column of .
Therefore, can also be written as
Thus the product is defined if and only if the number of columns in equals the number of rows in , in this case .
In most scenarios, the entries are numbers, but they may be any kind of mathematical objects for which an addition and a multiplication are defined, that are associative, and such that the addition is commutative, and the multiplication is distributive with respect to the addition. In particular, the entries may be matrices themselves (see block matrix).
Illustration
The figure to the right illustrates diagrammatically the product of two matrices and , showing how each intersection in the product matrix corresponds to a row of and a column of .
The values at the intersections, marked with circles in figure to the right, are:
Fundamental applications
Historically, matrix multiplication has been introduced for facilitating and clarifying computations in linear algebra. This strong relationship between matrix multiplication and linear algebra remains fundamental in all mathematics, as well as in physics, chemistry, engineering and computer science.
Linear maps
If a vector space has a finite basis, its vectors are each uniquely represented by a finite sequence of scalars, called a coordinate vector, whose elements are the coordinates of the vector on the basis. These coordinate vectors form another vector space, which is isomorphic to the original vector space. A coordinate vector is commonly organized as a column matrix (also called a column vector), which is a matrix with only one column. So, a column vector represents both a coordinate vector, and a vector of the original vector space.
A linear map from a vector space of dimension into a vector space of dimension maps a column vector
onto the column vector
The linear map is thus defined by the matrix
and maps the column vector to the matrix product
If is another linear map from the preceding vector space of dimension , into a vector space of dimension , it is represented by a matrix A straightforward computation shows that the matrix of the composite map is the matrix product The general formula ) that defines the function composition is instanced here as a specific case of associativity of matrix product (see below):
Geometric rotations
Using a Cartesian coordinate system in a Euclidean plane, the rotation by an angle around the origin is a linear map. More precisely,
where the source point and its image are written as column vectors.
The composition of the rotation by and that by then corresponds to the matrix product
where appropriate trigonometric identities are employed for the second equality. That is, the composition corresponds to the rotation by angle , as expected.