Skip to main content
Mathematics LibreTexts

5.3: Orthogonality

  • Page ID
    58857
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Length and orthogonality are basic concepts in geometry and, in \(\mathbb{R}^2\) and \(\mathbb{R}^3\), they both can be defined using the dot product. In this section we extend the dot product to vectors in \(\mathbb{R}^n\), and so endow \(\mathbb{R}^n\) with euclidean geometry. We then introduce the idea of an orthogonal basis—one of the most useful concepts in linear algebra, and begin exploring some of its applications.

    Dot Product, Length, and Distance

    If \(\mathbf{x} = (x_{1}, x_{2}, \dots, x_{n})\) and \(\mathbf{y} = (y_{1}, y_{2}, \dots, y_{n})\) are two \(n\)-tuples in \(\mathbb{R}^n\), recall that their dot product was defined in Section 2.2 as follows:

    \[\mathbf{x} \cdot \mathbf{y} = x_1y_1 + x_2y_2 + \dots + x_ny_n \nonumber \]

    Observe that if \(\mathbf{x}\) and \(\mathbf{y}\) are written as columns then \(\mathbf{x} \cdot \mathbf{y} = \mathbf{x}^{T}\mathbf{y}\) is a matrix product (and \(\mathbf{x} \cdot \mathbf{y} = \mathbf{x}\mathbf{y}^{T}\) if they are written as rows). Here \(\mathbf{x} \cdot \mathbf{y}\) is a \(1 \times 1\) matrix, which we take to be a number.

    Definition \(\PageIndex{1}\): Length in \(\mathbb{R}^n\)

    As in \(\mathbb{R}^3\), the length \(\|\mathbf{x}\|\) of the vector is defined by

    \[\|\mathbf{x}\| = \sqrt{\mathbf{x}\cdot \mathbf{x}} = \sqrt{x_1^2 + x_2^2 + \dots + x_n^2} \nonumber \]

    where \(\sqrt{(\quad )}\) indicates the positive square root.

    A vector \(\mathbf{x}\) of length \(1\) is called a unit vector. If \(\mathbf{x} \neq \mathbf{0}\), then \(\|\mathbf{x}\| \neq 0\) and it follows easily that \(\frac{1}{\|\mathbf{x}\|}\mathbf{x}\) is a unit vector (see Theorem 5.3.6 below), a fact that we shall use later.

    Example \(\PageIndex{1}\)

    If \(\mathbf{x} = (1, -1, -3, 1)\) and \(\mathbf{y} = (2, 1, 1, 0)\) in \(\mathbb{R}^4\), then \(\mathbf{x} \cdot \mathbf{y} = 2 - 1 - 3 + 0 = -2\) and \(\|\mathbf{x}\| = \sqrt{1 + 1 + 9 + 1} = \sqrt{12} = 2\sqrt{3}\). Hence \(\frac{1}{2\sqrt{3}}\mathbf{x}\) is a unit vector; similarly \(\frac{1}{\sqrt{6}}\mathbf{y}\) is a unit vector.

    These definitions agree with those in \(\mathbb{R}^2\) and \(\mathbb{R}^3\), and many properties carry over to \(\mathbb{R}^n\):

    Theorem \(\PageIndex{1}\)

    Let \(\mathbf{x}\), \(\mathbf{y}\), and \(\mathbf{z}\) denote vectors in \(\mathbb{R}^n\). Then:

    1. \(\mathbf{x} \cdot \mathbf{y} = \mathbf{y} \cdot \mathbf{x}\).
    2. \(\mathbf{x} \cdot (\mathbf{y} + \mathbf{z}) = \mathbf{x} \cdot \mathbf{y} + \mathbf{x} \cdot \mathbf{z}\).
    3. \((a\mathbf{x}) \cdot \mathbf{y} = a(\mathbf{x} \cdot \mathbf{y}) = \mathbf{x} \cdot (a\mathbf{y})\) for all scalars \(a\).
    4. \(\|\mathbf{x}\|^{2} = \mathbf{x} \cdot \mathbf{x}\).
    5. \(\|\mathbf{x}\| \geq 0\), and \(\|\mathbf{x}\| = 0\) if and only if \(\mathbf{x} = \mathbf{0}\).
    6. \(\| a \mathbf{x}\| = | a | \|\mathbf{x}\|\) for all scalars \(a\).
    Proof

    (1), (2), and (3) follow from matrix arithmetic because \(\mathbf{x} \cdot \mathbf{y} = \mathbf{x}^{T}\mathbf{y}\); (4) is clear from the definition; and (6) is a routine verification since \(|a| = \sqrt{a^2}\). If \(\mathbf{x} = (x_{1}, x_{2}, \dots, x_{n})\), then \(\|\mathbf{x}\| = \sqrt{x_1^2 + x_2^2 + \dots + x_n^2}\) so \(\|\mathbf{x}\| = 0\) if and only if \(x_1^2 + x_2^2 + \dots + x_n^2 = 0\). Since each \(x_{i}\) is a real number this happens if and only if \(x_{i} = 0\) for each \(i\); that is, if and only if \(\mathbf{x} = \mathbf{0}\). This proves (5).

    Because of Theorem 5.3.1, computations with dot products in \(\mathbb{R}^n\) are similar to those in \(\mathbb{R}^3\). In particular, the dot product

    \[(\mathbf{x}_1 + \mathbf{x}_2 + \dots + \mathbf{x}_m) \cdot (\mathbf{y}_1 + \mathbf{y}_2 + \dots + \mathbf{y}_k) \nonumber \]

    equals the sum of \(mk\) terms, \(\mathbf{x}_{i} \cdot \mathbf{y}_{j}\), one for each choice of \(i\) and \(j\). For example:

    \[\begin{aligned} (3\mathbf{x} - 4\mathbf{y}) \cdot (7\mathbf{x} + 2\mathbf{y}) & = 21(\mathbf{x} \cdot \mathbf{x}) + 6(\mathbf{x} \cdot \mathbf{y}) - 28(\mathbf{y} \cdot \mathbf{x}) - 8(\mathbf{y} \cdot \mathbf{y}) \\ &= 21 \|\mathbf{x}\|^2 - 22(\mathbf{x} \cdot \mathbf{y}) - 8\|\mathbf{y}\|^2\end{aligned} \nonumber \]

    holds for all vectors \(\mathbf{x}\) and \(\mathbf{y}\).

    Example \(\PageIndex{2}\)

    Show that \(\|\mathbf{x} + \mathbf{y}\|^{2} = \|\mathbf{x}\|^{2} + 2(\mathbf{x} \cdot \mathbf{y}) + \|\mathbf{y}\|^{2}\) for any \(\mathbf{x}\) and \(\mathbf{y}\) in \(\mathbb{R}^n\).

    Solution

    Using Theorem 5.3.1 several times:

    \[\begin{aligned} \|\mathbf{x} + \mathbf{y}\|^2 &= (\mathbf{x} + \mathbf{y}) \cdot (\mathbf{x} + \mathbf{y}) = \mathbf{x} \cdot \mathbf{x} + \mathbf{x} \cdot \mathbf{y} + \mathbf{y} \cdot \mathbf{x} + \mathbf{y} \cdot \mathbf{y} \\ &= \|\mathbf{x}\|^2 + 2(\mathbf{x} \cdot \mathbf{y}) + \|\mathbf{y}\|^2\end{aligned} \nonumber \]

    Example \(\PageIndex{3}\)

    Suppose that \(\mathbb{R}^n = span \;\{\mathbf{f}_{1}, \mathbf{f}_{2}, \dots, \mathbf{f}_{k}\}\) for some vectors \(\mathbf{f}_{i}\). If \(\mathbf{x} \cdot \mathbf{f}_{i} = 0\) for each \(i\) where \(\mathbf{x}\) is in \(\mathbb{R}^n\), show that \(\mathbf{x} = \mathbf{0}\).

    Solution

    We show \(\mathbf{x} = \mathbf{0}\) by showing that \(\|\mathbf{x}\| = 0\) and using (5) of Theorem 5.3.1. Since the \(\mathbf{f}_{i}\) span \(\mathbb{R}^n\), write \(\mathbf{x} = t_{1}\mathbf{f}_{1} + t_{2}\mathbf{f}_{2} + \dots + t_{k}\mathbf{f}_{k}\) where the \(t_{i}\) are in \(\mathbb{R}\). Then

    \[\begin{aligned} \|\mathbf{x}\|^2 &= \mathbf{x} \cdot \mathbf{x} = \mathbf{x} \cdot (t_1\mathbf{f}_1 + t_2\mathbf{f}_2 + \dots + t_k\mathbf{f}_k) \\ &= t_1(\mathbf{x} \cdot \mathbf{f}_1) + t_2(\mathbf{x} \cdot \mathbf{f}_2) + \dots + t_k(\mathbf{x} \cdot \mathbf{f}_k) \\ &= t_1(0) + t_2(0) + \cdots + t_k(0) \\ &= 0\end{aligned} \nonumber \]

    We saw in Section 4.2 that if \(\mathbf{u}\) and \(\mathbf{v}\) are nonzero vectors in \(\mathbb{R}^3\), then \(\frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|} = \cos\theta\) where \(\theta\) is the angle between \(\mathbf{u}\) and \(\mathbf{v}\). Since \(|\cos \theta| \leq 1\) for any angle \(\theta\), this shows that \(|\mathbf{u} \cdot \mathbf{v}| \leq \|\mathbf{u}\|\|\mathbf{v}\|\). In this form the result holds in \(\mathbb{R}^n\).

    Theorem \(\PageIndex{2}\): Cauchy Inequality

    If \(\mathbf{x}\) and \(\mathbf{y}\) are vectors in \(\mathbb{R}^n\), then

    \[| \mathbf{x} \cdot \mathbf{y}| \leq \|\mathbf{x}\| \|\mathbf{y}\| \nonumber \]

    Moreover \(|\mathbf{x} \cdot \mathbf{y}| = \|\mathbf{x}\| \|\mathbf{y}\|\) if and only if one of \(\mathbf{x}\) and \(\mathbf{y}\) is a multiple of the other.

    Proof

    The inequality holds if \(\mathbf{x} = \mathbf{0}\) or \(\mathbf{y} = \mathbf{0}\) (in fact it is equality). Otherwise, write \(\|\mathbf{x}\| = a > 0\) and \(\|\mathbf{y}\| = b > 0\) for convenience. A computation like that preceding Example 5.3.2 gives

    \[\label{eq:cauchy_inequality} \| b\mathbf{x} - a\mathbf{y} \|^2 = 2ab(ab - \mathbf{x} \cdot \mathbf{y}) \mbox{ and } \| b\mathbf{x} + a\mathbf{y} \|^2 = 2ab(ab + \mathbf{x} \cdot \mathbf{y}) \]

    It follows that \(ab - \mathbf{x} \cdot \mathbf{y} \geq 0\) and \(ab + \mathbf{x} \cdot \mathbf{y} \geq 0\), and hence that \(-ab \leq \mathbf{x} \cdot \mathbf{y} \leq ab\). Hence \(|\mathbf{x} \cdot \mathbf{y}| \leq ab = \|\mathbf{x}\|\|\mathbf{y}\|\), proving the Cauchy inequality.

    If equality holds, then \(|\mathbf{x} \cdot \mathbf{y}| = ab\), so \(\mathbf{x} \cdot \mathbf{y} = ab\) or \(\mathbf{x} \cdot \mathbf{y} = -ab\). Hence Equation \ref{eq:cauchy_inequality} shows that \(b\mathbf{x} - a\mathbf{y} = 0\) or \(b\mathbf{x} + a\mathbf{y} = 0\), so one of \(\mathbf{x}\) and \(\mathbf{y}\) is a multiple of the other (even if \(a = 0\) or \(b = 0\)).

    The Cauchy inequality is equivalent to \((\mathbf{x} \cdot \mathbf{y})^{2} \leq \|\mathbf{x}\|^{2}\|\mathbf{y}\|^{2}\). In \(\mathbb{R}^5\) this becomes

    \[(x_1y_1 + x_2y_2 + x_3y_3 + x_4y_4 + x_5y_5)^2 \leq (x_1^2 + x_2^2 + x_3^2 + x_4^2 + x_5^2)(y_1^2 + y_2^2 + y_3^2 + y_4^2 + y_5^2) \nonumber \]

    for all \(x_{i}\) and \(y_{i}\) in \(\mathbb{R}\).

    There is an important consequence of the Cauchy inequality. Given \(\mathbf{x}\) and \(\mathbf{y}\) in \(\mathbb{R}^n\), use Example 5.3.2 and the fact that \(\mathbf{x} \cdot \mathbf{y} \leq \|\mathbf{x}\|\|\mathbf{y}\|\) to compute

    \[\|\mathbf{x} + \mathbf{y}\|^2 = \|\mathbf{x}\|^2 + 2(\mathbf{x} \cdot \mathbf{y}) + \|\mathbf{y}\|^2 \leq \|\mathbf{x}\|^2 + 2\|\mathbf{x}\| \|\mathbf{y}\| + \|\mathbf{y}\|^2 = (\|\mathbf{x} + \mathbf{y}\|)^2 \nonumber \]

    Taking positive square roots gives:

    Corollary \(\PageIndex{1}\): Triangle Inequality

    If \(\mathbf{x}\) and \(\mathbf{y}\) are vectors in \(\mathbb{R}^n\), then \(\|\mathbf{x} + \mathbf{y}\| \leq \|\mathbf{x}\| + \|\mathbf{y}\|\).

    The reason for the name comes from the observation that in \(\mathbb{R}^3\) the inequality asserts that the sum of the lengths of two sides of a triangle is not less than the length of the third side. This is illustrated in the diagram.

    clipboard_ed641ec89debf7a90dd6ad1621828d1aa.png
    Definition \(\PageIndex{2}\): Distance in \(\mathbb{R}^n\)

    If \(\mathbf{x}\) and \(\mathbf{y}\) are two vectors in \(\mathbb{R}^n\), we define the distance \(d(\mathbf{x}, \mathbf{y})\) between \(\mathbf{x}\) and \(\mathbf{y}\) by

    \[d(\mathbf{x},\mathbf{y}) = \|\mathbf{x} - \mathbf{y}\| \nonumber \]

    The motivation again comes from \(\mathbb{R}^3\) as is clear in the diagram. This distance function has all the intuitive properties of distance in \(\mathbb{R}^3\), including another version of the triangle inequality.

    clipboard_e9650a3a84772ba33720c902c1c93369a.png
    Theorem \(\PageIndex{3}\)

    If \(\mathbf{x}\), \(\mathbf{y}\), and \(\mathbf{z}\) are three vectors in \(\mathbb{R}^n\) we have:

    1. \(d(\mathbf{x}, \mathbf{y}) \geq 0\) for all \(\mathbf{x}\) and \(\mathbf{y}\).
    2. \(d(\mathbf{x}, \mathbf{y}) = 0\) if and only if \(\mathbf{x} = \mathbf{y}\).
    3. \(d(\mathbf{x}, \mathbf{y}) = d(\mathbf{y}, \mathbf{x})\) for all \(\mathbf{x}\) and \(\mathbf{y}\).
    4. \(d(\mathbf{x}, \mathbf{z}) \leq d(\mathbf{x}, \mathbf{y}) + d(\mathbf{y}, \mathbf{z})\)for all \(\mathbf{x}\), \(\mathbf{y}\), and \(\mathbf{z}\). This is the triangle inequality.
    Proof

    (1) and (2) restate part (5) of Theorem 5.3.1 because \(d(\mathbf{x}, \mathbf{y}) = \|\mathbf{x} - \mathbf{y}\|\), and (3) follows because \(\|\mathbf{u}\| = \| -\mathbf{u}\|\) for every vector \(\mathbf{u}\) in \(\mathbb{R}^n\). To prove (4) use the Corollary to Theorem 5.3.1:

    \[\begin{aligned} d(\mathbf{x}, \mathbf{z}) = \|\mathbf{x} - \mathbf{z}\| &= \|(\mathbf{x} - \mathbf{y}) + (\mathbf{y} - \mathbf{z}) \| \\ &\leq \|(\mathbf{x} - \mathbf{y})\| + \|(\mathbf{y} - \mathbf{z})\| = d(\mathbf{x}, \mathbf{y}) + d(\mathbf{y}, \mathbf{z})\end{aligned} \nonumber \]

    \(\square\)

    Orthogonal Sets and the Expansion Theorem

    Definition \(\PageIndex{3}\): Orthogonal and Orthonormal Sets

    We say that two vectors \(\mathbf{x}\) and \(\mathbf{y}\) in \(\mathbb{R}^n\) are orthogonal if \(\mathbf{x} \cdot \mathbf{y} = 0\), extending the terminology in \(\mathbb{R}^3\) (See Theorem 4.2.3). More generally, a set \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) of vectors in \(\mathbb{R}^n\) is called an orthogonal set if

    \[\mathbf{x}_i \cdot \mathbf{x}_j = 0 \mbox{ for all } i \neq j \quad \mbox{ and } \quad \mathbf{x}_i \neq \mathbf{0} \mbox{ for all } i^{10} \nonumber \]

    Note that \(\{\mathbf{x}\}\) is an orthogonal set if \(\mathbf{x} \neq \mathbf{0}\). A set \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) of vectors in \(\mathbb{R}^n\) is called orthonormal if it is orthogonal and, in addition, each \(\mathbf{x}_{i}\) is a unit vector:

    \[\|\mathbf{x}_i\| = 1 \mbox{ for each } i. \nonumber \]

    Example \(\PageIndex{4}\)

    The standard basis \(\{\mathbf{e}_{1}, \mathbf{e}_{2}, \dots, \mathbf{e}_{n}\}\) is an orthonormal set in \(\mathbb{R}^n\).

    The routine verification is left to the reader, as is the proof of:

    Example \(\PageIndex{5}\)

    If \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) is orthogonal, so also is \(\{a_{1}\mathbf{x}_{1}, a_{2}\mathbf{x}_{2}, \dots, a_{k}\mathbf{x}_{k}\}\) for any nonzero scalars \(a_{i}\).

    If \(\mathbf{x} \neq \mathbf{0}\), it follows from item (6) of Theorem 5.3.1 that \(\frac{1}{\|\mathbf{x}\|}\mathbf{x}\) is a unit vector, that is it has length \(1\).

    Definition \(\PageIndex{4}\): Normalizing an Orthogonal Set

    Hence if \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) is an orthogonal set, then \(\{ \frac{1}{\|\mathbf{x}_1\|}\mathbf{x}_1, \frac{1}{\|\mathbf{x}_2\|}\mathbf{x}_2, \cdots, \frac{1}{\|\mathbf{x}_k\|}\mathbf{x}_k \}\) is an orthonormal set, and we say that it is the result of normalizing the orthogonal set \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \cdots, \mathbf{x}_{k}\}\).

    Example \(\PageIndex{6}\)

    If \(\mathbf{f}_1 = \left[ \begin{array}{r} 1 \\ 1 \\ 1 \\ -1 \end{array} \right]\), \(\mathbf{f}_2 = \left[ \begin{array}{r} 1 \\ 0 \\ 1 \\ 2 \end{array} \right]\), \(\mathbf{f}_3 = \left[ \begin{array}{r} -1 \\ 0 \\ 1 \\ 0 \end{array} \right]\), and \(\mathbf{f}_4 = \left[ \begin{array}{r} -1 \\ 3 \\ -1 \\ 1 \end{array} \right]\) then \(\{ \mathbf{f}_1, \mathbf{f}_2, \mathbf{f}_3, \mathbf{f}_4 \}\) is an orthogonal set in \(\mathbb{R}^4\) as is easily verified. After normalizing, the corresponding orthonormal set is \(\{ \frac{1}{2}\mathbf{f}_1, \frac{1}{\sqrt{6}}\mathbf{f}_2, \frac{1}{\sqrt{2}}\mathbf{f}_3, \frac{1}{2\sqrt{3}}\mathbf{f}_4 \}\)

    The most important result about orthogonality is Pythagoras’ theorem. Given orthogonal vectors \(\mathbf{v}\) and \(\mathbf{w}\) in \(\mathbb{R}^3\), it asserts that

    \[\|\mathbf{v} + \mathbf{w}\|^{2} = \|\mathbf{v}\|^{2} + \|\mathbf{w}\|^{2} \nonumber \]

    as in the diagram.

    clipboard_e7b3b93001e22fade18c044261453d91f.png

    In this form the result holds for any orthogonal set in \(\mathbb{R}^n\).

    Theorem \(\PageIndex{4}\): Pythagoras’ Theorem

    If \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) is an orthogonal set in \(\mathbb{R}^n\), then

    \[\|\mathbf{x}_1 + \mathbf{x}_2 + \dots + \mathbf{x}_k \|^2 = \|\mathbf{x}_1\|^2 + \|\mathbf{x}_2\|^2 + \dots + \|\mathbf{x}_k\|^2. \nonumber \]

    Proof

    The fact that \(\mathbf{x}_{i} \cdot \mathbf{x}_{j} = 0\) whenever \(i \neq j\) gives

    \[\begin{aligned} \|\mathbf{x}_1 + \mathbf{x}_2 + \dots + \mathbf{x}_k \|^2 & = (\mathbf{x}_1 + \mathbf{x}_2 + \dots + \mathbf{x}_k) \cdot (\mathbf{x}_1 + \mathbf{x}_2 + \dots + \mathbf{x}_k) \\ &= (\mathbf{x}_1 \cdot \mathbf{x}_1 + \mathbf{x}_2 \cdot \mathbf{x}_2 + \dots + \mathbf{x}_k \cdot \mathbf{x}_k) + \sum_{i \neq j}\mathbf{x}_i \cdot \mathbf{x}_j \\ &= \|\mathbf{x}_1\|^2 + \|\mathbf{x}_2\|^2 + \dots + \|\mathbf{x}_k\|^2 + 0\end{aligned} \nonumber \]

    This is what we wanted.

    \(\square\)

    If \(\mathbf{v}\) and \(\mathbf{w}\) are orthogonal, nonzero vectors in \(\mathbb{R}^3\), then they are certainly not parallel, and so are linearly independent by Example 5.2.7. The next theorem gives a far-reaching extension of this observation.

    Theorem \(\PageIndex{5}\)

    Every orthogonal set in \(\mathbb{R}^n\) is linearly independent.

    Proof

    Let \(\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) be an orthogonal set in \(\mathbb{R}^n\) and suppose a linear combination vanishes, say: \(t_{1}\mathbf{x}_{1} + t_{2}\mathbf{x}_{2} + \dots + t_{k}\mathbf{x}_{k} = \mathbf{0}\). Then

    \[\begin{aligned} 0 = \mathbf{x}_1 \cdot \mathbf{0} &= \mathbf{x}_1 \cdot (t_1\mathbf{x}_1 + t_2\mathbf{x}_2 + \dots + t_k\mathbf{x}_k) \\ &= t_1(\mathbf{x}_1 \cdot \mathbf{x}_1) + t_2(\mathbf{x}_1 \cdot \mathbf{x}_2) + \dots + t_k(\mathbf{x}_1 \cdot \mathbf{x}_k) \\ &= t_1\|\mathbf{x}_1\|^2 +t_2(0) + \dots + t_k(0) \\ &= t_1\|\mathbf{x}_1\|^2\end{aligned} \nonumber \]

    Since \(\|\mathbf{x}_{1}\|^{2} \neq 0\), this implies that \(t_{1} = 0\). Similarly \(t_{i} = 0\) for each \(i\).

    \(\square\)

    Theorem 5.3.5 suggests considering orthogonal bases for \(\mathbb{R}^n\), that is orthogonal sets that span \(\mathbb{R}^n\). These turn out to be the best bases in the sense that, when expanding a vector as a linear combination of the basis vectors, there are explicit formulas for the coefficients.

    Theorem \(\PageIndex{6}\): Expansion Theorem

    Let \(\{\mathbf{f}_{1}, \mathbf{f}_{2}, \dots, \mathbf{f}_{m}\}\) be an orthogonal basis of a subspace U of \(\mathbb{R}^n\). If \(\mathbf{x}\) is any vector in \(U\), we have

    \[\mathbf{x} = \left(\frac{\mathbf{x} \cdot \mathbf{f}_1}{\|\mathbf{f}_1\|^2} \right) \mathbf{f}_1 + \left(\frac{\mathbf{x} \cdot \mathbf{f}_2}{\|\mathbf{f}_2\|^2} \right) \mathbf{f}_2 + \dots + \left(\frac{\mathbf{x} \cdot \mathbf{f}_m}{\|\mathbf{f}_m\|^2} \right) \mathbf{f}_m \nonumber \]

    Proof

    Since \(\{\mathbf{f}_{1}, \mathbf{f}_{2}, \dots, \mathbf{f}_{m}\}\) spans \(U\), we have \(\mathbf{x} = t_{1}\mathbf{f}_{1} + t_{2}\mathbf{f}_{2} + \dots + t_{m}\mathbf{f}_{m}\) where the \(t_{i}\) are scalars. To find \(t_{1}\) we take the dot product of both sides with \(\mathbf{f}_{1}\):

    \[\begin{aligned} \mathbf{x} \cdot \mathbf{f}_1 &= (t_1\mathbf{f}_1 + t_2\mathbf{f}_2 + \dots + t_m\mathbf{f}_m) \cdot \mathbf{f}_1 \\ &= t_1(\mathbf{f}_1 \cdot \mathbf{f}_1) + t_2(\mathbf{f}_2 \cdot \mathbf{f}_1) + \dots + t_m(\mathbf{f}_m \cdot \mathbf{f}_1) \\ &= t_1\|\mathbf{f}_1\|^2 + t_2(0) + \dots + t_m(0) \\ &= t_1\|\mathbf{f}_1\|^2\end{aligned} \nonumber \]

    Since \(\mathbf{f}_{1} \neq \mathbf{0}\), this gives \(t_1 = \frac{\mathbf{x} \cdot \mathbf{f}_1}{\|\mathbf{f}_1\|^2}\). Similarly, \(t_i = \frac{\mathbf{x} \cdot \mathbf{f}_i}{\|\mathbf{f}_i\|^2}\) for each \(i\).

    \(\square\)

    The expansion in Theorem 5.3.6 of \(\mathbf{x}\) as a linear combination of the orthogonal basis \(\{\mathbf{f}_{1}, \mathbf{f}_{2}, \dots, \mathbf{f}_{m}\}\) is called the Fourier expansion of \(\mathbf{x}\), and the coefficients \(t_1 = \frac{\mathbf{x} \cdot \mathbf{f}_i}{\|\mathbf{f}_i\|^2}\) are called the Fourier coefficients. Note that if \(\{\mathbf{f}_{1}, \mathbf{f}_{2}, \dots, \mathbf{f}_{m}\}\) is actually orthonormal, then \(t_{i} = \mathbf{x} \cdot \mathbf{f}_{i}\) for each \(i\). We will have a great deal more to say about this in Section 10.5.

    Example \(\PageIndex{7}\)

    Expand \(\mathbf{x} = (a, b, c, d)\) as a linear combination of the orthogonal basis \(\{\mathbf{f}_{1}, \mathbf{f}_{2}, \mathbf{f}_{3}, \mathbf{f}_{4}\}\) of \(\mathbb{R}^4\) given in Example 5.3.6.

    Solution

    We have \(\mathbf{f}_{1} = (1, 1, 1, -1)\), \(\mathbf{f}_{2} = (1, 0, 1, 2)\), \(\mathbf{f}_{3} = (-1, 0, 1, 0)\), and \(\mathbf{f}_{4} = (-1, 3, -1, 1)\) so the Fourier coefficients are

    \[\begin{align*} t_1 &= \frac{\mathbf{x} \cdot \mathbf{f}_1}{\|\mathbf{f}_1\|^2} = \frac{1}{4}(a + b + c + d) \\[4pt] t_3 &= \frac{\mathbf{x} \cdot \mathbf{f}_3}{\|\mathbf{f}_3\|^2} = \frac{1}{2}(-a + c) \\[4pt] t_2 &= \frac{\mathbf{x} \cdot \mathbf{f}_2}{\|\mathbf{f}_2\|^2} = \frac{1}{6}(a + c + 2d) \\[4pt] t_4 &= \frac{\mathbf{x} \cdot \mathbf{f}_4}{\|\mathbf{f}_4\|^2} = \frac{1}{12}(-a + 3b -c + d) \end{align*} \nonumber \]

    The reader can verify that indeed \(\mathbf{x} = t_{1}\mathbf{f}_{1} + t_{2}\mathbf{f}_{2} + t_{3}\mathbf{f}_{3} + t_{4}\mathbf{f}_{4}\).

    A natural question arises here: Does every subspace \(U\) of \(\mathbb{R}^n\) have an orthogonal basis? The answer is “yes”; in fact, there is a systematic procedure, called the Gram-Schmidt algorithm, for turning any basis of \(U\) into an orthogonal one. This leads to a definition of the projection onto a subspace \(U\) that generalizes the projection along a vector used in \(\mathbb{R}^2\) and \(\mathbb{R}^3\). All this is discussed in Section 8.1.


    1 The reason for insisting that orthogonal sets consist of nonzero vectors is that we will be primarily concerned with orthogonal bases.


    This page titled 5.3: Orthogonality was last modified on Sat, 17 Jan 2026 00:22:24 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by W. Keith Nicholson via source content that was edited to the style and standards of the LibreTexts platform.