Let $f,g:[a,b]\to\Bbb{R}$ be continuous functions. We call $\int_a^b x^kf(x)\,\mathrm{d}x$ the $k$-th moment of $f$. Prove that if $f$ and $g$ have identical $k$-th moments for all $k\geq 0$, then $f=g$.
1. We will prove a more general result. Suppose $f,g$ are in $L^1[a,b]$ and they have identical $k$-th moments for all $k\geq 0$. Let $h(x)=f(x)-g(x)$. By hypothesis, $\int_a^bp(x)h(x)dx=0$ for every polynomial $p(x)$. Thus, by the Weierstrass Approximation Theorem, it follows that $\int_a^bc(x)h(x)dx=0$ for every continuous function $c(x)$. Consider the continuous function $\rho_n (x) = Cne^{\frac{-1}{1-|nx|^2}}\chi_{[-1/n,1/n]}(x)$ for $n \in \mathbb{N}$ and $C$ such that $\int_\mathbb{R}\rho(x)dx=1$. Then, the convolution $\rho_n\star h(y) = \int_a^b\rho(y-x)h(x)dx=0 \to h(y)$, as $n \to \infty$, for almost every $y \in [a,b]$. Thus, $f=g$ a.e. and, if they are continuous, everywhere.