Problem: Consider the vectors
\[
\mathbf{v} _1 = \begin{bmatrix}
1 \\
0 \\
1 \\
\end{bmatrix}, \mathbf{v} _2 =
\begin{bmatrix}
-1 \\
4 \\
1 \\
\end{bmatrix}, \mathbf{v} _3 =
\begin{bmatrix}
2 \\
1 \\
-2 \\
\end{bmatrix} \text{ and } \mathbf{x} =
\begin{bmatrix}
1 \\
2 \\
-1 \\
\end{bmatrix}.
\]
Show that the vectors $\{ \mathbf{v} _1, \mathbf{v} _2, \mathbf{v} _3 \} $ is an orthogonal basis of $\mathbb{R} ^3$. If necessary, normalize the vectors to obtain an orthonormal basis $\mathcal{B} $ of $\mathbb{R} ^3$. Finally, find the coordinates of $\mathbf{x} $ with respect to $\mathcal{B} $.
Solution: We wil only check the set $\{ \mathbf{v} _1, \mathbf{v} _2, \mathbf{v} _3 \} $ are mutually orthogonal. Since orthogonal vectors are linearly independent, these vectors will be linearly independent. As the set $\{ \mathbf{v} _1, \mathbf{v} _2, \mathbf{v} _3 \} $ contains three linearly independent vectors, it will be a basis of $\mathbb{R} ^3$. Note that
\begin{align*}
\mathbf{v} _1 \cdot \mathbf{v} _2 & = -1 + 0 + 1 = 0 \\
\mathbf{v} _2 \cdot \mathbf{v} _3 & = -2 + 4 -2 = 0 \\
\mathbf{v} _3 \cdot \mathbf{v} _1 & = 2 + 0 -2 = 0 .
\end{align*}
Thus, $\{ \mathbf{v} _1, \mathbf{v} _2, \mathbf{v} _3 \} $ is an orthogonal basis of $\mathbb{R} ^3$.
Now we will normalize $\mathbf{v} _i$ to obtain an orthonormal basis of $\mathbb{R} ^3$.
\begin{align*}
\mathbf{u} _1 & = \frac{\mathbf{v} _1}{\lVert \mathbf{v} _1 \rVert } =
\begin{bmatrix}
\frac{1}{\sqrt{2} } \\[2ex]
0 \\
\frac{1}{\sqrt{2} } \\[2ex]
\end{bmatrix} \\[2ex]
\mathbf{u} _2 & = \frac{\mathbf{v} _2}{\lVert \mathbf{v} _2 \rVert } =
\begin{bmatrix}
-\frac{1}{\sqrt{18} } \\[2ex]
\frac{4}{\sqrt{18} } \\[2ex]
\frac{1}{\sqrt{18} } \\
\end{bmatrix} \\[2ex]
\mathbf{u} _3 & = \frac{\mathbf{v} _3}{\lVert \mathbf{v} _3 \rVert } =
\begin{bmatrix}
\frac{2}{3} \\[1ex]
\frac{1}{3} \\[1ex]
-\frac{2}{3} \\
\end{bmatrix}.
\end{align*}
Thus, $\mathcal{B} = \{ \mathbf{u} _1, \mathbf{u} _2, \mathbf{u} _3 \} $ is an orthonormal basis for $\mathbb{R} ^3$.
Finally, computing the coordinates with respect to $\mathcal{B} $ is clear. We just need to take the inner product with each $\mathbf{u} _i$'s. Thus,
\[
[\mathbf{x} ]_{\mathcal{B} } =
\begin{bmatrix}
\mathbf{u} _1 \cdot \mathbf{x} \\
\mathbf{u} _2 \cdot \mathbf{x} \\
\mathbf{u} _3 \cdot \mathbf{x} \\
\end{bmatrix} =
\begin{bmatrix}
0 \\
\frac{2}{\sqrt{18} } \\[2ex]
\frac{5}{3} \\
\end{bmatrix}.
\]