# If $f$ is integrable, then I can bring continuous functions from above or below

$\def\d{\mathrm{d}}$Let $f$ be integrable. I want to show there exist two functions $g$ and $h$ that are continuous under a closed interval $[a,b]$ s.t $h\leq f\leq g$ and at the same time$$\int_{a}^{b} (g(x)-h(x)) \,\d x <ε.$$

I know that because $f$ is integrable there exist two steps functions $h\leq f\leq g$ such that$$\int_{a}^{b}g(x) \,\d x - \int_{a}^{b} h(x) \,\d x <ε,$$ but I'm having trouble in the continuity part

My intuition: I'm thinking of "joining" the steps using straight lines in order to have a continuous function. but I have no idea how to formalize it.

• Ah, so you have struggled with the problem. I am happy you posted this question separately. – астон вілла олоф мэллбэрг Apr 23 '17 at 8:04
• @Crostul I'll edit the question to show you what I mean – user21312 Apr 23 '17 at 8:09
• If $f$ is not bounded on $(a, b)$ this cant be possible in general – ibnAbu Feb 10 '18 at 19:23

First, we need to find step functions $f_{\rm red} \leq f$ and $f_{\rm blue} \geq f$ such that $$\int (f_{\rm blue} - f_{\rm red} )<\frac \epsilon 3.$$ This is possible because $f$ is Riemann integrable.
Next, we want to find "joined-up-step-functions" $f_{\rm green} \leq f_{\rm red}$ and $f_{\rm orange} \geq f_{\rm blue}$ such that $$\int( f_{\rm red} - f_{\rm green}) < \frac \epsilon 3.$$ $$\int (f_{\rm orange} - f_{\rm blue}) < \frac \epsilon 3.$$ This is easy to achieve: we just need to make the width of each "triangle" small enough that the areas of the triangles add up to less than $\frac \epsilon 3$. To spell it out: if there are $N$ intervals in the partition, then we should choose the width of each triangle to be less than $2\epsilon /3hN$, where $h$ is the height of the triangle.
• Can this be strengthened so that $g,h$ are polynomials? – MathematicsStudent1122 Apr 23 '17 at 9:31
• If $p$ is a polynomial with $\|f-p\|_\infty<\epsilon/(2(b-a))$, then $p\pm \epsilon/(2(b-a))$ are two polynomials below and above $f$, and the difference between their integrals is $\epsilon$. – Fnacool Apr 23 '17 at 11:59
• @Fnacool Yes, that's a really nice argument! :) Although I believe it requires that $f$ is continuous in the first place, so that we can apply the Weierstrass approximation theorem. Nonetheless, we can apply your idea to my $f_{\rm green}$ and $f_{\rm orange}$, using another $\epsilon / 3$ argument - perhaps this is what you had in mind anyway! – Kenny Wong Apr 23 '17 at 13:06