This is the problem $5$ from chapter $45$ on properties of Legendre polynomials from Simmons book "Differential Equations with Applications and Historical Notes".
If $p(x)$ is a polynomial of degree $n ≥ 1$ such that
$$\int_{-1}^{1} x^{k}p(x) dx = 0 \\ \text{for} \ k=0,1,2,\cdots,n-1$$
Show that $p(x)=cP_{n}(x)$ for some constant $c$
I gave it go, trying to use properties of even and odd function. I suspect that I have to use orthogonality of Legendre polynomials. Sadly I am stuck and have no idea what to do. I was also thinking about using induction out of despretation but that seems "wrong" for me in this case.
First of all, you should prove that $$\int_{-1}^1 x^k P_n(x)\ \mathrm dx=0$$ for all $0\le k<n$. Then, notice instead that $$\int_{-1}^1 x^n P_n(x)\ \mathrm dx\neq0$$ and call $C$ that value. Now, define your $c$ as $$c:=\frac1C\int_{-1}^1 x^n p(x)\ \mathrm dx$$
You proved that, for any $0\le k\le n$, it holds $$\int_{-1}^1 x^k (p(x)-cP_n(x))\ \mathrm dx=0$$ but now, by linearity, for ANY polinomial $q$ of degree $\le n$ it holds $$\int_{-1}^1 q(x) (p(x)-cP_n(x))\ \mathrm dx=0$$ But now, $p(x)-cP_n(x)$ is a polynomial of degree $\le n$, and so $$\int_{-1}^1 (p(x)-cP_n(x))^2\ \mathrm dx=0$$ and the only possibility is $p(x)-cP_n(x)=0$.