Tutorials › Linear Algebra › Solving for Coordinates in Rn

Coordinates and Change of Basis · Tutorial 372 of 1000

Solving for Coordinates in Rn

Use the basis vectors as matrix columns, solve the resulting system, and verify that the coordinate vector reconstructs the original vector.

Intermediate 10 min read

What You'll Learn

  • Form the basis matrix by placing the ordered basis vectors in its columns.
  • Translate the definition of coordinates into the equation \(\mathbf{B}\mathbf{c}=\mathbf{v}\).
  • Solve for coordinates by row-reducing the augmented matrix.
  • Explain why a basis guarantees a unique solution.
  • Check a coordinate answer by multiplying the basis matrix by the coordinate vector.
  • Identify and correct the mistake of arranging basis vectors as rows.

From Coordinates to a Linear System

An ordered basis gives each vector a unique list of coefficients. To find that list in \(\mathbb{R}^n\), use the basis vectors to build a matrix and solve a system. This turns the definition of coordinates into a familiar calculation, while also making clear why the answer exists and why it is unique.

Let \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) be an ordered basis of \(\mathbb{R}^n\). A basis is a list that is linearly independent and spans the space: every vector is a linear combination of the list, and that combination is unique. The coordinate vector \([\mathbf{v}]_{\mathcal{B}}\) records the coefficients in this combination. Define the basis matrix by placing the basis vectors, in their given order, as columns:

$$ \mathbf{B}= \begin{bmatrix} \mathbf{b}_1&\cdots&\mathbf{b}_n \end{bmatrix}. $$

If \(\mathbf{c}=(c_1,\dots,c_n)^\top\), matrix multiplication gives \(\mathbf{B}\mathbf{c}=c_1\mathbf{b}_1+\cdots+c_n\mathbf{b}_n\). Thus finding the coordinates of \(\mathbf{v}\) means finding the coefficients that make this combination equal to \(\mathbf{v}\).

Definition: For an ordered basis \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) of \(\mathbb{R}^n\), its basis matrix is \(\mathbf{B}=[\mathbf{b}_1\ \cdots\ \mathbf{b}_n]\). The coordinate vector \([\mathbf{v}]_{\mathcal{B}}\) is the unique column \(\mathbf{c}\) satisfying \(\mathbf{B}\mathbf{c}=\mathbf{v}\), or, equivalently, \(\mathbf{v}=c_1\mathbf{b}_1+\cdots+c_n\mathbf{b}_n\).
Theorem (Coordinate system from a basis): If the columns of \(\mathbf{B}\in\mathbb{R}^{n\times n}\) form an ordered basis of \(\mathbb{R}^n\), then for each \(\mathbf{v}\in\mathbb{R}^n\), the system \(\mathbf{B}\mathbf{c}=\mathbf{v}\) has exactly one solution. That solution is \([\mathbf{v}]_{\mathcal{B}}\).

Proof. Since the columns of \(\mathbf{B}\) span \(\mathbb{R}^n\), there are scalars \(c_1,\dots,c_n\) such that \(\mathbf{v}=c_1\mathbf{b}_1+\cdots+c_n\mathbf{b}_n\). With \(\mathbf{c}=(c_1,\dots,c_n)^\top\), the definition of matrix multiplication gives \(\mathbf{B}\mathbf{c}=\mathbf{v}\), so a solution exists. If both \(\mathbf{c}\) and \(\mathbf{d}\) solve the system, then \(\mathbf{B}\mathbf{c}=\mathbf{B}\mathbf{d}\), so \(\mathbf{B}(\mathbf{c}-\mathbf{d})=\mathbf{0}\). This is a linear combination of the columns of \(\mathbf{B}\) equal to \(\mathbf{0}\). Their linear independence forces every entry of \(\mathbf{c}-\mathbf{d}\) to be zero, so \(\mathbf{c}=\mathbf{d}\). The unique solution is exactly the coefficient list in the basis expansion, which is \([\mathbf{v}]_{\mathcal{B}}\). \(\square\)

Solving with an Augmented Matrix

