Tutorials › Linear Algebra › Coordinates From Projection Onto An Orthonormal Basis

Orthogonal Complements and Projections · Tutorial 669 of 1000

Coordinates From Projection Onto An Orthonormal Basis

Learn to compute a subspace projection from an orthonormal basis and interpret the resulting coefficients as coordinates in that basis.

Intermediate 10 min read

What You'll Learn

  • State the projection formula for a subspace with an orthonormal basis.
  • Explain why inner products with the basis vectors give coordinates.
  • Distinguish coordinates of a projection from coordinates of the original vector.
  • Verify projections by checking that the residual is orthogonal to the subspace.
  • Recognize why the same formula cannot be used unchanged with an unnormalized orthogonal list.

Projection Coefficients as Coordinates

A projection onto a subspace can be described by its components along an orthonormal basis of that subspace. The key simplification is that each component is read off with one inner product: no system of equations is needed. Those inner products are not merely ingredients in the computation; they are the coordinates of the projected vector in the chosen basis.

Let \(V\) be a finite-dimensional inner product space over \(\mathbb{R}\) or \(\mathbb{C}\), with inner product linear in the first slot. In \(\mathbb{R}^n\), this is the usual dot product. An ordered list \(\mathcal{B}=(\mathbf{q}_1,\dots,\mathbf{q}_k)\) is an orthonormal basis of a subspace \(W\) if it spans \(W\) and satisfies \(\langle\mathbf{q}_i,\mathbf{q}_j\rangle=0\) for \(i\ne j\) and \(\langle\mathbf{q}_i,\mathbf{q}_i\rangle=1\) for each \(i\). The order matters because coordinates are listed in that order.

Theorem (Projection formula for an orthonormal basis): Let \(W\) be a finite-dimensional subspace of an inner product space \(V\), and let \(\mathcal{B}=(\mathbf{q}_1,\dots,\mathbf{q}_k)\) be an orthonormal basis of \(W\). For any \(\mathbf{x}\in V\), the projection \(\mathbf{p}\in W\) for which \(\mathbf{x}-\mathbf{p}\) is orthogonal to every vector in \(W\) is $$ \mathbf{p}=\sum_{i=1}^{k}\langle\mathbf{x},\mathbf{q}_i\rangle\mathbf{q}_i. $$ Moreover, its coordinate vector in this basis is $$ [\mathbf{p}]_{\mathcal{B}}= \begin{bmatrix} \langle\mathbf{x},\mathbf{q}_1\rangle\\ \vdots\\ \langle\mathbf{x},\mathbf{q}_k\rangle \end{bmatrix}. $$

Proof. Define \(\mathbf{p}\) by the displayed sum. It is in \(W\) because it is a linear combination of the basis vectors of \(W\). For each \(j\), orthonormality gives $$ \langle\mathbf{p},\mathbf{q}_j\rangle =\sum_{i=1}^{k}\langle\mathbf{x},\mathbf{q}_i\rangle\langle\mathbf{q}_i,\mathbf{q}_j\rangle =\langle\mathbf{x},\mathbf{q}_j\rangle. $$ Here the inner product is linear in the first slot, so the coefficient \(\langle\mathbf{x},\mathbf{q}_i\rangle\) factors out as written. Therefore \(\langle\mathbf{x}-\mathbf{p},\mathbf{q}_j\rangle=0\) for every \(j\). Every \(\mathbf{w}\in W\) has the form \(\sum_{j=1}^{k}a_j\mathbf{q}_j\); conjugate-linearity in the second slot gives \(\langle\mathbf{x}-\mathbf{p},\mathbf{w}\rangle=\sum_{j=1}^{k}\overline{a_j}\langle\mathbf{x}-\mathbf{p},\mathbf{q}_j\rangle=0\). Thus the residual is orthogonal to all of \(W\). The coefficients in the defining sum are the coordinates of \(\mathbf{p}\), because \(\mathcal{B}\) is a basis and coordinates are the unique coefficients in a basis expansion. \(\square\)

