<s>[INST] Show that $\int_{0}^{1}\{P(x)\}^{2}\,dx = (n + 1)^{2}\left(\int_{0}^{1}P(x)\,dx\right)^{2}$ 
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.
 [/INST] Since, $\displaystyle \int_0^1 x^kP(x)\,dx=\frac{a_0}{n+k+1}+\frac{a_1}{n+k}+\ldots+\frac{a_n}{k+1}=0$, for each $k=1,2,\ldots,n$
Then $f(x)=\dfrac{a_0}{n+x+1}+\dfrac{a_1}{n+x}+\ldots+\dfrac{a_n}{x+1}=\dfrac{Q(x)}{(n+x+1)\ldots(x+1)}$ (where, Q is a polynomial of degree atmost n), has $n$ zeros $x=1,2,\ldots,n$.
Thus, $Q(x)=c(x-1)(x-2)\ldots(x-n)$, for some constant $c$.
Also, $(x+1)f(x)=\dfrac{a_0(x+1)}{n+x+1}+\dfrac{a_1(x+1)}{n+x}+\ldots+a_n=\dfrac{Q(x)}{(n+x+1)\ldots(x+2)}$
Setting, $x=-1$ in the above expression $a_n = \dfrac{Q(-1)}{n!}=\dfrac{c(-1)^n(n+1)!}{n!}=c(-1)^n(n+1)$
and, setting $x=0$ we have $\displaystyle \int_0^1 P(x)\,dx = \dfrac{a_0}{n+1}+\ldots+a_n=\dfrac{Q(0)}{(n+1)!}=\dfrac{c(-1)^n}{n+1}$.
Thus $a_n=\displaystyle (n+1)^2\int_0^1 P(x)\,dx$, implying $\displaystyle \int_{0}^{1}\{P(x)\}^{2}\,dx = (n + 1)^{2}\left(\int_{0}^{1}P(x)\,dx\right)^{2}$.
</s>