##### Objectives
1. Understand which is the best method to use to compute an orthogonal projection in a given situation.
2. Recipes: an orthonormal set from an orthogonal set, Projection Formula, -coordinates when is an orthogonal set, Gram–Schmidt process.
3. Vocabulary words: orthogonal set, orthonormal set.

In this section, we give a formula for orthogonal projection that is considerably simpler than the one in Section 6.3, in that it does not require row reduction or matrix inversion. However, this formula, called the Projection Formula, only works in the presence of an orthogonal basis. We will also present the Gram–Schmidt process for turning an arbitrary basis into an orthogonal one.

# Subsection6.4.1Orthogonal Sets and the Projection Formula

Computations involving projections tend to be much easier in the presence of an orthogonal set of vectors.

##### Definition

A set of nonzero vectors is called orthogonal if whenever It is orthonormal if it is orthogonal, and in addition for all

In other words, a set of vectors is orthogonal if different vectors in the set are perpendicular to each other. An orthonormal set is an orthogonal set of unit vectors.

##### Example

The standard coordinate vectors in always form an orthonormal set. For instance, in we check that

Since for all this shows that is orthonormal.

We saw in the previous example that it is easy to produce an orthonormal set of vectors from an orthogonal one by replacing each vector with the unit vector in the same direction.

##### Recipe: An orthonormal set from an orthogonal set

If is an orthogonal set of vectors, then

is an orthonormal set.

A nice property enjoyed by orthogonal sets is that they are automatically linearly independent.

One advantage of working with orthogonal sets is that it gives a simple formula for the orthogonal projection of a vector.

##### Proof

If is an orthonormal basis for then the denominators go away, so the projection formula becomes even simpler:

Suppose that is an orthogonal basis for a subspace and let for each Then we see that for any vector we have

In other words, for an orthogonal basis, the projection of onto is the sum of the projections onto the lines spanned by the basis vectors. In this sense, projection onto a line is the most important example of an orthogonal projection.

Now let be a subspace of with orthogonal basis and let be a vector in Then so by the projection formula, we have

This gives us a way of expressing as a linear combination of the basis vectors in we have computed the -coordinates of without row reducing!

##### Recipe: B -coordinates when B is an orthogonal set

Let be a subspace of with orthogonal basis and let be a vector in Then

As with orthogonal projections, if is an orthonormal basis of then the formula is even simpler:

The following example shows that the Projection Formula does in fact require an orthogonal basis.

You need an orthogonal basis to use the Projection Formula.

We saw in the previous subsection that orthogonal projections and -coordinates are much easier to compute in the presence of an orthogonal basis for a subspace. In this subsection, we give a method, called the Gram–Schmidt Process, for computing an orthogonal basis of a subspace.

##### Proof

We saw in the proof of the Gram–Schmidt Process that for every between and the set is a an orthogonal basis for

If we had started with a spanning set which is linearly dependent, then for some the vector is in by the increasing span criterion in Section 2.5. Hence

You can use the Gram–Schmidt Process to produce an orthogonal basis from any spanning set: if some just throw away and and continue.

# Subsection6.4.3Two Methods to Compute the Projection

We have now presented two methods for computing the orthogonal projection of a vector: this theorem in Section 6.3 involves row reduction, and the projection formula requires an orthogonal basis. Here are some guidelines for which to use in a given situation.

1. If you already have an orthogonal basis, it is almost always easier to use the projection formula. This often happens in the sciences.
2. If you are going to have to compute the projections of many vectors onto the same subspace, it is worth your time to run Gram–Schmidt to produce an orthogonal basis, so that you can use the projection formula.
3. If you only have to project one or a few vectors onto a subspace, it is faster to use the theorem in Section 6.3. This is the method we will follow in Section 6.5.