# Let $f, g$ be polynomials of degree n such that $\int_0^1 x^kf(x)dx =\int_0^1x^k g(x)dx$ holds for each $k = 0, 1, . . . , n.$ Show that $f = g.$

Let $$f, g$$ be polynomials of degree n such that $$\int_0^1 x^kf(x)dx =\int_0^1x^k g(x)dx$$ holds for each $$k = 0, 1, . . . , n.$$ Show that $$f = g.$$

I considered the function $$h(x)=f(x)-g(x)$$ and got $$\int_0^1 x^kh(x)dx=0, k=0,1,...,n$$. How do I proceed further?

Denote $$h(x)= \sum_{k=0}^n a_k x^k.$$
$$\int_{0}^1 h(x) h(x) dx = \sum_{k=0}^n a_k \underbrace{\int_0^1 h(x) x^k dx}_{=0} = 0$$
Then you have $$\int_0^1 |h(x)|^2 =0$$, which implies that $$h(x)=0$$ for all $$x$$ in $$[0,1]$$, which should be enough for you to conclude.