4

$\def\d{\mathrm{d}}$We know that if a function $f:\mathbb{R}\rightarrow\mathbb{R}$ is odd, then$$\int_{-a}^a f(x)\,\d x=0.$$ I'm wondering if the converse is true, and if not, if there are any counterexamples.

Thanks!

Edit: There was confusion about the quantifier for $a$, and I was also looking for continuity, even though I didn't say that in the question. So to clarify, I was wondering if the following statement was true or false:

Given a function $f \in C(I)$, if for some $a$ the integral$$\int_{-a}^af(x)\,\d x=0,$$ then $f$ must be odd.

Ѕᴀᴀᴅ
  • 35,369
ChrisWong
  • 639
  • 2
    Is your hypothesis that the integral is zero FOR ALL $a$? If so better amend the question. – ancient mathematician Apr 18 '17 at 15:52
  • @ancientmathematician, I was wrestling with that same thing but I think that's what OP does mean because the converse technically would be "If $\int_{-a}^a f(x) , dx = 0$ for all $a$ then..." –  Apr 18 '17 at 15:57
  • This question is more interesting with the stipulation that $f$ is continuous. – Reinstate Monica Apr 18 '17 at 16:18

4 Answers4

4

I assume that $f\in L^1(\mathbb R)$ with $\int_{-a}^af(x)dx=0$ for all $a>0$. In this case, the general answer is "no", and you can easily construct counterexamples by simply taking any odd function and changing it on a set of Lebesgue-measure zero to make it not odd. One such example has been given in JJR's answer for any fixed $a>0$.

However, if $f$ is known to have a classical primitive (i.e. a function $F$ that is differentiable everywhere with $F'=f$), then the answer is "yes" (note that every continuous function has such a primitive). In this case, assuming w.l.o.g. that $F(0)=0$, we have \begin{align*} F(a)=\int_0^a f(x)dx \end{align*} and hence \begin{align*} 0=\int_{-a}^a f(x)dx=\int_{-a}^0f(x)dx+\int_0^af(x)dx=-F(-a)+F(a), \end{align*} which shows $F(-a)=F(a)$ for all $a\in\mathbb R$. Thus $F$ is even and hence $f$ is odd. (See also here for more details on that last conclusion).

sranthrop
  • 8,696
3

$f(x) = \left\{ \begin{array}{ll} 1 & \text{ if }x\in[-a,a]\cap\mathbb{Q}\\ 0 & \text{ else} \end{array}\right.$

JJR
  • 1,279
  • @Doug M: No, it isn't. – Bernard Apr 18 '17 at 15:53
  • Is this even integrable? – DHMO Apr 18 '17 at 15:56
  • Yes it is integrable with integral 0 – JJR Apr 18 '17 at 15:57
  • Not in Riemann-sense, but in Lebesgue sense it is integrable. – sranthrop Apr 18 '17 at 15:57
  • You can make it Riemann integrable just by making $f$ nonzero at only two points, say $\pm 1$. It can take any values at those points as long as they are not negatives of each other and you will have a function that is not odd that integrates to zero over any interval, not just those symmetric around zero. – Ross Millikan Apr 18 '17 at 15:59
  • @Ross, how will making $f$ nonzero at only two points make $f$ Riemann-integrable? –  Apr 18 '17 at 16:08
  • @RossMillikan Or make $f$ nonzero at one point. – Reinstate Monica Apr 18 '17 at 16:18
  • @tilper: A function is Riemann integrable iff it is bounded and continuous almost everywhere. This is clearly the case if $f$ is zero everywhere except at two points. – sranthrop Apr 18 '17 at 16:28
  • @tilper: as long as there is a finite number of discontinuities it is Riemann-integrable as you can make the width of the intervals containing the discontinuities as small as you want. – Ross Millikan Apr 18 '17 at 16:29
  • ohhhh I get it now. At first I thought you meant take the $f$ that JJR gave and make it nonzero at two additional points. The world makes sense again. @RossMillikan –  Apr 18 '17 at 16:50
  • and CC @sranthrop –  Apr 18 '17 at 16:50
2

Counter-example (sketch):

Consider the function, defined on $[-1,1]$ as $$f(x)=\begin{cases}x&\text{if }\;0\le x<\frac12,\\ x-1&\text{if }\;\frac12< x\le 1,\\ 0& \text{if }\;-1\le x<0. \end{cases}$$

For a continuous function on $[-1,1]$, consider the function defined by $$f(x)=\begin{cases}\sin (2\pi x)&\text{if }\;0\le x\le 1,\\ 0& \text{if }\;-1\le x<0. \end{cases}$$

Bernard
  • 179,256
  • 1
    This does not work, the integral over the interval $-\frac{1}{4}, \frac{1}{4}$ is not zero... (assuming the OP considers the statement to be for all $a \in \mathbb{R}_{>0}$). – Student Apr 18 '17 at 15:55
  • I didn't suppose it were true for all $a$, of course (and the O.P. does not specify it). – Bernard Apr 18 '17 at 15:59
  • 1
    I would think the OP asks if the statement "$f$ is odd then for all $a$ $\int_{-a}^{a}f = 0$" is actually an equivalence... – Student Apr 18 '17 at 16:00
  • 1
    I can't understand why people continues to write that the statement is "for all $;a;$ ". The title is very precise: "...along an interval symmetric to..." ! This counter example works just fine. +1 – DonAntonio Apr 18 '17 at 16:44
  • @DonAntonio, the title is precise but, as is common on this site (although usually not this subtle), the question is different. OP mentions the "well known" fact that "If a function $f$ is odd then $\int_{-a}^a f(x) , dx = 0$." Those who know this know that it's true for all $a$. So the converse, that OP specifically asks about in the question (thus subtly contradicting the title), is "If $\int_{-a}^a f(x) , dx = 0$ for all $a$, then $f$ is odd" –  Apr 18 '17 at 16:54
  • And the "an" in the title could be a typo and the word "any" was meant to be there. This is really just a classic case of answering the title vs. answering the post. –  Apr 18 '17 at 17:04
  • @Bernard Thank you for the counterexample, I can definitely see how this works. Unfortunately I didn't mention that I was looking for a continuous function (I've editted the question) but I think I can find a counterexample based on your piecewise function. – ChrisWong Apr 18 '17 at 17:12
  • @ChrisWong: I've added a very simple example with a continuous function. – Bernard Apr 18 '17 at 17:53
1

The statement is not true, simple counterexample is $f(x) = \cos x$ on $[-\pi,\pi]$ since $\int_{-\pi}^\pi \cos x \,dx=0$.

Sil
  • 17,976
  • 1
    The hypothesis of the converse would be $\int_{-a}^a f(x) , dx = 0$ for all $a$. –  Apr 18 '17 at 16:17
  • I think that's the only interpretation because the well known statement is "If $f$ is odd then $\int_{-a}^a f(x) , dx = 0$ for all values of $a$" and not "If $f$ is odd then $\int_{-a}^a f(x) , dx = 0$ for some fixed value of $a$." Downvote isn't mine.. –  Apr 18 '17 at 16:22
  • @tilper Its okay I don't care about downvote. You could say that the well known statement is that given $a>0$ we have if $f(x)$ is odd on $[-a,a]$, then integral is $0$, then opposite would be if integral is $0$ then $f(x)$ is odd ... I think it is really up to OP to decide what he meant. I will hide the answer until then... – Sil Apr 18 '17 at 16:26
  • Restored the answer as OP clarified the meaning is for some $a$, not for all $a$. – Sil Apr 18 '17 at 17:09