# if $f$ is continuous, $f(x)\ge 0$ and $\int_a^bf(x)\ dx = 0$, then $f(x) = 0$ [duplicate]

I need toprove that:

If $f$ is continuous, $f(x)\ge 0$ for all $x\in [a,b]$, and

$$\int_a^bf(x)\ dx = 0$$

then $f(x) = 0, x\in [a,b]$

using this definition of integrals, that is:

$$\underline{\int_{a}^b}f(x) dx = \sup s(f, P) = \sup \sum_{i=1, t_i \in P} m_i(t_{i}-t_{i-1})$$

where $m_i = \inf\{f(x), x\in [t_i, t_{i-1}]\}$

and

$$\overline{\int_{a}^b}f(x) dx = \inf S(f, P) = \inf \sum_{i=1, t_i \in P} M_i(t_{i}-t_{i-1})$$

where $M_i = \inf\{f(x), x\in [t_i, t_{i-1}]\}$.

And, $\int_a^b f(x) \ dx$ exists when the sup and inf integrals are equal, and its value is the value they take.

My reasoning is the following:

$$\int_a^b f(x) \ dx = 0 \implies \underline{\int_a^b} f(x) \ dx = 0 \implies$$

$$\sup \sum m_i(t_i-t_{i-1}) = 0$$

that is, the greatest value of the sum above is $0$, but since $f(x) \ge 0$, we must have that the sum above is $0$. This means that $m_i = 0$ in every interval $[t_i, t_{i-1}]$. For the $\overline{\int_a^b}$, we could think the same and arrive that $\inf \sum M_i (t_i-t_{i-1}) = 0 \implies M_i\ge 0$. But I don't know how to conclude that $f(x) = 0$, neither I know how to use the hypottesis that $f$ is continuous.

Also, I'm asked to show an example where the discontinuity of $f$ will lead to a negation of what I need to prove.

## marked as duplicate by user99914, Jack D'Aurizio calculus StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 20 '16 at 1:08

Suppose $f\ne 0$.Then, there is an $x_0\in [a,b]$ such that $f(x_0)=c>0$. As $f$ is continuous there is an interval $(a',b')\subseteq [a,b]$ that contains $x_0$ and is such that $f((a',b'))\subseteq (c/2,3c/2)$.

Let $P=\left \{ a,a',b',b \right \}$.Then $L(P,f)\ge \frac{c}{2}(b'-a')$ so that

$\underline{\int_{a}^b}f(x) dx\ge \frac{c}{2}(b'-a')$. But $f$ is continuous so the integral exists and so we have now

$\int_{a}^{b}f(x) dx\ge \underline{\int_{a}^b}f(x) dx\ge \frac{c}{2}(b'-a')>0$

Suppose, there is a $x_0 \in [a,b], f(x_0)>0$. Using the $\epsilon,\delta$-criteria we get that for $\epsilon = \frac{f(x_0)}{2}$ there is a $\delta >0$ so that

$f(x) > \frac{f(x_0)}{2} > 0$ for all $x \in ]x_0-\delta, x_0+\delta[$

Use this and your definition of the integral to get $\int_{a}^b f(x)dx > 0$.

Without continuity, you have this counterexample:

$f: [a,b] \to \mathbb{R}^{+}, x \mapsto \begin{cases}1 & x = (b-a)/2 \\ 0 & otherwise\end{cases}$

So $f \neq 0$ but $\int_a^b f(x) dx = 0$

Over any partition.

$\sum \inf (f(t_i)) (x_{i+1} - x_i) \le \int_a^bf(x) dx \le \sum \sup (f(t_i)) (x_{i+1} - x_i)$

since $f(x) \ge 0$ for all $x$ in $[a,b]$

$\sum \inf (f(t_i)) (x_{i+1} - x_i) \ge 0$

and $\int_a^bf(x) dx = 0$

$\sum \inf (f(t_i)) (x_{i+1} - x_i) = 0$ by the squeeze theorem.

If $f(x) > 0$ for some $x$ and $f(x)$ is continuous then there will exist a sub inteval such that

$\inf (f(t_i)) > 0$ over that sub-interval and $\sum \inf (f(t_i)) (x_{i+1} - x_i) > 0$

If $f(x)$ is not continuous... $i.e.$

$f(x) = \begin{cases} 1 &x=0\\0 &x \ne 0\end{cases}$

then $\int_{-1}^{1}f(x) dx = 0$ yet $f(x)$ is not a constant function.

• could you explain better the part that $f$ continuous, then there exists a subinterval in which $\inf \cdots$? – Guerlando OCs Aug 20 '16 at 1:21
• There's another question that asks me to prove that if $\int |f(x)|dx = 0$ and if $f$ is continuous in a point $c$, then $f(c) = 0$. Can I just say that $\int f(x) \le \int |f(x)|$ and use the same reasoning as yours? – Guerlando OCs Aug 20 '16 at 2:31
• If $f(x)$ is continuous and $f(c)>0,$ then we can construct an open ball around $c (i.e. |x-c|<\delta)$, and f(x) > 0 for all $x$ in that interval. Regarding the second question... Yes, I think you can use the same logic $g(x) = |f(x)|$ is a function of that meets all of the criteria examined in this proof. – Doug M Aug 22 '16 at 16:06
• couldn't I just say that $\sum \sup (f(t_i)) (x_{i+1} - x_i)=0$ then $sup(f(t_i))\le 0$ wich implies $f(t_i)=0$, since $f(x)\ge 0$? – Guerlando OCs Oct 2 '16 at 18:38