# Orthogonal basis to find projection onto a subspace

I know that to find the projection of an element in R^n on a subspace W, we need to have an orthogonal basis in W, and then applying the formula formula for projections.
However, I don;t understand why we must have an orthogonal basis in W in order to calculate the projection of another vector onto W. Why can't we use just some normal basis in W. Is it to make the computation easier, or is there a deeper reason why we can't find projections without orthogonal bases?

Related Linear and Abstract Algebra News on Phys.org
andrewkirk
Homework Helper
Gold Member
It's not that we can't calculate the projection without an orthogonal basis for W, it's that the usual and simplest method of calculating that projection has to use an orthogonal basis. That method is as follows. Let ##B=\{\vec v_1,...,\vec v_m\}## be an orthogonal basis for subspace ##W## of vector space ##V## and let ##u\in V##.

Then the projection ##\pi_W(\vec u)## of ##\vec u## onto ##W## is:
$$\sum_{k=1}^m \vec v_k\frac{\vec u\cdot \vec v_k}{\|\vec v_k\|^2}$$

That formula doesn't work if ##B## is not orthogonal because it will double count some components of the projection vector, because the terms of that sum may not be mutually orthogonal. To convince yourself of that, try working out the projection of ##(1, 1, 1)## onto the vector space spanned by orthogonal basis ##(0,1,0),\ (0, 0,1)## and compare that with what you get when you use the above formula with non-orthogonal basis ##(0,1,0),\ (0, 1,1)##.

In most cases (possibly always?) it is possible to derive an orthogonal basis from a non-orthogonal one, so that the above method can be used.

Mr Davis 97
It's not that we can't calculate the projection without an orthogonal basis for W, it's that the usual and simplest method of calculating that projection has to use an orthogonal basis. That method is as follows. Let ##B=\{\vec v_1,...,\vec v_m\}## be an orthogonal basis for subspace ##W## of vector space ##V## and let ##u\in V##.

Then the projection ##\pi_W(\vec u)## of ##\vec u## onto ##W## is:
$$\sum_{k=1}^m \vec v_k\frac{\vec u\cdot \vec v_k}{\|\vec v_k\|^2}$$

That formula doesn't work if ##B## is not orthogonal because it will double count some components of the projection vector, because the terms of that sum may not be mutually orthogonal. To convince yourself of that, try working out the projection of ##(1, 1, 1)## onto the vector space spanned by orthogonal basis ##(0,1,0),\ (0, 0,1)## and compare that with what you get when you use the above formula with non-orthogonal basis ##(0,1,0),\ (0, 1,1)##.

In most cases (possibly always?) it is possible to derive an orthogonal basis from a non-orthogonal one, so that the above method can be used.
So how would you calculate the projection onto a subspace with a non-orthogonal basis? Is it usually the case that it is easier to find an orthogonal basis from a non-orthogonal basis and then use the formula you gave than it is to try to calculate the projection just from the original non-orthogonal basis?

andrewkirk
Homework Helper
Gold Member
Is it usually the case that it is easier to find an orthogonal basis from a non-orthogonal basis and then use the formula you gave than it is to try to calculate the projection just from the original non-orthogonal basis?
Yes, I'd just do that. I started thinking about a method in which I used the formula with the non-orthog basis and then proceeded to deduct the overlapping components. But then I realized that what I was doing was basically just the same as what one does when one converts a non-orthogonal basis to an orthogonal one.

To convert non-orthog basis ##\vec v_1,...,\vec v_m## to an orthogonal basis ##\vec u_1,...,\vec u_m##, just set
$$\vec u_1=\vec v_1$$
$$\forall k\in\{2,....,m\}:\ \vec u_k=\vec v_k-\sum_{j=1}^{k-1} \vec u_j\frac{\vec v_k\cdot \vec u_j}{\|\vec u_j\|^2}$$

Mr Davis 97
Erland
The method Erland described give raise to the following simple formula for the orthogonal projection: put vectors that form a basis in ##W## as columns in a matrix, call it ##A##. Then the matrix of the orthogonal projection ##P_W## is given by $$P_W= A(A^TA)^{-1}A^T.$$ To find the projection of a vector ##\mathbb x## onto ##W## you just multiply it by this matrix.