# Function with null integral around every point

Yesterday I found myself wondering whether there exists non zero continuous functions $$f : [a,b] \mapsto \mathbb{R}$$ such that for every $$x \in ]a,b[$$, there exists $$\varepsilon>0$$ such that $$[x-\varepsilon,x+\varepsilon] \subset [a,b]$$ and $$\displaystyle{\int_{x-\varepsilon}^{x+\varepsilon}} f(t)dt = 0.$$

My guess is that the answer is yes - I was thinking to a counterexample with $$f$$ alternating sign quicker when approaching the boundaries, but could not find an explicit form. If I were considering $$f : \mathbb{R} \mapsto \mathbb{R}$$, of course such a function would exist: any $$2\varepsilon$$-periodic continuous function would do the job. A solution would have to make possible for $$\varepsilon$$ to be arbitrarily small when approaching the boundaries.

I would be grateful to anyone who could find a more or less explicit solution (or disprove the existence of such an $$f$$ if this were to be the case)

• I think you may need extra assumptions. If $f(a)$ or $f(b)$ are nonzero, the result seems to be false. For instance, if $f(a)>0$, $f$ will be positive in some interval $[a,a+\delta]$. If you take $x \in [a,a+\delta/2]$ the integral will be positive. – PierreCarre Mar 21 '19 at 9:34
• Of course, but no need to add such an assumption. I obly want to find such a function, the condition on the boundaries is only a necessary condition – charmd Mar 21 '19 at 10:33

What do you think of something like $$f : [0, \pi ] \rightarrow \mathbb{R}$$ defined by $$f(x)= \sin(x) \sin \left( \frac{1}{x}\right)\sin \left( \frac{1}{\pi-x}\right) \quad\quad \quad \quad \quad \quad \text{and } \quad \quad f(0)=f(\pi)=0.$$
• I don't think you need to compute explicitely the integral to show that it vanishes for an $\varepsilon$. You can probably show that it vanishes with an intermediate value argument (using periodicity of $\sin$, you can maybe prove that there is an $\varepsilon$ for which the integral is positive, and one for which it is negative). – TheSilverDoe Mar 21 '19 at 10:45
• Of course, but then how do you justify that the function $F(x+\varepsilon)-F(x-\varepsilon)$ takes bot negative and positive values? (F being the antiderivative) – charmd Mar 21 '19 at 11:25
• Your reasoning has to be made. The characteristics of $f$ that you implicitely use are: given any $x$, $f$ changes sign on some interval around $x$. Now I am going to change $f$ (without giving an explicit expression, just imagine that I change the decrease rate ($\sin(x)$ will go to $0$ faster), and the alternating rate ($\frac{1}{x}$ will rather be something like $3^{-x}$ around $0$). Imagine that $f$ is positive on $[\frac{1}{4},1]$, negative on $[\frac{1}{16},\frac{1}{4}]$, positive on $[\frac{1}{4^3},\frac{1}{16}]$, ... Now take $x = \frac{2}{4^n}$ with $n$ odd – charmd Mar 22 '19 at 7:10
• With my definition, $\varepsilon$ cannot be greater than $x = \frac{2}{4^n}$. So on $[x,x+\varepsilon]$, $f(x)$ is positive ! Now imagine too that the rate of decrease is some big exponential so that $\displaystyle{\int_0^{1/4^n}} |f(t)|dt \le \displaystyle{\int_{1/4^n}^{2/4^n}} f(t)dt$. Then no $\varepsilon$ can do because we'd have $\displaystyle{\int_{x-\varepsilon}^{x+\varepsilon}} f(t)dt>0$. For instance with $f(x) = e^{\frac{-100}{x(\pi-x)}} \cos\big(\pi \mbox{log}_2(x)\big) \cos\big(\pi \mbox{log}_2(\pi-x)\big)$, $f$ is NOT a solution. – charmd Mar 22 '19 at 7:18