I was asked the following question
Consider the set $$S=\left\{f:[0,1]\to \mathbb R : f \text{ is continuous}, \int_0^1 f(x)\,\text{d}x=5, \int_0^1 xf(x) \, \text{d}x=3\right\}$$ Let $$I=\inf_{f\in S} \int_0^1 f(x)^2 \,\text{d}x$$ Find the value of $I$.
I can understand that we need an inequality (or an equality) involving the terms $\int_0^1 f(x) \, \text{d}x=5$, $\int_0^1 xf(x)\,\text{d}x=3$ and $\int_0^1 f(x)^2 \,\text{d}x$. But I don't have any idea of where to start or how to proceed. I guess, first we need to find a relation between $\left(\int_0^1 f(x) \, \text{d}x\right)^2$ and $\int_0^1 f(x)^2 \,\text{d}x$, but still, it's not clear to me how to proceed.
Any help would be appreciated.
Consider integral $$ \int_0^1 (ax+b)f(x)\,dx = 3a + 5b$$ Using Cauchy-Schwarz inequality on it, we get $$ (3a+5b)^2 \le \int_0^1(ax+b)^2\,dx \int_0^1f^2(x)\,dx = \left (\frac{a^2}{3} + ab + b^2 \right )\int_0^1f^2(x)\,dx $$ Rearranging (and letting $b \neq 0$) $$ \int_0^1 f^2(x)\,dx \ge \frac{27a^2 + 90ab + 75b^2}{a^2 + 3ab + 3b^2} = \frac{27(\frac{a}{b})^2 + 90(\frac{a}{b}) + 75}{(\frac{a}{b})^2 + 3(\frac{a}{b}) + 3} = \frac{27t^2 + 90t + 75}{t^2 + 3t + 3} $$ By taking derivative u can obtain that the maximum of the function on the right is at $t=3$ and yields the value of $28$.
Combining with @projectilemotion comment, function $f:[0,1] \to \mathbb R$ given by $f(x)=6x+2$ gives us $\int_0^1 f^2(x)\,dx = 28$, hence such infimum is $28$, too and is attained.