Tutorials › Linear Algebra › Orthogonal Examples in Vector, Polynomial, and Matrix Spaces

Orthogonal Sets and Gram-Schmidt · Tutorial 628 of 1000

Orthogonal Examples in Vector, Polynomial, and Matrix Spaces

Learn to test orthogonality and construct orthonormal lists in vector, polynomial, and matrix spaces using the inner product defined on each space.

Intermediate 9 min read

What You'll Learn

  • Test whether vectors form an orthogonal or orthonormal list using the standard dot product.
  • Calculate polynomial inner products by integrating products over a specified interval.
  • Use the trace inner product to compare matrices.
  • Normalize nonzero orthogonal vectors without changing their pairwise orthogonality.
  • Spot why omitting the transpose in a matrix inner product can give an invalid test.

Orthogonality Depends on the Inner Product

Orthogonality is not limited to arrows in \(\mathbb{R}^n\). It can also describe relationships between polynomials or matrices, provided the space has an inner product. The calculation always has the same basic shape: take the inner product of each pair of distinct elements and check whether the result is zero. What changes from space to space is how that inner product is defined.

For vectors in \(\mathbb{R}^n\), the standard dot product is \(\mathbf{u}\cdot\mathbf{v}=\mathbf{u}^{\top}\mathbf{v}=\sum_{k=1}^{n}u_kv_k\). For real polynomials, we will use an integral of the product. For real matrices, we will use a trace of a product involving a transpose. In each setting, a list is orthogonal when every pair of distinct entries has inner product zero, and it is orthonormal when it is orthogonal and every entry has norm \(1\). The norm induced by an inner product is \(\|\mathbf{u}\|=\sqrt{\langle\mathbf{u},\mathbf{u}\rangle}\), with the same definition applying when the objects are polynomials or matrices.

These conditions refer to a list: repeated entries are still separate positions, and each pair of distinct positions must be tested. An orthogonal list may contain the zero vector or a zero polynomial or matrix; an orthonormal list cannot, since every entry must have norm \(1\). Normalization means dividing a nonzero object by its norm. It changes its length to \(1\), but it does not, by itself, make two nonorthogonal objects orthogonal.

Examples with the Standard Dot Product

Worked Example: An Orthonormal List in \(\mathbb{R}^3\)

Consider the columns \(\mathbf{u}=(1,1,0)^{\top}\), \(\mathbf{v}=(1,-1,0)^{\top}\), and \(\mathbf{w}=(0,0,2)^{\top}\). First test the three pairs:

$$ \mathbf{u}\cdot\mathbf{v}=1(1)+1(-1)+0(0)=0, \qquad \mathbf{u}\cdot\mathbf{w}=1(0)+1(0)+0(2)=0, $$
$$ \mathbf{v}\cdot\mathbf{w}=1(0)+(-1)(0)+0(2)=0. $$

Thus the list is orthogonal. Its norms are found by taking the square roots of the self-dot-products:

$$ \|\mathbf{u}\|=\sqrt{1^2+1^2+0^2}=\sqrt{2}, \quad \|\mathbf{v}\|=\sqrt{1^2+(-1)^2+0^2}=\sqrt{2}, \quad \|\mathbf{w}\|=\sqrt{0^2+0^2+2^2}=2. $$

Divide each vector by its norm. The resulting list is

$$ \frac{\mathbf{u}}{\|\mathbf{u}\|}= \begin{bmatrix}1/\sqrt{2}\\1/\sqrt{2}\\0\end{bmatrix}, \qquad \frac{\mathbf{v}}{\|\mathbf{v}\|}= \begin{bmatrix}1/\sqrt{2}\\-1/\sqrt{2}\\0\end{bmatrix}, \qquad \frac{\mathbf{w}}{\|\mathbf{w}\|}= \begin{bmatrix}0\\0\\1\end{bmatrix}. $$

Check: The first two normalized vectors have dot product \(1/2-1/2+0=0\). Each has squared norm \(1/2+1/2=1\), and the third has squared norm \(1\). Its dot product with either of the first two is zero because its first two entries are zero. The normalized list is therefore orthonormal.

The computations in this example rely on the standard dot product. Changing the inner product can change which objects are orthogonal, so a test must use the inner product specified for the space rather than an assumed formula.

An Integral Inner Product on Polynomials

Definition: For real polynomials \(p\) and \(q\), define \(\langle p,q\rangle=\int_{-1}^{1}p(x)q(x)\,dx\). The associated norm is \(\|p\|=\sqrt{\int_{-1}^{1}p(x)^2\,dx}\). In particular, these definitions apply to the space of real polynomials of degree at most \(n\), denoted \(\mathcal{P}_n(\mathbb{R})\).

