While proving Rodriguez formula for Legendre classical orthogonal polynomials I found a part I cannot prove. Namely, if we define $Q_n(x) = \frac{(-1)^n}{2^n n!}((1-x^2)^n)^{(n)}$ and further observe $\langle Q_m(x), Q_n(x) \rangle$, for $m < n$ we have: $$\int_{-1}^1 Q_m(x) Q_n(x) 1 dx= $$
$$=\int_{-1}^1 \frac{(-1)^n}{2^n n!} Q_m(x)((1-x^2)^n)^{(n)} dx=$$
$$=\frac{(-1)^n}{2^n n!} [Q_m(x)((1-x^2)^n)^{(n-1)} \bigg\rvert_{x=-1}^{x=1} - \int_{-1}^1 Q_m'(x)((1-x^2)^n)^{(n-1)}] = ... = 0.$$ The part that bothers me is the polynomial evaluation at points $x=-1$ and $x=1$. Why is it equal to $0$ for any $m < n$? I just couldn't prove it. Any help is appreciated.
Note that the left-hand term in your last equation is $0$, since $((1-x^2)^n)^{(n-1)} = 0$ for $x = -1, 1$. This follows because $(1-x^2)^n$ has degree-$n$ zeroes at $x = 1, -1$ and, in general, when a polynomial $p$ has a degree-$n$ zero at $x_0$ then $p(x_0), p'(x_0), \ldots, p^{(n-1)}(x_0) = 0$.
More generally, $((1-x^2)^n)^{(n-k)} = 0$ for $x = -1, 1$ for any $k > 0$. Repeatedly using this integration by parts trick - i.e., using induction - you can show that
$$\int_{-1}^1 Q_m(x)((1-x^2)^n)^{(n)} dx = (-1)^k \int_{-1}^1 Q_m^{(k)}(x)((1-x^2)^n)^{(n-k)} dx$$
for any $k$. Then when you reach $k = m+1$, you see that $Q_m^{(k)}(x) = 0$ since $Q_m$ is a polynomial of degree $m$, and the result follows.