I need help with this exercise:
let $f,g,h : [0,1] \to [0,\infty] $ integrable functions. Prove that the following statements are equivalent:
i) $(f(x))^2 \leq g(x)h(x) $ almost everywhere.
ii) For every measurable set $E \subset [0,1] $ we have:
$$\left(\displaystyle\int_E f(x)dx\right)^2 \leq \displaystyle\int_E g(x)dx\displaystyle\int_E h(x)dx.$$
I proved that $ i) \Rightarrow ii) $ with Holder inequality, but i have some problems with the other implication.
Consider the polynomial
$$P_E(t):=\left(\int_E h(x)dx\right)t^2+2\left(\int_E f(x)dx\right)t +\left(\int_E g(x)dx\right)$$
For each $E$, we have that the leading coefficient is non-negative with non-positive discriminant. Moreover, when $\int_E h(x)dx=0$ we have $\int_E f(x)dx=0$, so even in that case $P_E(t)=\int_Eg(x)dx\geq0$.
Then $$\int_E\left(t^2h(x)+2tf(x)+g(x)\right)dx\geq0$$ for all $E$. It follows that $$q_x(t):=t^2h(x)+2tf(x)+g(x)\geq0\ \ \ \ a.e.\ (\text{in }x)$$
Therefore, for each $x\in A$, the discriminant is non-positive, i.e. $$(f(x))^2\leq h(x)g(x)\;\text{ for }\;x\in A.$$