To find the coordinates in practice, attach \(\mathbf{v}\) as the right-hand column and row-reduce the augmented matrix \([\mathbf{B}\mid\mathbf{v}]\). Apply every row operation to the whole augmented matrix. Because the basis columns are independent, the coefficient matrix has a pivot in every column; in this square case its reduced row echelon form is the identity matrix. The final augmented column then displays the coordinates.

1
Build the basis matrix.
Put the ordered basis vectors in columns, not rows.
2
Append the target vector.
Form \([\mathbf{B}\mid\mathbf{v}]\) to encode \(\mathbf{B}\mathbf{c}=\mathbf{v}\).
3
Row-reduce the augmented matrix.
Use the same row operations on every column, including the right-hand side.
4
Read and check the answer.
When the left block is \(\mathbf{I}_n\), the right-hand column is \([\mathbf{v}]_{\mathcal{B}}\). Multiply it by \(\mathbf{B}\) to verify the result.
Theorem (Why the augmented-matrix method works): If \(\mathbf{B}\in\mathbb{R}^{n\times n}\) has basis vectors as its columns, row-reducing \([\mathbf{B}\mid\mathbf{v}]\) gives \([\mathbf{I}_n\mid[\mathbf{v}]_{\mathcal{B}}]\).

Proof. Row operations preserve the solution set of a linear system: swapping equations, multiplying an equation by a nonzero scalar, or adding a multiple of one equation to another produces an equivalent system. Therefore row-reducing \([\mathbf{B}\mid\mathbf{v}]\) does not change the solutions for \(\mathbf{c}\). When \(\mathbf{B}\) is row-reduced, every column must have a pivot. Otherwise, a variable in a column without a pivot is free in the homogeneous system \(\mathbf{B}\mathbf{x}=\mathbf{0}\). Set one such free variable to \(1\), set the other free variables to \(0\), and solve for the pivot variables. This produces a nonzero solution, contradicting the linear independence of the columns. There are \(n\) columns and \(n\) rows, so \(n\) pivots give the identity matrix in reduced row echelon form. The reduced augmented system is consequently \(\mathbf{I}_n\mathbf{c}=\mathbf{d}\), where \(\mathbf{d}\) is its final column. Its unique solution is \(\mathbf{c}=\mathbf{d}\); by the coordinate-system theorem, this is \([\mathbf{v}]_{\mathcal{B}}\). \(\square\)

Worked Coordinate Calculations

Worked Example: Coordinates in a Three-Vector Basis

Let \(\mathcal{B}=(\mathbf{b}_1,\mathbf{b}_2,\mathbf{b}_3)\), where \(\mathbf{b}_1=(1,0,1)^\top\), \(\mathbf{b}_2=(1,1,0)^\top\), and \(\mathbf{b}_3=(0,1,1)^\top\). Find the coordinates of \(\mathbf{v}=(1,2,5)^\top\).

The basis matrix has the vectors as columns. To verify that they form a basis, reduce \(\mathbf{B}\) to the identity:

$$ \begin{bmatrix}1&1&0\\0&1&1\\1&0&1\end{bmatrix} \xrightarrow{R_3\to R_3-R_1} \begin{bmatrix}1&1&0\\0&1&1\\0&-1&1\end{bmatrix} \xrightarrow{R_3\to R_3+R_2} \begin{bmatrix}1&1&0\\0&1&1\\0&0&2\end{bmatrix} \xrightarrow{R_3\to \frac12R_3} \begin{bmatrix}1&1&0\\0&1&1\\0&0&1\end{bmatrix} \xrightarrow{\substack{R_2\to R_2-R_3\\R_1\to R_1-R_2}} \mathbf{I}_3. $$

Now row-reduce the augmented matrix to solve \(\mathbf{B}\mathbf{c}=\mathbf{v}\):

$$ \begin{bmatrix}1&1&0&1\\0&1&1&2\\1&0&1&5\end{bmatrix} \xrightarrow{R_3\to R_3-R_1} \begin{bmatrix}1&1&0&1\\0&1&1&2\\0&-1&1&4\end{bmatrix} \xrightarrow{R_3\to R_3+R_2} \begin{bmatrix}1&1&0&1\\0&1&1&2\\0&0&2&6\end{bmatrix} \xrightarrow{R_3\to \frac12R_3} \begin{bmatrix}1&1&0&1\\0&1&1&2\\0&0&1&3\end{bmatrix}. $$

