🧮 Brain Teaser

The Stone–Weierstrass Shortcut: Polynomials Dense, but How Dense?

Let f:[0,1]Rf : [0,1] \to \mathbb{R} be continuous and suppose

01f(x)xndx=0for all n=0,1,2,3,\int_0^1 f(x)\, x^n\, dx = 0 \quad \text{for all } n = 0, 1, 2, 3, \ldots

Prove that f0f \equiv 0 on [0,1][0,1].

Now here is the twist: what if the condition only holds for all even n=0,2,4,6,n = 0, 2, 4, 6, \ldots? Must ff still be identically zero?

Weierstrass approximationorthogonalitysubstitution trickdensity of polynomialsL2

Answer: Polynomials Dense: Orthogonality Forces Zero

Key Idea / Intuition

The first part is a classic application of the Weierstrass approximation theorem: if ff is orthogonal to every monomial xnx^n, it is orthogonal to every polynomial, hence (by density of polynomials in C([0,1])C([0,1])) orthogonal to itself — forcing f=0f = 0.

The twist is subtler. Even monomials {1,x2,x4,}\{1, x^2, x^4, \ldots\} are not dense in C([0,1])C([0,1]): they cannot approximate xx (an odd function on [0,1][0,1]), so the argument breaks. But with a clever substitution (x=t2x = t^2), the even-index condition is equivalent to the full condition for a different continuous function, so ff must still vanish — just for a less obvious reason.


Formal Proof / Solution

Part 1: Orthogonal to all monomials \Rightarrow f=0f = 0

Step 1. By linearity of the integral, orthogonality to all xnx^n implies orthogonality to every polynomial p(x)p(x): 01f(x)p(x)dx=0for all polynomials p.\int_0^1 f(x)\, p(x)\, dx = 0 \quad \text{for all polynomials } p.

Step 2. By the Weierstrass Approximation Theorem, there exist polynomials pnfp_n \to f uniformly on [0,1][0,1].

Step 3. Therefore: 01f(x)2dx=01f(x)f(x)dx=limn01f(x)pn(x)dx=0.\int_0^1 f(x)^2\, dx = \int_0^1 f(x)\cdot f(x)\, dx = \lim_{n\to\infty} \int_0^1 f(x)\, p_n(x)\, dx = 0.

Since ff is continuous and f20f^2 \geq 0 with 01f2=0\int_0^1 f^2 = 0, we conclude f0f \equiv 0. \blacksquare


Part 2: Orthogonal to even monomials \Rightarrow f=0f = 0?

Yes, ff must still be identically zero, and here is why.

The key substitution: Let x=t2x = t^2, so dx=2tdtdx = 2t\, dt. Then for each even n=2kn = 2k: 0=01f(x)x2kdx=01f(t2)t2k2tdt=201[tf(t2)]t2kdt.0 = \int_0^1 f(x)\, x^{2k}\, dx = \int_0^1 f(t^2)\, t^{2k} \cdot 2t\, dt = 2\int_0^1 [t\, f(t^2)]\, t^{2k}\, dt.

Define g(t)=tf(t2)g(t) = t\, f(t^2), which is continuous on [0,1][0,1]. The above says: 01g(t)t2kdt=0for all k=0,1,2,\int_0^1 g(t)\, t^{2k}\, dt = 0 \quad \text{for all } k = 0, 1, 2, \ldots

Now look at the n=0n = 0 condition (even): 01f(t2)2tdt=0\int_0^1 f(t^2)\cdot 2t\, dt = 0, which is 01g(t)dt=0\int_0^1 g(t)\, dt = 0. Good, this is the k=0k=0 case.

But we also need odd powers. Consider the condition for n=0n=0 gives 01g(t)1dt=0\int_0^1 g(t)\cdot 1\, dt = 0. For n=2k+1n = 2k+1 (odd powers of tt in gg): note that gg is orthogonal to all even powers t2kt^{2k}. To get odd powers, observe:

01g(t)t2k+1dt=01[tf(t2)]t2k+1dt=01f(t2)t2k+2dt=1201f(x)xk+1dx=0,\int_0^1 g(t)\, t^{2k+1}\, dt = \int_0^1 [t\,f(t^2)]\cdot t^{2k+1}\, dt = \int_0^1 f(t^2)\, t^{2k+2}\, dt = \frac{1}{2}\int_0^1 f(x)\, x^{k+1}\, dx = 0,

since k+1k+1 ranges over all positive integers as kk ranges over {0,1,2,}\{0,1,2,\ldots\}, and by hypothesis 01f(x)xmdx=0\int_0^1 f(x)x^m dx = 0 for all even mm (taking m=2(k+1)m = 2(k+1) when we make the reverse substitution…).

Let me give a cleaner route. Since {x2k}k0\{x^{2k}\}_{k\geq 0} orthogonality gives, after substitution u=x2u = x^2, that g(t)=tf(t2)g(t) = tf(t^2) is orthogonal to all monomials t2kt^{2k} and (by the t2k+1t^{2k+1} computation just done) also orthogonal to all t2k+1t^{2k+1}. So gg is orthogonal to all monomials, hence g0g \equiv 0 by Part 1.

So tf(t2)=0t\,f(t^2) = 0 for all t[0,1]t \in [0,1]. For t>0t > 0 this gives f(t2)=0f(t^2) = 0, and since t2t^2 ranges over (0,1](0,1] as tt ranges over (0,1](0,1], we get f(x)=0f(x) = 0 for all x(0,1]x \in (0,1]. By continuity at 00, f(0)=0f(0) = 0 as well.

Therefore f0f \equiv 0. \blacksquare


Summary

| Condition | Dense in C([0,1])C([0,1])? | f=0f=0? | |---|---|---| | Orthogonal to all xnx^n | Yes (Weierstrass) | Yes | | Orthogonal to all x2kx^{2k} | No | Yes (via substitution trick) |

The surprise: even though even monomials are not dense, the substitution x=t2x = t^2 "transfers" the condition to a function gg that ends up being orthogonal to all monomials.

Type: analysisEdit on GitHub ↗