[Math] Finding the orthogonal projection of a vector on a subspace spanned by non-orthogonal vectors.

gram-schmidtlinear algebraprojectionvector-spaces

Given: $$ \textbf{x} = \begin{bmatrix} -1 \\3 \\ 3 \\ 1 \end{bmatrix}, \ \textbf{u} = \begin{bmatrix} 1 \\1 \\ 0 \\ 1 \end{bmatrix} \mathrm{and} \ \ \textbf{v}=\begin{bmatrix} 1 \\2 \\ 3 \\ 0 \end{bmatrix}$$
We're asked to find the orthogonal projection of $\textbf{x}$ w.r.t to the scalar product (or dot product) $\textbf{u} \cdot \textbf{v}$ on the subspace $W$ spanned by $\textbf{u}$ and $\textbf{v}$.

Here's my approach. Since $\textbf{u}$ and $\textbf{v}$ do not form an orthonormal basis, my first step was to find a new basis which is orthonormal and that spans the same subspace. For this, I used the Gram-Schmidt Process, giving me: $$\beta = \left\{\begin{bmatrix} 1/\sqrt3 \\1/\sqrt3 \\ 0 \\ 1/\sqrt3 \end{bmatrix}, \begin{bmatrix} 0 \\1/\sqrt{11} \\ 3/\sqrt{11} \\ -1/\sqrt{11} \end{bmatrix} \right\}$$ where $\beta$ is my new basis. From here, all I had to do is to apply the formula to find the projection of $\textbf{x}$, which gave me: $$ \mathrm{proj}_{W}(\textbf{x}) = \begin{bmatrix} 1 \\2 \\ 3 \\ 0 \end{bmatrix}$$

The result is correct. However, as you can see, the projection of $\textbf{x}$ on $W$ is the same as $\textbf{v}$. Is this a coincidence? If not, I was wondering if there was a simpler/quicker way to find that $ \mathrm{proj}_{W}(\textbf{x}) = \textbf{v}$.

Best Answer

Another standard way to find the orthogonal projection would be: set $$A := \begin{bmatrix} \mathbf{u} & \mathbf{v} \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & 2 \\ 0 & 3 \\ 1 & 0\end{bmatrix}.$$ Then, the process is to solve $A^T A \mathbf{y} = A^T \mathbf{x}$, then the projection will be $A \mathbf{y}$. (The fact that $A^T A$ is invertible follows from the fact that $\mathbf{u}$ and $\mathbf{v}$ are linearly independent.)

In this case, $$ A^T A = \begin{bmatrix} 3 & 3 \\ 3 & 14 \end{bmatrix}, ~ A^T \mathbf{x} = \begin{bmatrix} 3 \\ 14 \end{bmatrix},$$ so the solution $\mathbf{y}$ to $A^T A \mathbf{y} = A^T \mathbf{x}$ is $\begin{bmatrix} 0 \\ 1 \end{bmatrix}$ by inspection. Therefore, the orthogonal projection is $A \mathbf{y} = \mathbf{v}$.

(In case you haven't seen this before, the justification is: the orthonal projection would have to be some linear combination of $\mathbf{u}$ and $\mathbf{v}$, but the span of $\mathbf{u}$ and $\mathbf{v}$ is exactly the column space of $A$, or in other words $\{ A \mathbf{y} : \mathbf{y} \in \mathbb{R}^2 \}$. Now, the condition that $A \mathbf{y} - \mathbf{x}$ is orthogonal to both $\mathbf{u}$ and $\mathbf{v}$ is equivalent to $A^T (A \mathbf{y} - \mathbf{x}) = \mathbf{0}$.)

Related Question