Next, use \(R_2\to R_2-R_3\) and \(R_1\to R_1-R_2\). This gives

$$ \begin{bmatrix}1&1&0&1\\0&1&1&2\\0&0&1&3\end{bmatrix} \sim \begin{bmatrix}1&0&0&2\\0&1&0&-1\\0&0&1&3\end{bmatrix}. $$

The final column gives \([\mathbf{v}]_{\mathcal{B}}=(2,-1,3)^\top\). Check: \(2\mathbf{b}_1-\mathbf{b}_2+3\mathbf{b}_3=(2,0,2)^\top+(-1,-1,0)^\top+(0,3,3)^\top=(1,2,5)^\top=\mathbf{v}\).

Worked Example: A Two-Vector Basis and a Different Target

Let \(\mathcal{C}=((2,1)^\top,(1,1)^\top)\) and \(\mathbf{w}=(5,3)^\top\). Find \([\mathbf{w}]_{\mathcal{C}}\).

The basis matrix is \(\mathbf{C}=\begin{bmatrix}2&1\\1&1\end{bmatrix}\). Its columns form a basis because the following row operations reduce it to \(\mathbf{I}_2\):

$$ \begin{bmatrix}2&1\\1&1\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}1&1\\2&1\end{bmatrix} \xrightarrow{R_2\to R_2-2R_1} \begin{bmatrix}1&1\\0&-1\end{bmatrix} \xrightarrow{R_2\to -R_2} \begin{bmatrix}1&1\\0&1\end{bmatrix} \xrightarrow{R_1\to R_1-R_2} \mathbf{I}_2. $$

Append \(\mathbf{w}\) and perform those operations on the augmented matrix:

$$ \begin{bmatrix}2&1&5\\1&1&3\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}1&1&3\\2&1&5\end{bmatrix} \xrightarrow{R_2\to R_2-2R_1} \begin{bmatrix}1&1&3\\0&-1&-1\end{bmatrix} \xrightarrow{R_2\to -R_2} \begin{bmatrix}1&1&3\\0&1&1\end{bmatrix} \xrightarrow{R_1\to R_1-R_2} \begin{bmatrix}1&0&2\\0&1&1\end{bmatrix}. $$

Therefore \([\mathbf{w}]_{\mathcal{C}}=(2,1)^\top\). Check: \(2(2,1)^\top+1(1,1)^\top=(4,2)^\top+(1,1)^\top=(5,3)^\top=\mathbf{w}\).

Worked Example: Row Swapping and Fractional Coordinates

Let \(\mathcal{D}=((0,1,1)^\top,(1,1,0)^\top,(1,0,1)^\top)\), and let \(\mathbf{u}=(1,-\tfrac12,\tfrac52)^\top\). Find its coordinates in \(\mathcal{D}\).

The basis matrix is \(\mathbf{D}=\begin{bmatrix}0&1&1\\1&1&0\\1&0&1\end{bmatrix}\). Its rows can be reduced to the identity: swap \(R_1,R_2\), then use \(R_3\to R_3-R_1\), \(R_3\to R_3+R_2\), \(R_3\to \tfrac12R_3\), \(R_2\to R_2-R_3\), and \(R_1\to R_1-R_2\). Thus its columns form a basis. Applying the same operations to the augmented matrix gives

$$ \begin{bmatrix}0&1&1&1\\1&1&0&-\frac12\\1&0&1&\frac52\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}1&1&0&-\frac12\\0&1&1&1\\1&0&1&\frac52\end{bmatrix} \xrightarrow{R_3\to R_3-R_1} \begin{bmatrix}1&1&0&-\frac12\\0&1&1&1\\0&-1&1&3\end{bmatrix} \xrightarrow{R_3\to R_3+R_2} \begin{bmatrix}1&1&0&-\frac12\\0&1&1&1\\0&0&2&4\end{bmatrix}. $$

