[latexpage]
Let \( S \) be a subspace of \( \mathbb{R}^n \). The orthogonal complement of \( S \), denoted \( S^\perp \), is the subspace of \( \mathbb{R}^n \) that contains the vectors orthogonal to all the vectors in \( S \). If the subspace is described as the range of a matrix:
\[ S = \{ Ax \: : \: x \in \mathbb{R}^n \}, \]
then the orthogonal complement is the set of vectors orthogonal to the rows of \( A \), which is the nullspace of \( A^T \).
Example: Consider the line in \( \mathbb{R}^3 \) passing through the origin and generated by the vector \( u = (1,2,3) \). This is a subspace of dimension 1:
\[ S = \left\{ tu \: : \: t \in \mathbb{R} \right\} = \left\{ \left( \begin{array}{c} t \\ 2t \\ 3t \end{array} \right) \: : \: t \in \mathbb{R} \right\}. \]
To find the orthogonal complement, we find the set of vectors that are orthogonal to any vector of the form \( tu \), with arbitrary \( t \in \mathbb{R} \). This is the same set as the set of vectors orthogonal to \( u \) itself. So we solve for \( u^T x = 0 \) with \( x \in \mathbb{R}^3 \):
\[ x_1 + 2 x_2 + 3x_3 = 0. \]
This is equivalent to \( x_1 = -2x_2-3x_3 \). This equation characterizes the elements of the orthogonal complement \( S^\perp \), in the sense that any \( x \in S^\perp \) can be written as
\[ x = \left( \begin{array}{c} -2\alpha – 3\beta \\ \alpha \\ \beta \end{array} \right) = \alpha u + \beta v, \]
for some scalars \( \alpha, \beta \), where
\[ u = \left( \begin{array}{c} -2 \\ 1 \\ 0 \end{array} \right), \quad v = \left( \begin{array}{c} -3 \\ 0 \\ 1 \end{array} \right). \]
The orthogonal complement is thus the span of the vectors \( u, v \): \( S^\perp = \textbf{span}(u,v) \).