🧮 Brain Teaser

The Continuous Function That Must Be Zero

Let f:[0,1]→Rf: [0,1] \to \mathbb{R} be a continuous function satisfying

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

Must f≡0f \equiv 0?

Now suppose instead we only know

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

(i.e., we are missing the n=0n=0 case). Must f≡0f \equiv 0?

For the second condition, either prove f≡0f \equiv 0 or find an explicit nonzero counterexample.

Weierstrass approximationorthogonalitycontinuitydensity of polynomialsfunctional analysis

Answer: Orthogonality to Monomials: Missing n=0

Key Idea / Intuition

For the first part, the Weierstrass Approximation Theorem says polynomials are dense in C([0,1])C([0,1]), so if ff is orthogonal to every polynomial, it must be orthogonal to itself — forcing f=0f = 0. For the second part, the subtlety is that we're missing the constant term. A function can vanish against all monomials x,x2,x3,…x, x^2, x^3, \ldots without being zero, provided its "net area" compensates. The function f(x)=1−(n+1)xnf(x) = 1 - (n+1)x^n for appropriate nn won't work directly, but f(x)=1f(x) = 1 against xnx^n for n≥1n \geq 1 gives ∫01xndx=1n+1≠0\int_0^1 x^n dx = \frac{1}{n+1} \neq 0, so that fails too. The real key: for the second condition, f≡0f \equiv 0 is still forced, because {xn:n≥1}\{x^n : n \geq 1\} together with the missing constant is enough — specifically, the linear span of {x,x2,…}\{x, x^2, \ldots\} is dense in {g∈C([0,1]):g(0)=0}\{g \in C([0,1]) : g(0) = 0\}, but by a continuity trick we can still conclude f=0f = 0.


Formal Proof / Solution

Part 1: All n≥0n \geq 0

If ∫01f(x)xndx=0\int_0^1 f(x) x^n dx = 0 for all n≥0n \geq 0, then by linearity, ∫01f(x)p(x) dx=0\int_0^1 f(x) p(x)\, dx = 0 for every polynomial pp.

By the Weierstrass Approximation Theorem, there exist polynomials pk→fp_k \to f uniformly on [0,1][0,1]. Then: ∫01f(x)2 dx=lim⁡k→∞∫01f(x) pk(x) dx=0.\int_0^1 f(x)^2\, dx = \lim_{k \to \infty} \int_0^1 f(x)\, p_k(x)\, dx = 0.

Since ff is continuous and f2≥0f^2 \geq 0, we conclude f≡0f \equiv 0. ✓\checkmark


Part 2: All n≥1n \geq 1 only

Claim: f≡0f \equiv 0 is still forced.

Proof. The hypothesis gives ∫01f(x)xndx=0\int_0^1 f(x) x^n dx = 0 for all n≥1n \geq 1.

Step 1. By linearity, ∫01f(x)q(x) dx=0\int_0^1 f(x) q(x)\, dx = 0 for every polynomial qq with zero constant term, i.e., q(0)=0q(0) = 0.

Step 2. Consider the function g(x)=f(x)−cg(x) = f(x) - c where c=∫01f(x) dxc = \int_0^1 f(x)\, dx is the "missing" piece. We don't directly control cc, but we can use a different trick.

Better approach. Apply the substitution or use the fact that x↦x⋅p(x)x \mapsto x \cdot p(x) spans {\{polynomials vanishing at 0}0\}.

Polynomials x,x2,x3,…x, x^2, x^3, \ldots span a space that is dense in

A={g∈C([0,1]):g(0)=0}\mathcal{A} = \{g \in C([0,1]) : g(0) = 0\}

by Weierstrass (approximate any gg with g(0)=0g(0)=0 by polynomials, then subtract the constant term — but the constant term is g(0)=0g(0) = 0, so the approximating polynomials can be taken to vanish at 0 by subtracting a small correction).

So we can find polynomials qk(x)=∑j=1mkaj(k)xjq_k(x) = \sum_{j=1}^{m_k} a_j^{(k)} x^j (no constant term) with qk→f(⋅)q_k \to f(\cdot) uniformly... but wait, this would require f(0)=lim⁡qk(0)=0f(0) = \lim q_k(0) = 0.

We do not know f(0)=0f(0) = 0. So we must be more careful.

Correct Argument. We know:

∫01f(x)xn dx=0∀n≥1.\int_0^1 f(x) x^n\, dx = 0 \quad \forall n \geq 1.

This means ff is orthogonal to {x,x2,x3,…}\{x, x^2, x^3, \ldots\} in L2([0,1])L^2([0,1]).

Now take n=1n = 1: ∫01xf(x) dx=0\int_0^1 x f(x)\, dx = 0.

By the same Weierstrass argument applied to x⋅f(x)x \cdot f(x): the function h(x)=xf(x)h(x) = x f(x) satisfies ∫01h(x)xn−1dx=0\int_0^1 h(x) x^{n-1} dx = 0 for all n≥1n \geq 1, i.e., ∫01h(x)xm dx=0\int_0^1 h(x) x^m\, dx = 0 for all m≥0m \geq 0.

By Part 1, h(x)=xf(x)≡0h(x) = x f(x) \equiv 0 on [0,1][0,1].

Since xf(x)=0x f(x) = 0 for all x∈[0,1]x \in [0,1] and x≠0x \neq 0 on (0,1](0,1], we get f(x)=0f(x) = 0 for all x∈(0,1]x \in (0,1]. By continuity of ff, also f(0)=0f(0) = 0.

Therefore f≡0f \equiv 0. ■\blacksquare


Summary

| Condition | Conclusion | |-----------|-----------| | ∫01fxndx=0\int_0^1 f x^n dx = 0 for n≥0n \geq 0 | f≡0f \equiv 0 via Weierstrass directly | | ∫01fxndx=0\int_0^1 f x^n dx = 0 for n≥1n \geq 1 | f≡0f \equiv 0 via the trick h(x)=xf(x)h(x) = xf(x), reducing to Part 1 |

The elegant trick: multiplying by xx shifts the index, turning "missing n=0n=0" into "having all n≥0n \geq 0" for the product xf(x)xf(x).

Type: analysisEdit on GitHub ↗