Serlo: EN: Matrix multiplication
{{#invoke:Mathe für Nicht-Freaks/Seite|oben}} In this article, you learn how to multiply matrices. We will see that matrix multiplication is equivalent to the composition of linear maps. We will also prove some properties of the matrix multiplication.
Introduction
How can we multiply matrices?
In the article on matrices of linear maps, we learned how we can use matrices to describe linear maps between finite-dimensional vector spaces and . This requires fixing a basis of and a basis of , with respect to which we can define the mapping matrix . In a plane of coordinates, this matrix descibes what the linear mapping does with a vector : Vorlage:Einrücken where is the coordinate mapping with respect to , which maps a vector to the coordinate vector with respect to . Similarly, is the coordinate mapping with respect to .
We can concatenate linear maps and by executing them one after the other, which results in a linear map . Can we define a suitable "concatenation" of matrices? By suitable, we mean that the "concatenation" of the matrices corresponding to and should become the matrix of the map . We will call this "concatenation" of the matrices also the matrix product since it will turn out to behave almost like a product of numbers.
For example, let's consider two matrices and with the corresponding linear mas Vorlage:Einrücken and Vorlage:Einrücken given by matrix-vector-multiplication. Then is the matrix of (with respect to the standard bases in and ), and is the matrix of (with respect to the standard bases in and ). The product of and should then be the matrix of .
However, in order to be able to execute the maps and one after the other, the target space of must be equal to the space on which is defined. This means that , i.e. . Therefore, the number of columns of must be equal to the number of rows of , otherwise we cannot define the product matrix .
Computing the product matrix
What is the product of and corresponding to the map ? To compute it, we need to calculate the images of the standard basis vectors under the map . They will form the columns of the matrix of , that is, the matrix .
We denote the entries of by and those of by , i.e. and . We also denote the desired matrix of by .
For and , the entry is given by the definition of the matrix representing by the -th entry of the vector . We can easily calculate it using the definition of and using the definition of matrix-vector-multiplication: Vorlage:Einrücken This defines all entries of the matrix and we conclude Vorlage:Einrücken This is exactly the product of the two matrices and .
Definition and rule of thumb
Mathematically, we can also understand matrix multiplication as an operation (just as the multiplication of real numbers).
Mathe für Nicht-Freaks: Vorlage:Definition
However, there is an important difference to the multiplication of real numbers: With matrices, we have to make sure that the dimensions of the matrices we want to multiply match. Mathe für Nicht-Freaks: Vorlage:Hinweis Mathe für Nicht-Freaks: Vorlage:Warnung

Rule of thumb: row times column
According to the definition, each entry in the product is the sum of the component-wise multiplication of the elements of the -th row of with the -th column of . This procedure can be remembered as row times column, as shown in the figure on the right.
Concrete example
Example 1
We consider the following two matrices and : Vorlage:Einrücken We are looking for the matrix product . This matrix has the form Vorlage:Einrücken We have to calculate the individual entries . We will do this here in detail for the entry . The calculation of the other entries works analogously.
According to the formula Vorlage:Einrücken
This calculation can also be seen as the "multiplication" of the 2nd row of with the 3rd column of . To illustrate this, we mark the entries from the sum in the matrices. We have the sum Vorlage:Einrücken These are the following entries in the matrices: Vorlage:Einrücken In this way, we can also determine the other entries of and obtain Vorlage:Einrücken
Example 2
We consider the following matrices and : Vorlage:Einrücken In this case, we can calculate both and . Let . Then is a -matrix . We calculate its only entry: Vorlage:Einrücken Thus, .
Let . Then is a -matrix. We can calculate the entries of by the scheme "row times column". For example, the first entry of is the first row of times the first column of , i.e. . If we do this with each entry, we get Vorlage:Einrücken
Example 3
In this example, we want to illustrate that the matrix multiplication really corresponds to "concatenating two matrices". That means, if we have two matrices and that we apply to a vector , then we always have . As an example, let and be the following matrices with entries in : Vorlage:Einrücken Let further . We check that . To do so, we first calculate the matrix product : Vorlage:Einrücken Now we multiply this matrix with : Vorlage:Einrücken Next, we compute . Vorlage:Einrücken We now apply to this vector: Vorlage:Einrücken Indeed, here we have .
Properties of matrix multiplication
We now collect a few properties of the matrix multiplication.
Shortening rule for matrices representing linear maps
The following theorem shows that matrix multiplication actually reflects the composition of linear mappings. Mathe für Nicht-Freaks: Vorlage:Satz
Mathe für Nicht-Freaks: Vorlage:Warnung
Associativity of matrix multiplication
Mathe für Nicht-Freaks: Vorlage:Satz
Compatibility with scalar multiplication
Mathe für Nicht-Freaks: Vorlage:Satz
Distributivity of matrix multiplication
Here we must be careful that the sizes of the matrices are compatible.
Mathe für Nicht-Freaks: Vorlage:Satz
Mathe für Nicht-Freaks: Vorlage:Satz
Left and right neutral element of matrix multiplication
We denote the entries of the unit matrix with , i.e. . Then Vorlage:Einrücken
Mathe für Nicht-Freaks: Vorlage:Satz
Non-commutativity
Mathe für Nicht-Freaks: Vorlage:Beispiel
Mathe für Nicht-Freaks: Vorlage:Warnung
Further reading
Mathe für Nicht-Freaks: Vorlage:Hinweis
{{#invoke:Mathe für Nicht-Freaks/Seite|unten}}