Determinant of a 3x3 Matrix: From First Row Expansion to Sarrus' Rule
The Story: Two Perspectives on the $3 \times 3$ Determinant The determinant of a $3 \times 3$ matrix measures …
The Gram-Schmidt Process is an algorithm for orthonormalizing a set of vectors in an inner product space. But before diving into formulas, let’s explain what this algorithm does.
If you are handed an arbitrary, skewed set of coordinate axes that span a space, how do you straighten them out into a pristine set of mutually perpendicular, unit-length grid lines—without altering the space they enclose?
In geometry, one of the primary relationships between two lines in space is perpendicularity. We say that one line is perpendicular to another line if the first line meets the second line at right angles ($90^\circ$).
Perpendicularity is a symmetric relationship:
$$ L_1 \perp L_2 \iff L_2 \perp L_1 $$In other words, if one line is perpendicular to the second line, the second line is also perpendicular to the first line. Therefore, you can say that two lines are perpendicular to each other or the two lines are mutually perpendicular.
In linear algebra, one of the primary relationships between two vectors is orthogonality. You can think of the orthogonality relationship between two vectors in an inner product space as a generalization of the perpendicularity relationship between two lines in geometry space.
We say that vector $\mathbf{u}$ is orthogonal to vector $\mathbf{v}$ in an inner product space if the inner product equals zero:
$$ \langle \mathbf{u}, \mathbf{v} \rangle = 0 $$(In standard Euclidean space $\mathbb{R}^n$, the inner product is the familiar dot product: $\mathbf{u} \cdot \mathbf{v} = 0$.)
Since the inner product is symmetric ($\langle \mathbf{u}, \mathbf{v} \rangle = \langle \mathbf{v}, \mathbf{u} \rangle$), if one vector is orthogonal to the second vector, the second vector is also orthogonal to the first vector:
$$ \mathbf{u} \perp \mathbf{v} \iff \mathbf{v} \perp \mathbf{u} $$Therefore, you can say that two vectors are orthogonal to each other or the two vectors are orthogonal.
We say that a set of vectors is orthogonal if each pair of distinct vectors in the set is orthogonal:
$$ \langle \mathbf{u}_i, \mathbf{u}_j \rangle = 0 \quad \text{for all } i \neq j $$When we orthonormalize vectors in an inner product space, we take a set of vectors that should be linearly independent and finite, and generate a new set of vectors that is orthogonal and spans the original set:
$$ \text{span}\{\mathbf{u}_1, \dots, \mathbf{u}_k\} = \text{span}\{\mathbf{v}_1, \dots, \mathbf{v}_k\} $$In other words, the purpose of the Gram-Schmidt Process is to generate a new set of vectors that is orthogonal and spans the input set of the algorithm.
In two dimensions, we start with two linearly independent vectors $\mathbf{v}_1$ and $\mathbf{v}_2$:
Step 1 — Choose the First Anchor: Pick the first vector as our reference direction:
$$\mathbf{u}_1 = \mathbf{v}_1$$Step 2 — Decompose the Second Vector: The vector $\mathbf{v}_2$ decomposes into two perpendicular components: a component parallel to $\mathbf{u}_1$, and a component perpendicular to $\mathbf{u}_1$:
$$\mathbf{v}_2 = \text{proj}_{\mathbf{u}_1}(\mathbf{v}_2) + \mathbf{u}_2$$Step 3 — Subtract the Projection: Using the orthogonal projection formula $\text{proj}_{\mathbf{u}_1}(\mathbf{v}_2) = \frac{\langle \mathbf{v}_2, \mathbf{u}_1 \rangle}{\langle \mathbf{u}_1, \mathbf{u}_1 \rangle} \mathbf{u}_1$, we isolate the orthogonal vector $\mathbf{u}_2$:
$$\mathbf{u}_2 = \mathbf{v}_2 - \frac{\langle \mathbf{v}_2, \mathbf{u}_1 \rangle}{\langle \mathbf{u}_1, \mathbf{u}_1 \rangle} \mathbf{u}_1$$Now $\{\mathbf{u}_1, \mathbf{u}_2\}$ forms an orthogonal basis for the 2D plane!
In three-dimensional space, we introduce a third linearly independent vector $\mathbf{v}_3$.
Vectors $\mathbf{u}_1$ and $\mathbf{u}_2$ already define a 2D orthogonal floor. Vector $\mathbf{v}_3$ points into 3D space, but may have non-zero components along both $\mathbf{u}_1$ and $\mathbf{u}_2$.
To make $\mathbf{u}_3$ strictly perpendicular to the entire floor:
Now $\mathbf{u}_3 \perp \mathbf{u}_1$ and $\mathbf{u}_3 \perp \mathbf{u}_2$. The triad $\{\mathbf{u}_1, \mathbf{u}_2, \mathbf{u}_3\}$ is completely mutually orthogonal in 3D!
Once all vectors are mutually perpendicular, we normalize each vector by dividing by its magnitude (norm):
$$ \mathbf{e}_1 = \frac{\mathbf{u}_1}{\|\mathbf{u}_1\|}, \quad \mathbf{e}_2 = \frac{\mathbf{u}_2}{\|\mathbf{u}_2\|}, \quad \mathbf{e}_3 = \frac{\mathbf{u}_3}{\|\mathbf{u}_3\|} $$The resulting set $\{\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3\}$ is an orthonormal basis of $\mathbb{R}^3$.
For any finite linearly independent set $\{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\}$ in an inner product space:
$$ \mathbf{u}_1 = \mathbf{v}_1 $$$$ \mathbf{u}_k = \mathbf{v}_k - \sum_{j=1}^{k-1} \frac{\langle \mathbf{v}_k, \mathbf{u}_j \rangle}{\langle \mathbf{u}_j, \mathbf{u}_j \rangle} \mathbf{u}_j $$$$ \mathbf{e}_k = \frac{\mathbf{u}_k}{\|\mathbf{u}_k\|} $$Part 1 — In the Plane ($\mathbb{R}^2$): Given linearly independent vectors $\{\mathbf{v}_1, \mathbf{v}_2\}$, we set $\mathbf{u}_1 = \mathbf{v}_1$. We then project $\mathbf{v}_2$ onto $\mathbf{u}_1$ and subtract it:
$$\mathbf{u}_2 = \mathbf{v}_2 - \text{proj}_{\mathbf{u}_1}(\mathbf{v}_2) = \mathbf{v}_2 - \frac{\langle \mathbf{v}_2, \mathbf{u}_1 \rangle}{\langle \mathbf{u}_1, \mathbf{u}_1 \rangle} \mathbf{u}_1$$This strips away any parallel component, leaving $\mathbf{u}_2$ strictly perpendicular to $\mathbf{u}_1$ ($\langle \mathbf{u}_1, \mathbf{u}_2 \rangle = 0$).

Part 2 — In 3D Space ($\mathbb{R}^3$): With $\{\mathbf{u}_1, \mathbf{u}_2\}$ spanning an orthogonal plane, the third vector $\mathbf{v}_3$ is orthogonalized by subtracting its projections onto both previous directions simultaneously:
$$\mathbf{u}_3 = \mathbf{v}_3 - \text{proj}_{\mathbf{u}_1}(\mathbf{v}_3) - \text{proj}_{\mathbf{u}_2}(\mathbf{v}_3)$$The resulting vector $\mathbf{u}_3$ points straight out of the plane, perpendicular to both $\mathbf{u}_1$ and $\mathbf{u}_2$.
