Folioby Interconnected
Log InSign Up

The geometry that inner products unlock: orthogonality, projection, and least squares

A vector space, by itself, has no concept of length or angle. Inner products supply both — and with them come orthogonal projections, the Gram–Schmidt process, least squares, and the bridge to Fourier analysis.

FO
Folio Official
March 1, 2026

Up to this point in a linear algebra course, the only operations available in a vector space are addition and scalar multiplication. There is no notion of "length," no notion of "angle," and no way to say whether two vectors are "perpendicular." All of that changes with a single additional structure: the inner product.

1 The definition

Definition 1.
An inner product on a real vector space V is a function ⟨⋅,⋅⟩:V×V→R satisfying:
  1. ⟨u,v⟩=⟨v,u⟩ (symmetry)

  2. ⟨au+bv,w⟩=a⟨u,w⟩+b⟨v,w⟩ (linearity)

  3. ⟨v,v⟩≥0, with equality iff v=0 (positive definiteness)

The standard inner product on Rn, ⟨u,v⟩=∑ui​vi​, is the most familiar — but it is far from the only one.

Example 2 (Inner product on function spaces).
On C[0,1] (continuous functions on [0,1]), define
⟨f,g⟩=∫01​f(x)g(x)dx.
This satisfies all three axioms. It gives us a notion of "length" for functions: ∥f∥=∫01​f(x)2dx​.

2 Length and angle

An inner product immediately yields:

∥v∥cosθ​=⟨v,v⟩​(length / norm),=∥u∥⋅∥v∥⟨u,v⟩​(angle).​

When ⟨u,v⟩=0, we have θ=90°, and the vectors are orthogonal.

Theorem 3 (Cauchy–Schwarz inequality).
∣⟨u,v⟩∣≤∥u∥⋅∥v∥.

This inequality is what makes the definition of cosθ legitimate: it guarantees ∣cosθ∣≤1.

3 Gram–Schmidt orthonormalization

Given any basis, the Gram–Schmidt process produces an orthonormal one — a basis whose vectors are mutually perpendicular and each of unit length.

Example 4.
Orthonormalize the basis {v1​,v2​,v3​}=⎩⎨⎧​​110​​,​101​​,​011​​⎭⎬⎫​ of R3.

Step 1. Set u1​=v1​=​110​​ and normalize: e1​=2​1​​110​​.

Step 2. Subtract from v2​ its component along e1​:
u2​=v2​−⟨v2​,e1​⟩e1​=​101​​−21​​110​​=​1/2−1/21​​,
then normalize to get e2​.

Step 3. Subtract from v3​ its components along e1​ and e2​:
u3​=v3​−⟨v3​,e1​⟩e1​−⟨v3​,e2​⟩e2​,
then normalize to get e3​.

At each step, the idea is the same: strip away the components along directions already chosen. What remains is necessarily orthogonal to all of them.

4 Orthogonal projection: finding the closest point

One of the most powerful applications of inner products is orthogonal projection.

Given a subspace W and a vector v, the orthogonal projection v^ onto W is the point in W closest to v.

Theorem 5.
If {e1​,…,ek​} is an orthonormal basis for W, then
v^=i=1∑k​⟨v,ei​⟩ei​,
and the error v−v^ is orthogonal to every vector in W.

5 Least squares

Suppose you have experimental data (x1​,y1​),…,(xm​,ym​) and want to fit a line y=a+bx. When m>2, there is generally no line passing through all points — the system Ax=b is overdetermined.

The least-squares solution is the one that minimizes ∥Ax−b∥2. Geometrically, it projects b onto the column space of A and then solves the consistent system.

Theorem 6 (Normal equations).
The least-squares solution satisfies
ATAx=ATb.
Example 7.
Fit y=a+bx to the points (0,1), (1,2), (2,4).
A=​111​012​​,b=​124​​.
Solving ATAx^=ATb gives a^=2/3 and b^=3/2. The best-fit line is y=32​+23​x.

6 The bridge to Fourier analysis

Equip C[−π,π] with the inner product ⟨f,g⟩=∫−ππ​f(x)g(x)dx. The functions {1,cosx,sinx,cos2x,sin2x,…}, suitably normalized, form an orthonormal system.

Projecting a function f onto these basis functions gives the Fourier expansion:

f(x)≈2a0​​+n=1∑N​(an​cosnx+bn​sinnx),
where
an​=π1​∫−ππ​f(x)cosnxdx=∥cosnx∥2⟨f,cosnx⟩​.

Fourier series is orthogonal projection in an infinite-dimensional inner product space. The same principle that finds the best-fit line through three data points also decomposes a sound wave into its constituent frequencies.

7 The takeaway

An inner product gives a vector space geometry: length, angle, and orthogonality. With these come the Gram–Schmidt process, orthogonal projection, least squares, and Fourier analysis — all manifestations of a single idea. Whether you are fitting a regression line to data or decomposing a function into harmonics, you are projecting onto a subspace in an inner product space. One structure, one principle, and an extraordinary range of applications.

Linear AlgebraAlgebraBetween the Lines
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Linear Algebra — Between the LinesPart 6 of 6
Previous
Why eigenvalues matter: how diagonalization simplifies everything
No next article

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

What is "dimension," really? The truth about degrees of freedom

We all say "three-dimensional space" without blinking — but what exactly does the "three" mean? The answer is less obvious than it seems, and proving it requires the Steinitz exchange lemma.

Linear AlgebraAlgebraBetween the Lines
1
Folio Official·March 1, 2026

Cosets and quotient groups: the art of controlled forgetting

The quotient group G/N is the first major conceptual hurdle in group theory. By computing small examples by hand -- from clock arithmetic to D4 modulo its center -- we build the intuition for what "dividing" a group really means, and why normality is indispensable.

Group TheoryAlgebraBetween the Lines
1
Folio Official·March 1, 2026

Matrices and Representation of Linear Maps

Every linear map between finite-dimensional spaces is uniquely represented by a matrix once bases are chosen, and composition of maps corresponds to matrix multiplication. We derive the change-of-basis formula, characterize invertible matrices, and show that matrix rank equals the rank of the corresponding linear map.

Linear AlgebraAlgebraTextbook
Folio Official·March 1, 2026

The Determinant: A Scalar Invariant of Square Matrices

The determinant of a square matrix is the unique scalar-valued function characterized by alternation and multilinearity. We construct it via the Leibniz formula, prove the product formula det(AB) = det(A)det(B), and derive Cramer's rule for solving linear systems.

Linear AlgebraAlgebraTextbook