Linear Algebra · Undergraduate
Inner Product Spaces: Length and Angle for Functions
Quick answer
An inner product generalizes the dot product: it is symmetric, linear in each slot, and positive for every nonzero vector. On functions over [−1, 1], ⟨f, g⟩ = ∫ f(x)g(x) dx is an inner product, so functions get lengths, angles and orthogonality. Then projection works as in ℝⁿ. Gram–Schmidt turns 1, x, x² into orthogonal polynomials, and projecting a function onto a subspace gives its best approximation: the line closest to eˣ on [−1, 1] is about 1.175 + 1.104x.
What you'll learn
- Check the properties of an inner product
- Compute norms, angles and orthogonality for functions
- Apply Gram–Schmidt to polynomials
- Find a best approximation by orthogonal projection
The dot product, generalized
Length, angle and projection in all came from the dot product. An inner product on a vector space is any rule with the dot product’s key properties:
- ;
- ;
- whenever .
For continuous functions on , the rule
qualifies. Every definition from carries over: , and are orthogonal when , and the projection of onto is .
Why projection gives the best approximation
The proofs in used only the three properties, never the coordinates. So in any inner product space, the projection of onto a subspace leaves an error orthogonal to . For any other in , the Pythagorean theorem gives
The projection is the closest point of to , now measured by the integral of the squared error. This is least squares with infinitely many data points.
- y = eˣ
- tangent line 1 + x
- best line 1.175 + 1.104x
Worked examples
Common mistakes
Practice problems
-
On , find .
Answer
Full solution
.
-
On , find the multiple of closest to .
Answer
Full solution
.
-
On , find the best constant approximation to .
Answer
Full solution
, the average value of .
-
Are and orthogonal on ?
Answer
No
Full solution
.
-
Show that is an inner product on , and find .
Answer
Full solution
It is symmetric and linear, and for . For , .
-
Is an inner product on ?
Answer
No
Full solution
, which breaks positivity.
-
Check that is orthogonal to on .
Answer
Full solution
The integral of is and that of is .
-
A student finds the best quadratic approximation to on by adding the projections onto , and separately. Why is that wrong?
Answer
The coefficient formula needs an orthogonal basis, and and are not orthogonal.
Full solution
, so the separate projections overlap. Use instead.
Frequently asked questions
What is an inner product?
A rule ⟨u, v⟩ giving a number for each pair of vectors, which is symmetric, linear in each vector, and has ⟨v, v⟩ > 0 for every nonzero v.
What is the standard inner product for functions?
⟨f, g⟩ = ∫ₐᵇ f(x)g(x) dx over an interval. The length of f is ‖f‖ = √⟨f, f⟩.
When are two functions orthogonal?
When ⟨f, g⟩ = 0. On [−1, 1], 1 and x are orthogonal, and so is any even function with any odd function.
How do you find a best approximation?
Project f onto the subspace using an orthogonal basis: the coefficient of each basis vector uᵢ is ⟨f, uᵢ⟩/⟨uᵢ, uᵢ⟩. The result minimizes ‖f − g‖ over the subspace.
What are the Legendre polynomials?
The orthogonal polynomials from Gram–Schmidt applied to 1, x, x², … on [−1, 1]. Up to scaling they begin 1, x, x² − 1/3.