From Finite Sums to Integrals
The dot product of two real vectors is a sum of products of corresponding coordinates. For functions, an integral can play the role of that sum: it accumulates the products of two function values across an interval. The resulting pairing depends both on the formula and on the space of functions where it is used. On continuous functions over an interval of positive length, it is a real inner product. On a larger space of pointwise-defined Riemann-integrable functions, positive definiteness can fail.
Fix real numbers \(a<b\), and let \(C[a,b]\) denote the real vector space of continuous functions \(f:[a,b]\to\mathbb{R}\). Addition and scalar multiplication are defined pointwise: \((f+g)(x)=f(x)+g(x)\) and \((cf)(x)=cf(x)\). The condition \(a<b\) ensures the interval has positive length.
For continuous \(f\) and \(g\), the product \(fg\) is continuous, so the definite integral in this definition exists. The same is true of \(f^2\). We use the standard properties of definite integrals: linearity, and nonnegativity of the integral of a nonnegative continuous function.
Checking the Inner Product Axioms
Proof. Let \(f,g,h\in C[a,b]\) and \(c,d\in\mathbb{R}\). First, multiplication of real numbers is commutative at every \(x\), so \(f(x)g(x)=g(x)f(x)\). Integrating gives \(\langle f,g\rangle=\langle g,f\rangle\). Next, pointwise addition and scalar multiplication give \((cf+dh)(x)g(x)=c f(x)g(x)+d h(x)g(x)\). By linearity of the definite integral, \(\langle cf+dh,g\rangle=c\langle f,g\rangle+d\langle h,g\rangle\). Symmetry then gives linearity in the second argument as well. For positive definiteness, \(f(x)^2\ge 0\) for every \(x\), so \(\langle f,f\rangle=\int_a^b f(x)^2\,dx\ge 0\). If \(f\) is the zero function, this integral is zero. Now suppose \(f\ne 0\), so there is \(x_0\in[a,b]\) with \(f(x_0)\ne0\). Set \(c_0=|f(x_0)|/2>0\). By continuity, there is a neighbourhood of \(x_0\) within \([a,b]\) on which \(|f(x)|\ge c_0\). Because \(a<b\), this neighbourhood contains a subinterval \(J\subseteq[a,b]\) of positive length, including when \(x_0\) is an endpoint. On \(J\), \(f(x)^2\ge c_0^2\); on the rest of \([a,b]\), \(f(x)^2\ge0\). Therefore \(\int_a^b f(x)^2\,dx\ge c_0^2\,\operatorname{length}(J)>0\). All three inner product properties hold. \(\square\)
The continuity hypothesis is essential to the positive-definiteness argument: continuity ensures that if a function is nonzero at even one point, its square stays bounded away from zero on a small interval. A function that is nonzero at just one point does not have this property. The interval condition matters too. If \(a=b\), every integral from \(a\) to \(b\) is zero, so the formula cannot be positive definite on any function space containing a nonzero function.
Computing Integral Inner Products
Worked Example: A Pair of Polynomials on \([0,1]\)
Let \(f(x)=1+x\) and \(g(x)=x^2\). Compute \(\langle f,g\rangle\) and check it by reversing the arguments.
Multiply the functions, then integrate term by term:
Reversing the arguments gives \(\langle g,f\rangle=\int_0^1 x^2(1+x)\,dx\). The integrand is again \(x^2+x^3\), so the same antiderivative gives \(\langle g,f\rangle=\frac{7}{12}\), as required by symmetry.
Worked Example: Checking Linearity by Calculation
On \([0,1]\), let \(f(x)=1-x\), \(g(x)=x\), and \(h(x)=1+x\). Compute \(\langle 2f-3h,g\rangle\) both using linearity and directly from the functions.
First compute the two inner products on the right-hand side of the linearity rule:
Linearity predicts \(2\langle f,g\rangle-3\langle h,g\rangle =2\cdot\frac16-3\cdot\frac56 =\frac13-\frac{15}{6} =-\frac{13}{6}\). Now compute the left-hand side directly. The function \(2f-3h\) is \(2(1-x)-3(1+x)=-1-5x\), so
The direct calculation agrees with the value obtained from linearity.
Worked Example: A Positive Self-Inner Product
On \([-1,1]\), let \(p(x)=x^2-\frac14\). Compute \(\langle p,p\rangle\) exactly and check that it is positive.
Square the polynomial and integrate each term:
As a direct check, \(p(x)^2\) is nonnegative everywhere and is positive except at \(x=-\frac12\) and \(x=\frac12\). The computed value is positive, consistent with positive definiteness for this nonzero continuous function.
Which Function Spaces Work?
Once the formula is known to be an inner product on \(C[a,b]\), it also works on any vector subspace of \(C[a,b]\). A vector subspace \(U\) is a subset that contains the zero function and is closed under addition and scalar multiplication. Examples include the polynomials of degree at most \(n\), restricted to \([a,b]\), and any span of a finite list of continuous functions.
Proof. Take \(f,g,h\in U\) and real scalars \(c,d\). Since \(U\subseteq C[a,b]\), the integrals exist. The symmetry and linearity calculations in the theorem apply to these functions without change. If \(f=0\), then \(\langle f,f\rangle=0\). If \(f\ne0\) as an element of \(U\), it is a nonzero function in \(C[a,b]\), so the positive-definiteness argument in the theorem gives \(\int_a^b f(x)^2\,dx>0\). Thus the restricted pairing satisfies all the inner product properties on \(U\). \(\square\)
For example, let \(U\) be the space of real polynomials of degree at most \(2\) on \([-1,1]\). It is a subspace of \(C[-1,1]\), so the integral formula is an inner product on \(U\). The example with \(p(x)=x^2-\frac14\) computes one self-inner product in this space. The same argument works for any finite-dimensional or infinite-dimensional subspace of continuous functions; finite dimensionality is not needed.
Common Pitfall: Pointwise Nonzero Does Not Always Mean Positive
A tempting but incorrect argument is: “If \(q\ne0\), then \(q(x)^2>0\) somewhere, so \(\int_0^1q(x)^2\,dx>0\).” This does not hold for every Riemann-integrable function. Define \(q:[0,1]\to\mathbb{R}\) by \(q(\frac12)=1\) and \(q(x)=0\) for \(x\ne\frac12\). This function is not the zero function, but \(q^2=q\), and its integral is zero.
To verify the integral carefully, choose an odd positive integer \(n\) large enough that \(\frac1n<\varepsilon\), for any \(\varepsilon>0\), and use the uniform partition of \([0,1]\) into \(n\) intervals of length \(\frac1n\). Since \(n\) is odd, \(\frac12\) lies strictly inside the central subinterval, not at a partition point. Every other subinterval has supremum and infimum of \(q^2\) equal to zero. On the central subinterval, the supremum is \(1\) and the infimum is \(0\): the function takes value \(1\) at \(\frac12\) and value \(0\) at all other points there. Thus the lower Darboux sum is \(0\), the upper Darboux sum is \(\frac1n<\varepsilon\), and their difference is less than \(\varepsilon\). By the Riemann integrability criterion, \(q^2\) is Riemann integrable, and these bounds give \(\int_0^1q(x)^2\,dx=0\).
The interval placement matters in this argument. If a partition put \(\frac12\) at a partition point, both adjacent subintervals would have supremum \(1\), so the upper sum could include the lengths of both. Choosing an odd number of equal subintervals puts \(\frac12\) strictly inside exactly one subinterval, giving the stated upper-sum bound. Consequently, the integral formula is not positive definite on the space of all pointwise-defined Riemann-integrable functions. On \(C[a,b]\), continuity prevents this one-point exception and guarantees positive definiteness.
There is a related condition on the interval itself: \(a<b\) cannot be dropped. If \(a=b\), then \(\int_a^a f(x)^2\,dx=0\) for every function \(f\), including nonzero continuous functions. The formula then fails positive definiteness. Checking the function space and the interval is therefore part of checking whether an integral pairing is truly an inner product.
Check Your Understanding
Use the definition and the integral properties stated above. Keep track of both the function space and the interval in each answer.
- On \([0,1]\), compute \(\langle 1-x,1+x\rangle\) by expanding the product and integrating.
- For \(f(x)=x\) on \([-1,1]\), compute \(\langle f,f\rangle\). Is the result positive?
- Explain why the integral formula is positive definite on the space of polynomials of degree at most \(3\) on \([0,2]\).
- For the function \(q\) that is \(1\) only at \(x=\frac12\) and \(0\) elsewhere on \([0,1]\), describe a partition that gives upper and lower sums differing by less than a prescribed \(\varepsilon>0\).
- What fails if the interval is \([a,a]\) rather than \([a,b]\) with \(a<b\)?