Now apply \(R_3\to \tfrac12R_3\), \(R_2\to R_2-R_3\), and \(R_1\to R_1-R_2\):

$$ \begin{bmatrix}1&1&0&-\frac12\\0&1&1&1\\0&0&2&4\end{bmatrix} \sim \begin{bmatrix}1&0&0&\frac12\\0&1&0&-1\\0&0&1&2\end{bmatrix}. $$

Hence \([\mathbf{u}]_{\mathcal{D}}=(\tfrac12,-1,2)^\top\). Check: \(\tfrac12(0,1,1)^\top-(1,1,0)^\top+2(1,0,1)^\top=(1,-\tfrac12,\tfrac52)^\top=\mathbf{u}\).

Common Mistake: Putting the Basis Vectors in Rows

The columns of the basis matrix must match the order in the basis list. A concrete example shows why. Take \(\mathcal{E}=((1,0)^\top,(1,1)^\top)\) and \(\mathbf{z}=(3,2)^\top\). The correct basis matrix is \(\begin{bmatrix}1&1\\0&1\end{bmatrix}\), so the coordinate equation is \(c_1+c_2=3\), \(c_2=2\). It gives \(c_2=2\), then \(c_1=1\). Indeed, \(1(1,0)^\top+2(1,1)^\top=(3,2)^\top\).

A wrong calculation places the basis vectors in rows and solves \(\begin{bmatrix}1&0\\1&1\end{bmatrix}\mathbf{c}=\mathbf{z}\). This gives \(c_1=3\) and \(c_1+c_2=2\), hence \(\mathbf{c}=(3,-1)^\top\). But using the actual basis vectors, \(3(1,0)^\top-1(1,1)^\top=(2,-1)^\top\), not \(\mathbf{z}\). The correction is to make the basis vectors the columns, then verify the computed coefficients by reconstructing the target vector.

Also keep the order fixed. Swapping two columns corresponds to swapping the associated basis vectors; if the list order changes, the coordinate entries change in the same way. Coordinates are not just an unordered collection of coefficients. The reconstruction check, \(\mathbf{B}[\mathbf{v}]_{\mathcal{B}}=\mathbf{v}\), tests both the values and their placement.

Why This Method Is Useful

The equation \(\mathbf{B}\mathbf{c}=\mathbf{v}\) separates two things that can otherwise be confused: \(\mathbf{v}\) is the vector being described in the usual column form, while \(\mathbf{c}\) is its coefficient list relative to the chosen ordered basis. The entries of \(\mathbf{c}\) need not equal the entries of \(\mathbf{v}\). They answer a different question: how much of each basis vector is needed to build \(\mathbf{v}\)?

The method also provides two independent checks on a calculation. First, the reduced augmented matrix should have the identity in its coefficient block when the columns are a basis of \(\mathbb{R}^n\). Second, multiplying the proposed coordinates by the basis matrix must recover the original vector. If either check fails, revisit the column order, the row operations, and the arithmetic. For a vector \(\mathbf{0}\), the coordinates are the zero column, since \(\mathbf{B}\mathbf{0}=\mathbf{0}\) and the basis theorem guarantees that this solution is unique.

Check Your Understanding

For each coordinate problem, form the basis matrix with columns in the stated order, solve, and check by reconstruction.

  1. For \(\mathcal{B}=((1,0)^\top,(1,2)^\top)\), find the coordinates of \((4,6)^\top\).
  2. For \(\mathcal{C}=((1,1,0)^\top,(0,1,1)^\top,(1,0,1)^\top)\), find the coordinates of \((2,3,4)^\top\).
  3. Explain why a basis of \(\mathbb{R}^n\) makes \(\mathbf{B}\mathbf{c}=\mathbf{v}\) have at least one solution and at most one solution.
  4. For the ordered basis \(((1,0)^\top,(1,1)^\top)\), identify the error in using \(\begin{bmatrix}1&0\\1&1\end{bmatrix}\) as the basis matrix.
  5. What coordinate vector represents \(\mathbf{0}\) in any ordered basis, and why can no other coordinate vector represent it?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon