Problem: Using Gram-Schmidt orthogonalization, find an orthogonal basis for the span of the vectors \[ \mathbf{v}_1 = \begin{pmatrix} 3 \\ 0 \\ 4 \\ \end{pmatrix},~ \mathbf{v}_2 = \begin{pmatrix} 1 \\ -1 \\ 1 \\ \end{pmatrix}. \]
Solution: We start by recalling the Gram-Schmidt orthogonalization process. Given a set of linearly independent vectors ${\mathbf{v} _1, \mathbf{v} _2, \ldots , \mathbf{v} _n}$, we can obtain an orthogonal set of vectors ${\mathbf{u} _1, \mathbf{u} _2, \ldots , \mathbf{u} _n}$ using the following steps:
Here in the problem, we have \[ \mathbf{v}_1 = \begin{pmatrix} 3 \\ 0 \\ 4 \\ \end{pmatrix},~ \mathbf{v} _2 = \begin{pmatrix} 1 \\ -1 \\ 1 \\ \end{pmatrix}. \]
Applying the algorithm described above, we have \[ \mathbf{u} _1 = \frac{\mathbf{v} _1}{\left\lVert \mathbf{v} _1 \right\rVert } = \begin{pmatrix} \frac{3}{5} \\[1ex] 0 \\[1ex] \frac{4}{5} \\ \end{pmatrix}. \] The other vector will be \begin{align*} \mathbf{v} _2 - \left\langle \mathbf{v} _2,\mathbf{u} _1 \right\rangle \mathbf{u} _1 & = \begin{pmatrix} 1 \\ -1 \\ 1 \\ \end{pmatrix} - \frac{7}{5} \begin{pmatrix} \frac{3}{5} \\[1ex] 0 \\[1ex] \frac{4}{5} \\[1ex] \end{pmatrix} \\ & = \begin{pmatrix} 1 \\ -1 \\ 1 \\ \end{pmatrix} - \begin{pmatrix} \frac{21}{25} \\[1ex] 0 \\[1ex] \frac{28}{25} \\[1ex] \end{pmatrix} \\ & = \begin{pmatrix} \frac{4}{25} \\[1ex] -1 \\[1ex] -\frac{3}{25} \\[1ex] \end{pmatrix} \end{align*} Thus, \begin{align*} \mathbf{u} _2 & = \frac{\mathbf{v} _2 - \left\langle \mathbf{v} _2,\mathbf{u} _1 \right\rangle \mathbf{u} _1}{\left\lVert \mathbf{v} _2 - \left\langle \mathbf{v} _2,\mathbf{u} _1 \right\rangle \mathbf{u} _1 \right\rVert } \\ & = \frac{25}{650}\begin{pmatrix} \frac{4}{25} \\[1ex] -1 \\[1ex] -\frac{3}{25} \\[1ex] \end{pmatrix} \\ & = \begin{pmatrix} \frac{4}{650} \\[1ex] -\frac{25}{650} \\[1ex] -\frac{3}{650} \\[1ex] \end{pmatrix} = \begin{pmatrix} \frac{4}{5\sqrt{26} } \\[1ex] -\frac{5}{\sqrt{26} } \\[1ex] -\frac{3}{5\sqrt{26} } \\[1ex] \end{pmatrix}. \end{align*}