The Gram-Schmidt Process Examples 1

# The Gram-Schmidt Process Examples 1

Recall from The Gram-Schmidt Process page that if $V$ is an inner product space and $\{ v_1, v_2, ..., v_n\}$ is a set of linearly independent vectors in $V$, then we can construct a set of orthonormal vectors $\{ e_1, e_2, ..., e_n \}$ of $V$ where:

(1)
\begin{align} \quad e_1 = \frac{v_1}{\| v_1 \|}\: , \quad \quad e_j = \frac{v_j - \left [<v_j, e_1>e_1 + <v_j, e_2>e_2 + ... + <v_j, e_{j-1}>e_{j-1}>\right ]}{\left \| v_j - \left [<v_j, e_1>e_1 + <v_j, e_2>e_2 + ... + <v_j, e_{j-1}>e_{j-1}> \right ] \right \|} \: , \: j = 1, 2, ..., n \end{align}

We will now look at some examples of applying the Gram-Schmidt process.

## Example 1

Use the Gram-Schmidt process to take the linearly independent set of vectors $\{ (1, 3), (-1, 2) \}$ from $\mathbb{R}^2$ and form an orthonormal set of vectors with the dot product. Is this orthonormal set of vectors a basis of $\mathbb{R}^2$?

Let $v_1 = (1, 3)$ and $v_2 = (-1, 2)$. For our first orthonormal vector we have:

(2)
\begin{align} \quad e_1 = \frac{v_1}{\| v_1\|} = \frac{(1, 3)}{\sqrt{1^2 + 3^2}} = \frac{(1, 3)}{\sqrt{10}} = \left ( \frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \right ) \end{align}

Now our second orthonormal vector is $e_2 = \frac{v_2 - <v_2, e_1>e_1}{\| v_2 - <v_2, e_1>e_1 \|}$. We need to compute the inner product $<v_2, e_1>$:

(3)
\begin{align} \quad <v_2, e_1> = (-1, 2) \cdot \left ( \frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \right ) = \frac{-1}{\sqrt{10}} + \frac{6}{\sqrt{10}} = \frac{5}{\sqrt{10}} \end{align}

We note compute $v_2 - <v_2, e_1>e_1$ as follows:

(4)
\begin{align} \quad \quad v_2 - <v_1, e_1>e_1 = (-1, 2) - \frac{5}{\sqrt{10}} \left ( \frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \right ) = (-1, 2) - \left ( \frac{5}{10} , \frac{15}{10} \right ) = \left ( -\frac{3}{2}, \frac{1}{2} \right ) \end{align}

Thus we have that our second orthonormal vector is:

(5)
\begin{align} \quad e_2 = \frac{v_2 - <v_1, e_1>e_1}{\| v_2 - <v_1, e_1>e_1 \|} = \frac{\left ( -\frac{3}{2}, \frac{1}{2} \right )}{\left \| \left ( -\frac{3}{2}, \frac{1}{2} \right ) \right \|} = \frac{\left ( -\frac{3}{2}, \frac{1}{2} \right )}{ \sqrt{\frac{9}{4} + \frac{1}{4}}} = \frac{\left ( -\frac{3}{2}, \frac{1}{2} \right )}{\sqrt{\frac{10}{4}}} = \frac{2}{\sqrt{10}} \left ( -\frac{3}{2}, \frac{1}{2} \right ) = \left ( \frac{-3}{\sqrt{10}}, \frac{1}{\sqrt{10}} \right ) \end{align}

Therefore our orthonormal set of vectors is $\{ e_1, e_2 \} = \left \{ \left ( \frac{1}{\sqrt{10}}, \frac{3}{\sqrt{10}} \right ), \left ( \frac{-3}{\sqrt{10}}, \frac{1}{\sqrt{10}} \right ) \right \}$.

Note that $\mathrm{dim} (\mathbb{R}^2) = 2$ and every set of orthonormal vectors is linearly independent so indeed this set of orthonormal vectors is an orthonormal basis of $\mathbb{R}^2$.

## Example 2

Use the Gram-Schmidt process to take the linearly independent set of vectors $\{ 1, x, \}$ from $\wp_1 (\mathbb{R})$ and form an orthonormal basis of $\wp_1 (\mathbb{R})$ where the inner product on $\wp_1 (\mathbb{R})$ is $<p(x), q(x)> = \int_0^1 p(x)q(x) \: dx$.

Let $v_1 = 1$ and $v_2 = x$. For our first orthonormal vector we have:

(6)
\begin{align} \quad e_1 = \frac{v_1}{\| v_1\|} = \frac{1}{\int_0^1 1 \: dx} = \frac{1}{\left [ x \right ]_0^1} = 1 \end{align}

Now our second orthonormal vector is $e_2 = \frac{v_2 - <v_2, e_1>e_1}{\| v_2 - <v_2, e_1>e_1 \|}$. We need to calculate $<v_2, e_1>$ first:

(7)
\begin{align} \quad <v_2, e_1> = <x, 1> = \int_0^1 x \: dx = \left [ \frac{x^2}{2} \right ]_0^1 = \frac{1}{2} \end{align}

Therefore we have that:

(8)
\begin{align} \quad e_2 = \frac{v_2 - <v_2, e_1>e_1}{\| v_2 - <v_2, e_1>e_1 \|} = \frac{x - \frac{1}{2}(1)}{\left \| x - \frac{1}{2}(1) \right \|} = \frac{x - \frac{1}{2}}{\sqrt{\int_0^1 \left ( x - \frac{1}{2} \right )^2 \: dx}} = \frac{x - \frac{1}{2}}{\sqrt{\int_0^1 \left ( x^2 -x + \frac{1}{4} \right ) \: dx}} = \frac{x - \frac{1}{2}}{\sqrt{\left [ \frac{x^3}{3} - \frac{x^2}{2} + \frac{x}{4} \right ]_0^1}} = \frac{x - \frac{1}{2}}{\sqrt{\frac{1}{12}}} \\ = \frac{x - \frac{1}{2}}{\frac{1}{2 \sqrt{3}}} = 2 \sqrt{3} \left ( x - \frac{1}{2} \right ) = \sqrt{3}(2x - 1) \end{align}

Therefore our orthonormal set of vectors is $\{ e_1, e_2 \} = \left \{ 1, \sqrt{3}(2x - 1) \right \}$.