Maximum value of $\int^{1}_{0}x^{2002}f(x)dx$ under constraint $\int^{1}_{0}(f(x))^2dx=1$ 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
 A: 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
$$
A: Your method can be refined: for every $c>0$,
$$
\int^{1}_{0}\bigg(f(x)-c\cdot x^{2002}\bigg)^2\mathrm dx=\int^{1}_{0}(f(x))^2\mathrm 
 dx+c^2\int^{1}_{0}x^{4004}\mathrm dx-2c\int^{1}_{0}x^{2002}f(x)\mathrm dx\geq 0.
$$ Thus for every $c>0$, we have
$$
2\int^{1}_{0}x^{2002}f(x)dx\le c\int^{1}_{0}x^{4004}\mathrm d x+\frac1 c\int^{1}_{0}(f(x))^2\mathrm d x.
$$ The RHS is $\frac c {4005} +\frac 1 c$ and is minimized for $c=\sqrt{4005}$. This gives
$$
\int^{1}_{0}x^{2002}f(x)dx\le\frac1 {\sqrt{4005}}.
$$ (Also, the equality is obtained by $f(x) = cx^{2002}=\sqrt{4005}x^{2002}$.)
A: You can easily see that for $f(x)=\sqrt{4005}x^{2002}$ it is $\int_0^1f(x)^2dx=1$ and $$\int_0^1x^{2002}f(x)dx=\sqrt{4005}\int_0^1x^{4004}dx=1/\sqrt{4005}$$ Now by the Cauchy- Schwarz inequality, i.e. $$\int_0^1x^{2002}f(x)dx\leq\bigg{(}\int_0^1(x^{2002})^2dx\bigg{)}^{1/2}\cdot\bigg{(}\int_0^1f(x)^2dx\bigg{)}^{1/2}=1/\sqrt{4005}$$ therefore the maximum value is $1/\sqrt{4005}$. Moreover, this value is not only a supremum, it is a maximum, meaning that it is attained by some function $f(x)$ (specifically $f(x)=\sqrt{4005}x^{2002}$, as explained).
Actually, this is a mere application of the Holder inequality, which states that $\int|fg|\leq(\int|f|^p)^{1/p}\cdot(\int|g|^q)^{1/q}$ for $p,q$ satisfying $1/p+1/q=1$ and that equality is obtained whenever $|f|^p=\lambda|g|^q$, where $\lambda$ is a scalar. So you can actually tackle a great variety of problems with this method, try for example solving this: what is the maximum value of $\int_0^1x^{2002}f(x)dx$ when it is known that $\int_0^1f(x)^3dx=1$.
