# Lesson: The Change of Coordinates Matrix

1 point

## Transcript

At the end of the previous lecture, we found the coordinates of the polynomial p(x) = 6 – 2x + 2(x-squared) with respect to two different bases. It happens that sometimes you will start with the coordinates for a vector with respect to one basis but want to get to the coordinates of the vector with respect to another basis.

Let’s look at another example of this. The set B, seen here, and the set C, seen here, are both bases for P2. Let’s suppose that p is a polynomial whose C-coordinates are [3; 2; 1]. Find the B-coordinates of p. The first step to finding the B-coordinates of p is to find what p actually is. Using the given C-coordinates of p, this is a straightforward calculation: p(x) = 3 times our first polynomial in C + 2 times the second polynomial in C + 1 times the third polynomial in C. Performing the calculation, we see that p(x) = 5 + 5x – x-squared.

So now, we simply need to find the B-coordinates of 5 + 5x – x-squared. That is, we need to find scalars t1, t2, and t3 such that 5 + 5x – x-squared = t1 times the first polynomial in B + t2 times the second polynomial in B + t3 times the third polynomial in B. Adding the right-hand side, we get that we need 5 + 5x – x-squared to equal t1 + (t1 + t2 – t3)x + (-t1 + t2 + 3t3)(x-squared). Setting the coefficients equal to each other, we see that we are looking for solutions to the following system of equations. To find the solution, we row reduce the augmented matrix, as seen here. From the last matrix, we see that t1 = 5, t2 = 1, and t3 = 1. So this means that the B-coordinates of p are [5; 1; 1].

In this example, we could have replaced the C-coordinates with any vector from R3, but the exact same steps would be used to lead us to the B-coordinates. So instead of doing these steps over and over, we can actually pack all this information into a single matrix that we multiply our coordinate vector by. In order to find this matrix, we first need to note the following fact.

Theorem 4.4.1: Let B be a basis for a finite-dimensional vector space V. Then for any x or y in V, and t in R, we have that the B-coordinates of (tx + y) equals (t times the B-coordinates of x) + the B-coordinates of y.

To prove this, we first let B be the set {v1 through vn}, and let the B-coordinates of x be [x1 through xn] and the B-coordinates of y be [y1 through yn]. Then we can use the fact that x = x1v1 + all the way through xnvn, and y = y1v1 + all the way through ynvn. Then tx + y = t(x1v1 + all the way through xnvn) + (y1v1 + all the way through ynvn), which equals (tx1v1 + all the way through txnvn) + (y1v1 + all the way through ynvn), which equals (tx1 + y1)v1 + all the way through to (txn + yn)vn. So we see that the B-coordinates for (tx + y) are [(tx1 + y1) through to (txn + yn)]. Well, this means that the B-coordinates of (tx + y) equal [(tx1 + y1) through (txn + yn)], which equals t[x1 through xn] + [y1 through yn], which is equal to (t times the B-coordinates of x) + the B-coordinates of y.

So how does this theorem help us? Well, suppose we have two bases, B = {v1 through vn} and C = {w1 through wn}, for a vector space V, and let x be a vector whose C-coordinates are [x1 through xn]. To find the B-coordinates of x, we use our theorem to note the following. The B-coordinates of x will be the B-coordinates of the vector x1w1 + all the way through xnwn. But our theorem says that we can pull our scalars out, so that this equals (x1 times the B-coordinates of w1) + all the way through (xn times the B-coordinates of wn). We can think of this as a matrix multiplication by saying we are multiplying the matrix whose columns are [the B-coordinates of w1 through the B-coordinates of wn] times the vector [x1 through xn]. That is to say, we multiply the matrix whose columns are [[w1]B through [wn]B] times [x]C. This means that to find the B-coordinates for x, we can multiply the C-coordinates by a matrix whose columns are the B-coordinates of the vectors in C. This leads us to the following definition.

Let B and C = {w1 through wn} both be bases for a vector space V. The matrix P whose columns are the B-coordinates of our C vectors is called the change of coordinates matrix from C-coordinates to B-coordinates, and it satisfies the equation the B-coordinates of x equal P times the C-coordinates of x.

To see this in action, let’s continue our example from before, and find the change of coordinates matrix from our C-coordinates to B-coordinates. To do this, we will need to find the B-coordinates for our C basis vectors—that is, the B-coordinates of 1 + x + x-squared, the B-coordinates of 1 – x – 2(x-squared), and the B-coordinates of 4x. To find our first B-coordinates, we will need to find scalars a1, a2, and a3 such that 1 + x + x-squared equals a1 times the first B polynomial + a2 times the second B polynomial + a3 times the third B polynomial. This means we need to find 1 + x + x-squared equal to a1 + (a1 + a2 – a3)x + (-a1 + a2 + 3a3)(x-squared). Well, this is equivalent to the following system.

