If $\displaystyle f\in\mathcal{C}[0,1]$ we call $\displaystyle \int_0^1 f(x)x^n dx$ a

*moment* of $\displaystyle f$.

**Problem:** Prove that if $\displaystyle f,g\in\mathcal{C}[0,1]$ have the same moments (for $\displaystyle n=0,1,2,\cdots$) then the must be the same function.

**Proof:** Define the functional $\displaystyle J:\mathcal{C}[0,1]\to\mathbb{R}$ by $\displaystyle J[h]=\int_0^1 (f(x)-g(x))h(x)\text{ }dx$. We first prove that $\displaystyle J$ is continuous.

**Lemma:** $\displaystyle J[h]$ is continuous.

**Proof:** Note that if $\displaystyle \int_0^1 |f(x)-g(x)|dx=0$ we're done since the integral of a continuous non-negative function is zero only when the function is identically zero. Thus, we may assume that $\displaystyle \int_0^1 |f(x)-g(x)|dx\ne0$

Let $\displaystyle \varepsilon>0$ be given. Then choosing $\displaystyle h$ such that $\displaystyle \|h-h_0\|_{\infty}<\left(\int_0^1 |f(x)-g(x)|dx\right)^{-1}\varepsilon$ we see that

$\displaystyle \left|J[h_0]-J[h]\right|=\left|\int_0^1(f(x)-g(x))(h(x)-h_0(x))dx\right|$$\displaystyle \leqslant \int_0^1|f(x)-g(x)||h(x)-h_0(x)|dx$$\displaystyle <\varepsilon\left(\int_0^1|f(x)-g(x)|\right)^{-1}\int_0^1|f(x)-g(x)|dx=\varepsilon$

The conclusion follows. $\displaystyle \blacksquare$.

But notice by our assumption that $\displaystyle \int_0^1 f(x)x^n dx=\int_0^1 g(x)x^n dx$ for every $\displaystyle n\in\mathbb{N}\cup\{0\}$ or equivalently $\displaystyle J[x^n]=\int_0^1(f(x)-g(x))x^n dx=0$.

But, we in fact see that given any polynomial $\displaystyle p(x)=a_0+a_1x+\cdots a_n x^n$ that

$\displaystyle J[p(x)]=\int_0^1(f(x)-g(x))p(x)dx=\int_0^1(f(x)-g(x))(a_0+\cdots+a_n x^n)dx=$$\displaystyle a_0\int_0^1(f(x)-g(x))x^0+a_1\int_0^1(f(x)-g(x))x+\cdots+a_n\int_0^1(f(x)-g(x))x^n=0+\cdots+0=0$

And since by Weirstrass's theorem we have that the polynomials are dense in $\displaystyle \mathcal{C}[0,1]$ we have that $\displaystyle J[h]$ agrees with the zero function on a dense subset of it's domain. It follows that $\displaystyle J[h]=0$ for every $\displaystyle h$. The conclusion follows from

this. $\displaystyle \blacksquare$

Does that look right? I feel like I made this way harder than it need be.