TITLE: Show that $\int_{0}^{1}\{P(x)\}^{2}\,dx = (n + 1)^{2}\left(\int_{0}^{1}P(x)\,dx\right)^{2}$
QUESTION [7 upvotes]: Suppose $P(x)$ is a polynomial of degree $n \geq 1$ such that $\int_{0}^{1}x^{k}P(x)\,dx = 0$ for $k = 1, 2, \ldots, n$. Show that $$\int_{0}^{1}\{P(x)\}^{2}\,dx = (n + 1)^{2}\left(\int_{0}^{1}P(x)\,dx\right)^{2}$$

If we assume that $P(x) = a_{0}x^{n} + \cdots + a_{n - 1}x + a_{n}$ then we can easily see that $$\int_{0}^{1}\{P(x)\}^{2}\,dx = a_{n}\int_{0}^{1}P(x)\,dx$$ and therefore to solve the given problem we need to show that $$\int_{0}^{1}P(x)\,dx = \frac{a_{n}}{(n + 1)^{2}}$$ Direct integration of the polynomial gives the expression $$\frac{a_{0}}{n + 1} + \frac{a_{1}}{n} + \cdots + \frac{a_{n - 1}}{2} + a_{n}$$ and simplifying this to $a_{n}/(n + 1)^{2}$ does not seem possible. I think there is some nice "integration by parts" trick which will give away the solution, but I am not able to think of it.

REPLY [2 votes]: Note that $P(x)$ is a linear combination of $1$ and $x, x^2$, $\ldots$, $x^n$ and is perpendicular to the subspace generated by $x, x^2$, $\ldots$, $x^n$. Therefore $P$ gives the direction of the vertical component of $1$.
Now, we must show that
$$\frac{\langle 1, P\rangle ^2 }{\|P\|^2} = \frac{1}{(n+1)^2}$$
that is, $d(1, \langle x,x^2, \ldots, x^n\rangle)^2=\frac{1}{(n+1)^2}$,
in words, the distance from $1$ to the subspace generated by $x,x^2, \ldots,x^n$ equals $\frac{1}{n+1}$. Now we have
$$d^2 = \frac{G(1,x,\ldots, x^n)}{G(x,x^2, \ldots, x^n)}$$
where the $G$'s are Gram determinants that can be calculated with the formula for Cauchy determinants.
$\bf{Added:}$ One sees easily that the Gram matrix for the system of functions $(x^{\alpha_i})$ is the symmetric Cauchy matrix $(\frac{1}{\alpha_i + \alpha_j+1})$, with determinant $V(\alpha_i)\cdot\prod_{i,j} \frac{1}{\alpha_i + \alpha_j+1}$, where $V$ is the Vandermonde determinant. We get for the distance squared $d^2$ from $x^{\alpha}$ to the span of $(x^{\alpha_i})_i$
$$d^2=\frac{G(x^{\alpha},x^{\alpha_i})}{G(x^{\alpha_i})}=\frac{1}{2\alpha+1}\prod_i \frac{(\alpha_i-\alpha)^2}{(\alpha_i+\alpha+1)^2}$$
For $\alpha=0$ and $\alpha_i=i$, with $1\le i \le n$, we get the desired value
$\frac{(n!)^2}{(n+1)!^2} = \frac{1}{(n+1)^2}$.