The Gram-Schmidt Process produces an orthogonal basis for a nonzero subspace of . It is based on the following theorem.

**Theorem**

Let be a basis for a nonzero subspace W of and:

.

Then is an orthogonal basis for W. In addition, the subspace spanned by is the same as that spanned by for 1 ≤ *k* ≤ *m*.

Note:

In the theorem above, denotes the inner product of and .

**Example 1**

Let W be a subspace of spanned by where . Find an orthogonal basis for W by applying the Gram-Schmidt Process. (Use the Euclidean inner product .)

** Answer**

The theorem above implies that is an orthogonal basis for W.

**Example 2**

Continuing the previous example, find an orthonormal basis for W.

**Answer**

Since is an orthogonal basis, by normalizing each of its elements the orthonormal basis will be obtained. To normalize them, the first step is to calculate the norms of the basis vectors.

Then, the orthonormal basis for W is where

**Example 3**

Let p(x) = a_{0}x^{2} + a_{1}x + a_{2} and q(x) = b_{0}x^{2 }+ b_{1}x + b_{2} be vectors in P_{2} with the inner product <p,q> = a_{0}b_{0} + a_{1}b_{1} + a_{2}b_{2}. Determine whether B = {x^{2}-1, x-1} is an orthonormal set. If not, use the Gram-Schmidt Process to form an orthonormal set.

**Answer**

Let and . These two vectors are not orthogonal to each other since . Thus, B cannot be an orthonormal set. To form the desired orthonormal set, we will apply the Gram-Schmidt Process to produce an orthogonal set and then normalize every vector in C.

The theorem above implies that is an orthogonal basis of a subspace of P_{2} and hence an orthogonal set. What is left is to normalize all the vectors in C. This proceeds as follows.

So, the required orthonormal set is .