Given a basis for a subspace of
, we have a simple way called
the Gram-Schmidt process to produce an orthogonal or orthonormal basis for the subspace. The idea is as follows:
Suppose you are given a basis
of a subspace
of
. Start with
and let it be the first one in the orthogonal basis that we are going to produce and call it
i.e.
.
Let
. We consider the orthogonal decomposition
and get the component
in
i.e.
Then
is an orthogonal set.
Let
. We consider the orthogonal decomposition
and get the component
in
i.e.
Then
is an orthogonal set. We repeat this procedure. At the i
th step, we let
and
After p steps, we obtain the orthogonal basis
for
. If you want to make it an orthonormal basis, then you can simply normalize each vector to
, where
for
.
Remark: If you change the order of the vectors in the given basis, you will get a different orthogonal basis from the Gram-Schimdt process.
Example: Find an orthonormal basis for
in
.
You can try this online
Gram-Schimdt calculator.