If \(W=\{\mathbf{0}\}\), the basis is the empty list and the sum is the empty sum, equal to \(\mathbf{0}\). Its coordinate list is empty. The formula therefore covers this case as well.

Why These Coefficients Are the Right Ones

The formula follows from two defining properties. First, the projected vector must lie in \(W\), so it must be expressible using the basis vectors. Second, the difference from the original vector must be orthogonal to \(W\). Taking an inner product with \(\mathbf{q}_j\) isolates the \(j\)th coefficient because \(\mathbf{q}_j\) has inner product \(1\) with itself and \(0\) with every other basis vector.

Corollary: With the hypotheses of the theorem, the vector \(\mathbf{p}\) is the unique vector in \(W\) whose difference from \(\mathbf{x}\) is orthogonal to \(W\). If \(\mathbf{x}\in W\), then \([\mathbf{x}]_{\mathcal{B}}\) has entries \(\langle\mathbf{x},\mathbf{q}_i\rangle\); for a general \(\mathbf{x}\in V\), those entries are instead the coordinates of its projection onto \(W\).

Proof. Suppose \(\mathbf{p}\) and \(\mathbf{p}'\) both lie in \(W\), and both \(\mathbf{x}-\mathbf{p}\) and \(\mathbf{x}-\mathbf{p}'\) are orthogonal to \(W\). Their difference \(\mathbf{p}-\mathbf{p}'\) lies in \(W\), and it is also orthogonal to \(W\), since it equals \((\mathbf{x}-\mathbf{p}')-(\mathbf{x}-\mathbf{p})\). Hence it is orthogonal to itself. Positive definiteness of the inner product implies \(\langle\mathbf{p}-\mathbf{p}',\mathbf{p}-\mathbf{p}'\rangle=0\) only when \(\mathbf{p}-\mathbf{p}'=\mathbf{0}\). Thus \(\mathbf{p}=\mathbf{p}'\). If \(\mathbf{x}\in W\), its projection is \(\mathbf{x}\), because \(\mathbf{x}-\mathbf{x}=\mathbf{0}\) is orthogonal to \(W\); the coordinate statement then follows from the theorem. \(\square\)

This distinction matters: when \(\mathbf{x}\) is outside \(W\), the coefficient list does not give coordinates for \(\mathbf{x}\) in \(\mathcal{B}\), since \(\mathcal{B}\) is a basis of \(W\), not necessarily of the whole space \(V\). It gives coordinates for the particular vector \(\mathbf{p}\in W\).

Computing and Checking the Projection

Worked Example: Coordinates in an Orthonormal Basis of \(\mathbb{R}^2\)

Let \(W=\mathbb{R}^2\) and use the ordered basis $$ \mathcal{B}=(\mathbf{q}_1,\mathbf{q}_2),\qquad \mathbf{q}_1=\begin{bmatrix}3/5\\4/5\end{bmatrix},\quad \mathbf{q}_2=\begin{bmatrix}-4/5\\3/5\end{bmatrix}. $$ For \(\mathbf{x}=\begin{bmatrix}2\\-1\end{bmatrix}\), find the projection and its coordinates.

Check the basis first. The squared norms are \((9+16)/25=1\) for \(\mathbf{q}_1\) and \((16+9)/25=1\) for \(\mathbf{q}_2\), while their dot product is \((-12+12)/25=0\). Since there are two orthonormal vectors in \(\mathbb{R}^2\), they span \(\mathbb{R}^2\). The coefficients are $$ \langle\mathbf{x},\mathbf{q}_1\rangle =2(3/5)-1(4/5)=2/5,\qquad \langle\mathbf{x},\mathbf{q}_2\rangle =2(-4/5)-1(3/5)=-11/5. $$ Thus the coordinate vector and reconstructed projection are $$ [\mathbf{p}]_{\mathcal{B}}= \begin{bmatrix}2/5\\-11/5\end{bmatrix}, \qquad \mathbf{p}=\frac25\begin{bmatrix}3/5\\4/5\end{bmatrix} -\frac{11}{5}\begin{bmatrix}-4/5\\3/5\end{bmatrix} =\begin{bmatrix}2\\-1\end{bmatrix}. $$ The projection is \(\mathbf{x}\), as expected because \(W=\mathbb{R}^2\).

