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.
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.
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.
- 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.
- 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.
- 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\).
- 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.
- If \(\mathbf{x}\) is orthogonal to every vector in \(W\), what does the orthonormal-basis formula give for its projection onto \(W\)?