Before we find the solution to this system, let’s set up the system we need to find our B-coordinates for the second C polynomial; we will need to find scalars b1, b2, and b3 such that 1 – x – 2(x-squared) equals b1 times the first B polynomial + b2 times the second B polynomial + b3 times the third B polynomial, which is equal to b1 + (b1 + b2 – b3)x + (-b1 + b2 + 3b3)(x-squared). Setting the coefficients equal, we see that this is equivalent to this system of equations.

For the third C polynomial, we need to find scalars c1, c2, and c3 such that 4x = c1 times the first B polynomial + c2 times our second B polynomial + c3 times our third B polynomial, which equals c1 + (c1 + c2 – c3)x + (-c1 + c2 + 3c3)(x-squared). This is equivalent to this system.

At this point, we see that all three of these systems have the same coefficient matrix, so instead of solving them individually, we can solve them simultaneously by row reducing the following triply augmented matrix. So we start with our coefficient matrix, [1, 0, 0; 1, 1, -1; -1, 1, 3], and then we add, augment a column for our first C polynomial, [1; 1; 1], augment the column for our second C polynomial, [1; -1; -2], and augment a column for our third C polynomial, [0; 4; 0]. Then we row reduce as usual, getting this matrix in reduced row echelon form.

Reading off the first augmented column, we see that we must have that a1 = 1, a2 = 1/2, and a3 = 1/2, so the B-coordinates of 1 + x + x-squared are [1; 1/2; 1/2]. Reading off the second augmented column, we see that b1 = 1, b2 = -7/4, and b3 = 1/4, so the B-coordinates of 1 – x – 2(x-squared) are [1; -7/4; 1/4]. And reading off the third augmented column, we see that c1 = 0, c2 = 3, and c3 = -1, so the B-coordinates of 4x are [0; 3; -1]. And this means that our change of coordinate matrix P is [1, 1, 0; 1/2, -7/4, 3; 1/2, 1/4, -1].

You’ll note, of course, that this change of coordinate matrix P is exactly the same as the right-hand side of the reduced row echelon form of our triply augmented matrix. We should also note that if we take P[3; 2; 1], we do, in fact, get [5; 1; 1], the same result we got in our original example.

Theorem 4.4.2: Let B and C both be bases for a finite-dimensional vector space V. Let P be the change of coordinate matrix from C-coordinates to B-coordinates. Then P is invertible, and P-inverse is the change of coordinates matrix from B-coordinates to C-coordinates.

To prove this, to see that P-inverse is the change of coordinates matrix from B-coordinates to C-coordinates, we simply note the following. If we take P-inverse times the B-coordinates of x, now this will equal (P-inverse)(P times the C-coordinates of x). Well, this equals ((P-inverse)P) times the C-coordinates of x, which is simply the identity matrix times the C-coordinates of x, which is, of course, the C-coordinates of x. And so we’ve shown that P-inverse times the B-coordinates of x equals the C-coordinates of x.

To see how we use this theorem, consider the following example. Let S be the standard basis for M(2, 2), and let B (this set) be another basis for M(2, 2). We want to find the change of coordinates matrix Q from B-coordinates to S-coordinates, and find the change of coordinates matrix P from S-coordinates to B-coordinates.

To find the change of coordinate matrix Q from B-coordinates to S-coordinates, we need to use the matrix whose first column is the S-coordinates of the first B matrix, second column is the S-coordinates of the second B matrix, third column is the S-coordinates of the third B matrix, and whose fourth column is the S-coordinates of the fourth B matrix. Well, we can find these coordinates without any calculations—that’s the joy of a standard basis. We easily see that the matrix [1, 2; 3, 1] has coordinates [1; 2; 3; 1], that the matrix [-1, 0; -1, 2] has standard coordinates [-1; 0; -1; 2], the matrix [3, 2; 8, -3] has standard coordinates [3; 2; 8; -3], and the matrix [-1, 4; 1, 7] has standard coordinates [-1; 4; 1; 7]. So our change of coordinates matrix Q from B-coordinates to standard coordinates is this.

Now, to find the change of coordinates matrix P from S-coordinates to B-coordinates, we can just use our theorem, which tells us that P must equal Q-inverse, and then we use the matrix inverse algorithm to find Q-inverse. So first, we’ll start with Q on the left and the identity matrix on the right. Row reduce—this is a large matrix, so it takes many steps. But eventually, we get to an identity matrix on the left and our matrix P, which is Q-inverse, on the right.