# Projection of vector onto subspace

I am studying MIT open courseware linear algebra course. This is the question posed in one of the quiz:

If $q_1$ and $q_2$ are any orthonormal vectors in $\mathbb{R}^5$, give a formula for the projection $p$ of any vector $b$ onto the plane spanned by $q_1$ and $q_2$ (write $p$ as a combination of $q_1$ and $q_2$).

$$p=(q_1 T_b)q_1+(q_2 T_b)q_2$$

Can someone explain why is the answer this? I cannot seem to understand.

• Google "orthonormal basis", "orthogonal projection" and/or "Gram-Schmidt Process" Feb 3 '17 at 10:28

Since the vectors $q_1$ and $q_2$ are orthonormal, you can picture them as direction vectors in the plane spanned by them. The component of the vector $b$ in the direction $q_i$ is given by the inner product $<b,q_i>$. So, you get that the projection $p$ of $b$ to the plane spanned by $q_i$ where $q_i\in{1,2}$ is:

$p=\sum_{i}<b,q_i>q_i=<b,q_1>q_1+<b,q_2>q_2$

• Why multiplication by qi Feb 3 '17 at 10:45

Hints:

Denoting by $\;\langle,\rangle\;$ the usual inner (scalar) product in $\;\Bbb R^n\;$ , and using your notation, check that

$$V:=\text{Span}\,\{q_1,\,q_2\}\;,\;\;proj_Vb=\langle b,\,q_1\rangle\,q_1+\langle b,\,q_2\rangle\,q_2\implies V\perp(b-proj_vb)$$

Since $\;\{q_1,q_2\}\;$ is orthonormal, the above is simply the expression of a vector in $\;V\;$ which is the orthogonal projection of a general vector$\;b\in\Bbb R^n\;$ on the subspace $\;V\;$ , and such that $\;\left\|b-proj_Vb\right\|\;$ is the (minimal) distance (in the sense of the norm induced by the inner product) vector from $\;b\;$ to $\;V\;$ .