# Change of basis in Mathematica

I'm trying to set up a change of basis matrix from the base V -> W with the RowReduce function that's built into Mathematica. I am then supposed to verify the result by taking the product of the change of basis matrix and multiplying it with the co-ordinate vector for x. You can see the Bases and the vector x below.

So, my question is, how do I setup the change of basis matrix and then verify it, with just the RowReduce function? Thanks in advance.

V = {{1, 3}, {4, 6}}
W = {{4, 6}, {2, 5}}

x = {6, 6}

• Pleeeease. Don't use MatrixForm in computations. See here why. Moreover, it would be appreciated if you would post copyable Mathematica code instead of images. Dec 27 '18 at 13:29
• @HenrikSchumacher I'll edit the post then :) Dec 27 '18 at 13:31

This might give you an idea... I merge V and W into one matrix with ArrayFlatten and apply Gaussian elimination by RowReduce.

V = {{1, 3}, {4, 6}};
W = {{4, 6}, {2, 5}};
B = RowReduce[ArrayFlatten[{{V, W}}]][[All, 3 ;;]]
V.B == W


{{-3, -(7/2)}, {7/3, 19/6}}

True

• Ah, smart. Wasn't thinking about how you could compare the two functions that easily. Just one question though. What does the ArrayFlatten, and the [[All, 3 ;;]] commands mean? Thank you very much for your answer. Dec 27 '18 at 13:34
• ArrayFlatten can merge block matrices to a single matrix. And A[[All, 3 ;;]] reads off the columns 3 to Dimensions[A][[2]] of a matrix A. See the documentation of Part and Span for details. Dec 27 '18 at 13:36
• Ah, now I get it. Thank you so much. If i were to calculate the change of basis matrix from W -> V, using the Inverse function, would I first take the inverse of W, and then multiply W^1 * V? Dec 27 '18 at 13:51
• You're welcome. I'd rather use V.Inverse[W] or W.Inverse[V] depending on which direction you would like to have. Dec 27 '18 at 14:04
• Well, I'd like to know the change of basis matrix from the base W -> V, so how would the function look like? Dec 27 '18 at 14:16