Let $f$ be a non negative function defined on $[0,1]$ and $\displaystyle \int^{1}_{0}(f(x))^2dx=1$
Find the max of $\displaystyle \int^{1}_{0}f(x) x^{2002}dx$
What I tried :
$$\int^{1}_{0}\bigg(f(x)-x^{2002}\bigg)^2dx=\int^{1}_{0}(f(x))^2dx+\int^{1}_{0}x^{4004}dx-2\int^{1}_{0}x^{2002}f(x)dx\geq 0$$
$$1+\frac{1}{4005}-2\int^{1}_{0}x^{2002}f(x)dx\geq 0$$
but answer is $\displaystyle \frac{1}{\sqrt{4005}}$ How do i solve it help me please
Hint: The Cauchy-Schwarz inequality says that $$ \left(\int_0^1 x^{2002}f(x)\,dx\right)^2 \leq \int_0^1 (x^{2002})^2dx \cdot \int_0^1 (f(x))^2dx $$