Check: The reconstructed vector equals \(\mathbf{x}\), and its inner products with \(\mathbf{q}_1,\mathbf{q}_2\) are \(2/5,-11/5\), respectively. These are exactly the displayed coordinates.

Worked Example: Projection onto a Plane in \(\mathbb{R}^3\)

Let \(W\) be spanned by $$ \mathbf{q}_1=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\\0\end{bmatrix}, \qquad \mathbf{q}_2=\frac{1}{\sqrt{6}}\begin{bmatrix}1\\-1\\2\end{bmatrix}, $$ and project \(\mathbf{x}=\begin{bmatrix}2\\0\\3\end{bmatrix}\) onto \(W\).

The squared norms of the two vectors are \((1+1)/2=1\) and \((1+1+4)/6=1\); their inner product is \((1-1+0)/\sqrt{12}=0\). They form an orthonormal basis of \(W\). The two coefficients are $$ \langle\mathbf{x},\mathbf{q}_1\rangle=\frac{2}{\sqrt{2}}=\sqrt{2}, \qquad \langle\mathbf{x},\mathbf{q}_2\rangle=\frac{2+0+6}{\sqrt{6}}=\frac{8}{\sqrt{6}}. $$ Consequently, $$ \mathbf{p}=\sqrt{2}\mathbf{q}_1+\frac{8}{\sqrt{6}}\mathbf{q}_2 =\begin{bmatrix}1\\1\\0\end{bmatrix} +\frac{4}{3}\begin{bmatrix}1\\-1\\2\end{bmatrix} =\begin{bmatrix}7/3\\-1/3\\8/3\end{bmatrix}, \qquad [\mathbf{p}]_{\mathcal{B}}= \begin{bmatrix}\sqrt{2}\\8/\sqrt{6}\end{bmatrix}. $$

Check: The residual is $$ \mathbf{x}-\mathbf{p}= \begin{bmatrix}-1/3\\1/3\\1/3\end{bmatrix}. $$ Its dot product with \(\mathbf{q}_1\) is \((-1/3+1/3)/\sqrt{2}=0\), and its dot product with \(\mathbf{q}_2\) is \((-1/3-1/3+2/3)/\sqrt{6}=0\). Since the basis spans \(W\), the residual is orthogonal to all of \(W\). The coefficients also reconstruct \(\mathbf{p}\) by the displayed basis expansion.

Worked Example: Projection onto a Line

Let \(W\) be the line spanned by the unit vector $$ \mathbf{q}=\frac13\begin{bmatrix}1\\2\\2\end{bmatrix} $$ and let \(\mathbf{x}=\begin{bmatrix}2\\-1\\4\end{bmatrix}\). Find the projection and its one coordinate.

The squared norm of \(\mathbf{q}\) is \((1+4+4)/9=1\). Its inner product with \(\mathbf{x}\) is $$ \langle\mathbf{x},\mathbf{q}\rangle=\frac{2-2+8}{3}=\frac83. $$ Therefore $$ \mathbf{p}=\frac83\mathbf{q} =\begin{bmatrix}8/9\\16/9\\16/9\end{bmatrix}, \qquad [\mathbf{p}]_{(\mathbf{q})}=\begin{bmatrix}8/3\end{bmatrix}. $$

Check: The residual is \(\mathbf{x}-\mathbf{p}=\begin{bmatrix}10/9\\-25/9\\20/9\end{bmatrix}\). Its dot product with \(\mathbf{q}\) is \((10-50+40)/27=0\). The projection lies on the line, and the residual is orthogonal to that line. Multiplying its coordinate by the basis vector gives \((8/3)\mathbf{q}=\mathbf{p}\).

