### Matrix of a linear map

Matrices will be important for us for yet one more reason. It turns out that multiplying a matrix by a vector is actually the same as calculating a value of a linear map. Observe the following:

is exactly the same as .

More precisely, given a linear map , basis of and basis of , a matrix which multiplied from the right by a (vertical) vector of coordinates of a vector in basis will give the coordinates of in will be called the matrix of in basis and .

In particular in the above example:

is the matrix of in standard basis — and can be easily written out of the formula defining simply by writing its coefficients in rows.

### Changing bases of a matrix — first method: calculate coordinates.

Assume that we are given a formula defining , as above (or its matrix in the standard basis) and basis and . E.g.: and . We would like to calculate .

Notice that if we multiply this matrix from the right by (vertical) vector , then I will get simply the first column of this matrix. On the other hand the first vector from , namely vector , has in this basis coordinates 1,0,0. Therefore the result of the multiplication are the coordinates of in basis and this is the first column of .

So: and we have to find the coordinates of this vector in : , so the coordinates are 4,8 and this is the first column of the matrix we would like to calculate.

Let us find the second column. We do the same as before but with the second vector from basis . has coordinates 1,0 in .

The third column: has in coordinates , so

Therefore:

### Composing maps

Given two linear maps and we can compose them and consider a map which transforms a vector from first via and the result via getting a vector form .

Such a map is denoted as . Given formulas defining i we can easily get the formula for . E.g. consider as above and such that . Therefore .

Now look at the matrices of those maps. If is basis of , is basis and is basis of , then given coordinates of in to get the coordinates of in we have to first multiply it by matrix (we will get coordinates in ) and multiply the result by . Therefore we have multiplied the coordinates by , which means that:

Notice which bases have to agree in this formula!

In particular in our example:

which is consistent with the formula we have calculated before.

### Change-of-coordinates matrix

There is a special linear map, which we call the identity, which does nothing. For example, in it is . Therefore given two basis and , along with matrix if we multiply this matrix from the right by the coordinates of a vector in basis we will get the coordinates also of (as ), but in basis . So matrix changes the basis from to .

Especially we will need matrices changing basis from the standard basis to the given one and from the given basis to the standard one. Let’s check how to calculate them.

It is easy to calculate the change-of-coordinates matrix change from a given basis to the standard basis. We will find (basis is defined in the example above). After multiplying it from the right by we will get its first column. On the other hand the first vector in has in it coordinates 1,0,0, so the result of multiplication are the coordinates of this vector in the standard basis, so simply it is this vector. So simply the -th column of this matrix is the -th vector from the basis. Therefore:

Now, the other case: from the standard basis to a given basis. We will calculate . It can be easily seen that in columns we should put coordinates of vectors from the standard basis in the given basis. Let us calculate them: and . Therefore:

### Changing the basis of a matrix — the second method: multiplication by a change-of-coordinates matrix

We have a new tool to change basis of a matrix of a linear map. Because , we have that:

In particular:

and in this way given a matrix of a linear map in standard basis we can calculate its matrix in basis from to . In our example:

Obviously we get the same result as calculated by the first method.