On this page
You already know the dot product: multiply matching components and add. It gives you lengths and angles. An inner product space keeps that geometry and drops the demand that vectors be arrows, so it works for polynomials and functions too.
What is an inner product space?
A real inner product on a vector space V is a rule that takes two vectors u and v and returns a number ⟨u, v⟩ obeying three axioms (Inner product space, Wikipedia):
Symmetry: ⟨u, v⟩ = ⟨v, u⟩.
Linearity: ⟨au + bw, v⟩ = a⟨u, v⟩ + b⟨w, v⟩ for any numbers a and b.
Positive-definiteness: ⟨v, v⟩ > 0 whenever v ≠ 0.
In one line, a real inner product is a positive-definite symmetric bilinear form. Length is ‖v‖ = √⟨v, v⟩, and u and v are orthogonal when ⟨u, v⟩ = 0. Complex spaces swap symmetry for conjugate symmetry; we stay real here.
Two examples carry this post:
On Rⁿ, the dot product ⟨u, v⟩ = u₁v₁ + u₂v₂ + … + uₙvₙ.
On continuous functions on [0, 1], including polynomials, ⟨f, g⟩ = ∫₀¹ f(x) g(x) dx, an example the same article gives.
The integral passes all three: swapping f and g changes nothing, integrals are linear, and ∫₀¹ f² dx > 0 unless f is zero on all of [0, 1] (continuity matters here).
What does Cauchy–Schwarz say, and why does it give angles?
The Cauchy–Schwarz inequality says |⟨u, v⟩| ≤ ‖u‖ ‖v‖ in every inner product space. Augustin-Louis Cauchy published it for sums in 1821, Viktor Bunyakovsky and Hermann Schwarz published the integral version in 1859 and 1888, and Schwarz gave the modern proof (Cauchy–Schwarz inequality, Wikipedia). Because ⟨u, v⟩ / (‖u‖ ‖v‖) always lies between −1 and 1, it can be the cosine of an angle, and that is how the angle between two vectors is defined in a real inner product space (Inner product space, Wikipedia).
Take f(x) = 1 and g(x) = x on [0, 1]:
⟨1, x⟩ = ∫₀¹ x dx = 1/2.
‖1‖² = ∫₀¹ 1 dx = 1 and ‖x‖² = ∫₀¹ x² dx = 1/3, so ‖x‖ = 1/√3.
cos θ = (1/2) ÷ (1/√3) = √3/2, so the angle between 1 and x is exactly 30°.
Here Cauchy–Schwarz reads (1/2)² ≤ 1 · 1/3, that is 1/4 ≤ 1/3. Move to [−1, 1] and ⟨1, x⟩ = 0, so the two become orthogonal; that is where Legendre polynomials, worked by hand begin.
How do you project onto a subspace?
Let W have basis w₁, …, wₖ. The orthogonal projection of v onto W is the p in W whose error v − p is orthogonal to every vector in W. Writing p = c₁w₁ + … + cₖwₖ and demanding ⟨v − p, wⱼ⟩ = 0 for each j gives k linear equations, the normal equations. Gilbert Strang covers the Rⁿ case in lectures 15 and 16 of MIT's 18.06 (MIT OpenCourseWare). With an orthogonal basis the equations separate into cⱼ = ⟨v, wⱼ⟩ / ⟨wⱼ, wⱼ⟩, which is why Gram–Schmidt builds an orthonormal basis first.
Worked example: project v = x² onto W = span{1, x} with ⟨f, g⟩ = ∫₀¹ fg dx, writing p(x) = a + bx.
The inner products: ⟨1, 1⟩ = 1, ⟨1, x⟩ = 1/2, ⟨x, x⟩ = 1/3, ⟨x², 1⟩ = 1/3, ⟨x², x⟩ = 1/4.
Error orthogonal to 1: 1/3 − a − b/2 = 0.
Error orthogonal to x: 1/4 − a/2 − b/3 = 0.
From step 2, a = 1/3 − b/2. Substituting gives 1/12 − b/12 = 0, so b = 1 and a = −1/6.
So p(x) = x − 1/6. The error x² − x + 1/6 is one-sixth of the shifted Legendre polynomial 6x² − 6x + 1 (Legendre polynomials, Wikipedia), which is orthogonal to 1 and x, as it must be. Pythagoras checks the arithmetic: ‖x²‖² = 1/5, ‖p‖² = 7/36, the squared error is 1/180, and 7/36 + 1/180 = 1/5.
Why is the projection the best approximation?
For any other w in W, split v − w = (v − p) + (p − w). The second piece lies in W, so it is orthogonal to the first, and Pythagoras gives ‖v − w‖² = ‖v − p‖² + ‖p − w‖². That is never less than ‖v − p‖², with equality only when w = p. The projection is the unique closest point.
Test it. The chord y = x meets x² at both ends and looks like a fair guess. Its squared error is ∫₀¹ (x² − x)² dx = 1/5 − 1/2 + 1/3 = 1/30, against 1/180 for the projection. Since p − x = −1/6, Pythagoras predicts 1/180 + 1/36 = 1/30, exactly.
If the definite integrals trip you up, the Fermi Concept Library gives every concept in mathematics its own lesson and its place in the map. For practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
![Graph of x² on [0, 1] with its best-fit line x − 1/6](https://news.fermi.ai/media/images/2026/12/graph-of-x2-on-0-1-with-its-best-fit-line-x-1-6-b937ff59-1600x900.webp)


