1

I have the same question as asked here:

If $f:[a,b]\to \mathbb{R}$ is continuous and nonnegative and $\int_a^b{f}=0$, then $f(x)=0$ for all $x\in [a,b]$

Without the extra assumption that $f$ nonnegative. How can I adapt the any one of the arguments (or a new argument) to deal with a general function $f$? Would I have to show somehow that continuity implies there's an interval where the function has the same sign?

Edit:

I realized my question is slightly different, I have for every $c,d \in [a,b]$, $\int_{c}^{d} f(x) dx = 0$.

Eddie
  • 201
  • 1
    Without that your assertion is not true, think of $\sin x$ in $[0,2\pi]$. –  Dec 09 '14 at 09:23
  • This isn't true, of course: For example, $f: [-a, a]$, $f(x) := x$ is continuous and $\int_{-a}^a f = 0$ but $f \neq 0$. – Travis Willse Dec 09 '14 at 09:24
  • Yep...I just realized my question was different, no wonder I was having trouble. – Eddie Dec 09 '14 at 09:27
  • Hint: Fix a generic point $x\in[a,b]$ and try to show that $f(x)=0$ by considering intervals of the form $[x-\delta, x+\delta]$. What happens when $\delta>0$ gets very small? – Giuseppe Negro Dec 09 '14 at 09:29

2 Answers2

2

If $f$ is nonnegative (or nonpositive) the result doesn't hold. Just consider $f(x)=x$ on $[-1,1].$ Then $$\int_{-1}^1f(x)dx=0$$ and $f\not\equiv 0.$

If $f:[a,b]\to \mathbb{R}$ is continuous and $\int_c^df(x)dx=0,$ $\forall c,d\in [a,b]$ with $c<d$ then $f\equiv 0.$ In this case, given a point $x_0$ such that $f(x_0)\ne 0,$ because of continuity, there exists an interval $[c,d]$ containing $x_0$ where $f$ doesn't change sign. Applying the argument in the question you have mentioned it is obtained that $f(x)=0,\forall x\in [c,d].$ In particular we have $f(x_0)=0.$ This contradicts our assumption of $f(x_0)\ne 0.$ Thus it follows that $f\equiv 0$ on $[a,b].$

mfl
  • 29,399
2

You can't: $$\int_{-\pi}^\pi\sin x\,dx=0.$$