What Changes for an Orthogonal List

Normalization is essential to the coefficient formula. For an orthonormal basis, each basis vector has squared norm \(1\), so the coefficient is just the inner product. If the vectors are orthogonal but not unit length, the coefficient along \(\mathbf{u}_i\) must instead be \(\langle\mathbf{x},\mathbf{u}_i\rangle/\langle\mathbf{u}_i,\mathbf{u}_i\rangle\). The denominator corrects for the vector's length. This is the distinction between an orthogonal list and an orthonormal one; the latter is the setting of the theorem above.

Common mistake: using the orthonormal formula on an unnormalized vector. Take \(\mathbf{u}=\begin{bmatrix}2\\0\end{bmatrix}\) and \(\mathbf{x}=\begin{bmatrix}3\\1\end{bmatrix}\). A mistaken calculation uses \(\langle\mathbf{x},\mathbf{u}\rangle=6\) as the coefficient and gives \(6\mathbf{u}=\begin{bmatrix}12\\0\end{bmatrix}\). But the residual \(\begin{bmatrix}-9\\1\end{bmatrix}\) has dot product \(-18\) with \(\mathbf{u}\), so it is not orthogonal to the line. The correct coefficient is \(6/\langle\mathbf{u},\mathbf{u}\rangle=6/4=3/2\), giving the projection \((3/2)\mathbf{u}=\begin{bmatrix}3\\0\end{bmatrix}\). Its residual is \(\begin{bmatrix}0\\1\end{bmatrix}\), whose dot product with \(\mathbf{u}\) is \(0\).

Using the Formula Reliably

For a given orthonormal basis, the calculation has a consistent order: compute one inner product for each basis vector, place those values in the basis order, and use the same values as multipliers in the basis expansion. A direct check catches both arithmetic and conceptual errors. Verify that the reconstructed vector lies in the subspace and that the residual has inner product zero with every basis vector. Since those vectors span the subspace, these checks establish residual orthogonality throughout the subspace.

Over \(\mathbb{C}\), keep the stated inner-product convention in mind. With the inner product linear in the first slot, the coefficient of \(\mathbf{q}_i\) is \(\langle\mathbf{x},\mathbf{q}_i\rangle\). Reversing the slots would conjugate this value; using the wrong slot can therefore give incorrect coefficients. In real spaces the inner product is symmetric, so this distinction does not change the numerical result.

Check Your Understanding

For each question, use the ordered basis as written and check any proposed projection by testing its residual.

  1. For \(\mathbf{q}_1=\begin{bmatrix}1\\0\end{bmatrix}\), \(\mathbf{q}_2=\begin{bmatrix}0\\1\end{bmatrix}\), and \(\mathbf{x}=\begin{bmatrix}-2\\5\end{bmatrix}\), find the projection onto their span and its coordinate vector.
  2. Let \(W\) be spanned by \(\frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\\0\end{bmatrix}\) and \(\begin{bmatrix}0\\0\\1\end{bmatrix}\). Project \(\begin{bmatrix}3\\1\\4\end{bmatrix}\) onto \(W\), and verify that the residual is orthogonal to both basis vectors.
  3. Explain why the inner products \(\langle\mathbf{x},\mathbf{q}_i\rangle\) are coordinates of the projection even when \(\mathbf{x}\) itself is not in \(W\).
  4. For \(\mathbf{u}=\begin{bmatrix}0\\3\end{bmatrix}\) and \(\mathbf{x}=\begin{bmatrix}2\\5\end{bmatrix}\), calculate the projection onto \(\operatorname{span}\{\mathbf{u}\}\), including the normalization factor.
  5. If \(\mathbf{x}\) is orthogonal to every vector in \(W\), what does the orthonormal-basis formula give for its projection onto \(W\)?

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