This formula gives an inner product on each \(\mathcal{P}_n(\mathbb{R})\). Its symmetry follows from \(p(x)q(x)=q(x)p(x)\), and its linearity follows from the linearity of integration. For positive definiteness, the integral of \(p(x)^2\) is nonnegative, and it is positive for every nonzero polynomial: such a polynomial is nonzero at some point of \((-1,1)\), and continuity makes its square positive on an interval around that point. The fact used here—that a nonzero polynomial cannot vanish throughout an interval—follows, for example, from the factor theorem, which implies that a degree-\(d\) polynomial has at most \(d\) distinct roots.

Worked Example: Orthogonal Polynomials on \([-1,1]\)

In \(\mathcal{P}_2(\mathbb{R})\), consider \(p_1(x)=1\), \(p_2(x)=x\), and \(p_3(x)=3x^2-1\). Test each pair with the integral inner product. For the first pair, \(\int_{-1}^{1}x\,dx=0\), since \(x\) is odd. For the second pair,

$$ \langle p_1,p_3\rangle =\int_{-1}^{1}(3x^2-1)\,dx =\left[x^3-x\right]_{-1}^{1} =(1-1)-(-1+1)=0. $$

For the remaining pair, the integrand \(x(3x^2-1)=3x^3-x\) is odd, so its integral over \([-1,1]\) is zero. All three pairwise inner products vanish; the list is orthogonal.

Now compute the norms. For \(p_1\),

$$ \|p_1\|^2=\int_{-1}^{1}1\,dx=2. $$

For \(p_2\), and then \(p_3\), the calculations are

$$ \|p_2\|^2=\int_{-1}^{1}x^2\,dx =\left[\frac{x^3}{3}\right]_{-1}^{1}=\frac{2}{3}, $$
$$ \|p_3\|^2 =\int_{-1}^{1}(3x^2-1)^2\,dx =\int_{-1}^{1}(9x^4-6x^2+1)\,dx =\frac{18}{5}-4+2=\frac{8}{5}. $$

The norms are \(\sqrt{2}\), \(\sqrt{2/3}\), and \(\sqrt{8/5}\). Dividing each polynomial by its norm gives the orthonormal list

$$ \frac{1}{\sqrt{2}}, \qquad \sqrt{\frac{3}{2}}\,x, \qquad \sqrt{\frac{5}{8}}\,(3x^2-1). $$

Check: The squared norm of each scaled polynomial is its original squared norm multiplied by the square of the scaling factor: \(2(1/2)=1\), \((2/3)(3/2)=1\), and \((8/5)(5/8)=1\). Scaling does not change the zero pairwise inner products, so the list is orthonormal.

A Trace Inner Product on Matrices

Definition: For real \(m\times n\) matrices \(\mathbf{A}\) and \(\mathbf{B}\), define \(\langle\mathbf{A},\mathbf{B}\rangle=\operatorname{tr}(\mathbf{A}^{\top}\mathbf{B})\). The associated norm is \(\|\mathbf{A}\|=\sqrt{\operatorname{tr}(\mathbf{A}^{\top}\mathbf{A})}\).

Here \(\operatorname{tr}\) denotes the sum of the diagonal entries of a square matrix. The product \(\mathbf{A}^{\top}\mathbf{B}\) is \(n\times n\), so its trace is defined even when \(\mathbf{A}\) and \(\mathbf{B}\) are not square. Expanding the diagonal entries gives a useful equivalent formula:

$$ \operatorname{tr}(\mathbf{A}^{\top}\mathbf{B}) =\sum_{j=1}^{n}\sum_{i=1}^{m}a_{ij}b_{ij}. $$

This is the sum of the products of corresponding entries. In particular, \(\|\mathbf{A}\|^2=\sum_{i=1}^{m}\sum_{j=1}^{n}a_{ij}^2\). The trace formula is symmetric and bilinear over \(\mathbb{R}\), and this sum-of-squares expression is positive unless every entry of \(\mathbf{A}\) is zero. Thus it gives an inner product.

Worked Example: Four Orthogonal Matrices

In the real \(2\times2\) matrices, take

$$ \mathbf{A}_1=\begin{bmatrix}1&0\\0&1\end{bmatrix},\quad \mathbf{A}_2=\begin{bmatrix}1&0\\0&-1\end{bmatrix},\quad \mathbf{A}_3=\begin{bmatrix}0&1\\1&0\end{bmatrix},\quad \mathbf{A}_4=\begin{bmatrix}0&1\\-1&0\end{bmatrix}. $$

Using the entrywise formula, the six pairwise inner products are

$$ \begin{aligned} \langle\mathbf{A}_1,\mathbf{A}_2\rangle&=1-1=0, &\langle\mathbf{A}_1,\mathbf{A}_3\rangle&=0, &\langle\mathbf{A}_1,\mathbf{A}_4\rangle&=0,\\ \langle\mathbf{A}_2,\mathbf{A}_3\rangle&=0, &\langle\mathbf{A}_2,\mathbf{A}_4\rangle&=0, &\langle\mathbf{A}_3,\mathbf{A}_4\rangle&=1-1=0. \end{aligned} $$

Each matrix has two entries whose squares are \(1\), and two entries equal to zero. Hence \(\|\mathbf{A}_i\|^2=2\) and \(\|\mathbf{A}_i\|=\sqrt{2}\) for each \(i\). The normalized matrices \(\mathbf{A}_i/\sqrt{2}\), for \(i=1,2,3,4\), form an orthonormal list.

Check: For example, \(\langle\mathbf{A}_3,\mathbf{A}_4\rangle\) is the sum of corresponding-entry products \(0(0)+1(1)+1(-1)+0(0)=0\), while \(\|\mathbf{A}_3/\sqrt{2}\|^2=(1+1)/2=1\). The other pairwise products and squared norms were computed above by the same entrywise formula.

Why Normalization Preserves Orthogonality

Theorem: In a real inner product space, let \(\mathbf{v}_1,\dots,\mathbf{v}_p\) be a finite orthogonal list of nonzero vectors. Then the list \(\mathbf{v}_1/\|\mathbf{v}_1\|,\dots,\mathbf{v}_p/\|\mathbf{v}_p\|\) is orthonormal.

Proof. Each denominator is positive because each \(\mathbf{v}_i\) is nonzero and the inner product is positive definite. For distinct indices \(i\) and \(j\), bilinearity gives

$$ \left\langle\frac{\mathbf{v}_i}{\|\mathbf{v}_i\|}, \frac{\mathbf{v}_j}{\|\mathbf{v}_j\|}\right\rangle =\frac{\langle\mathbf{v}_i,\mathbf{v}_j\rangle} {\|\mathbf{v}_i\|\|\mathbf{v}_j\|}=0, $$

because the original list is orthogonal. For each index \(i\),

$$ \left\langle\frac{\mathbf{v}_i}{\|\mathbf{v}_i\|}, \frac{\mathbf{v}_i}{\|\mathbf{v}_i\|}\right\rangle =\frac{\langle\mathbf{v}_i,\mathbf{v}_i\rangle}{\|\mathbf{v}_i\|^2} =\frac{\|\mathbf{v}_i\|^2}{\|\mathbf{v}_i\|^2}=1. $$

Thus the normalized list is orthogonal and each of its vectors has norm \(1\), which is exactly the definition of orthonormal. \(\square\)

The theorem requires that every vector be nonzero: division by the norm of the zero vector is undefined. It also shows why normalization is the final step when a list is already orthogonal, not a method for removing nonzero inner products.

Common Mistake: Using the Wrong Matrix Product

A frequent error is to test matrix orthogonality with \(\operatorname{tr}(\mathbf{A}\mathbf{B})\) instead of \(\operatorname{tr}(\mathbf{A}^{\top}\mathbf{B})\). These expressions are not interchangeable. For instance, let \(\mathbf{A}=\begin{bmatrix}0&1\\0&0\end{bmatrix}\). Then \(\mathbf{A}^2=\mathbf{O}\), so the incorrect expression gives \(\operatorname{tr}(\mathbf{A}\mathbf{A})=0\). That would falsely suggest that \(\mathbf{A}\) is orthogonal to itself.

The correct self-inner-product is

$$ \langle\mathbf{A},\mathbf{A}\rangle =\operatorname{tr}(\mathbf{A}^{\top}\mathbf{A}) =\sum_{i,j}a_{ij}^{2} =1. $$

Consequently \(\|\mathbf{A}\|=1\), not \(0\). Always use the inner product defined for the space, including its transpose, integration interval, or other specified details.

Check Your Understanding

For each question, use the stated inner product and show enough calculation to verify the result.

  1. Are \((1,2,0)^{\top}\) and \((2,-1,0)^{\top}\) orthogonal in \(\mathbb{R}^3\)? If so, give their normalized vectors.
  2. With \(\langle p,q\rangle=\int_{-1}^{1}p(x)q(x)\,dx\), compute \(\langle 1,x^2\rangle\) and \(\|x\|^2\).
  3. Using the trace inner product, find \(\left\langle\begin{bmatrix}1&2\\0&1\end{bmatrix},\begin{bmatrix}2&-1\\1&0\end{bmatrix}\right\rangle\).
  4. Explain why an orthogonal list containing a zero vector cannot be normalized entry by entry.
  5. For the matrices in the third worked example, verify directly that \(\|\mathbf{A}_2/\sqrt{2}\|=1\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon