Showing that $\int\limits_{-a}^a \frac{f(x)}{1+e^{x}} \mathrm dx = \int\limits_0^a f(x) \mathrm dx$, when $f$ is even

I have a question:

Suppose $f$ is continuous and even on $[-a,a]$, $a>0$ then prove that $$\int\limits_{-a}^a \frac{f(x)}{1+e^{x}} \mathrm dx = \int\limits_0^a f(x) \mathrm dx$$

How can I do this? Don't know how to start.

• Start by finding a counterexample, say, the function that's always 17. Then find out what the question was really supposed to be. Aug 27 '11 at 6:36
• @Gerry: What do you mean. How will a counter-example help in proving this result? Aug 27 '11 at 6:44
• Seems I was mistaken. Aug 27 '11 at 6:53
• @James: I like this problem. Would you mind sharing its source? Aug 27 '11 at 6:59
• @Jonas: Asked in my high-school question paper. Problems of this type appear frequently in the $\textbf{JEE}$ exam :) Aug 27 '11 at 7:28

You have

\begin{align*} I &=\int\limits_{-a}^{a}\frac{f(x)}{1+e^{x}} \ dx \qquad\qquad \cdots (1)\\\ I &= \int\limits_{-a}^{a} \frac{f(x)}{1+e^{-x}} \ dx \qquad\qquad \Bigl[ \small\because \int\limits_{a}^{b}f(x)\ dx = \int\limits_{a}^{b}f(a+b-x)\ dx \ \Bigr] \quad \cdots (2) \\\ \Longrightarrow 2I &= \int\limits_{-a}^{a} \biggl[ \frac{f(x)}{1+e^{x}} + \frac{e^{x}\cdot f(x)}{1+e^{x}} \biggr] \ dx \quad\qquad \cdots (1) + (2)\\\ &=\int\limits_{-a}^{a} f(x) \ dx = 2 \int\limits_{0}^{a} f(x) \ dx \qquad \Bigl[ \small \text{since}\ f \ \text{is even so} \ \int\limits_{-a}^{a} f(x) = 2\int\limits_{0}^{a} f(x) \Bigr] \end{align*}

$$\textbf{Note.}$$ A similar problem, which uses result $$(2)$$ can be found here:

• Great solution. My only question is what led you to it? Most likely it was the observation that $(2)$ is true, but I'm curious about the thought process. Aug 27 '11 at 16:30
• @Jonas: Oh, Jonas, you have no reason to be sorry. You deleted it because i clarified the doubt's which you had in that comment, and i feel that you have every right to delete it. Anyhow thanks for reposting it again :)
– user9413
Aug 27 '11 at 16:51
• Chandrasekhar: Oops, you replied to the comment that I deleted shortly after posting. I realized I might have misunderstood your previous comment. Anyway, I will leave this one. My first comment had obsolete requests for clarification, and mentioned that this works because $\displaystyle{\frac{1}{1+e^x}+\frac{1}{1+e^{-x}}=1}$. Aug 27 '11 at 16:55
• Can someone kindly provide some insights why $\int\limits_{a}^{b}f(x) = \int\limits_{a}^{b}f(a+b-x)$?
– Covi
Aug 28 '11 at 14:57
• @Covi: Try replacing $x$ with $a+b-x$. Mind the limits, and note that swapping limits negates the integral. Aug 28 '11 at 20:03

This works because the even part of $\displaystyle{\frac{1}{1+e^x}}$ is $\frac{1}{2}$.

If $g:[-a,a]\to \mathbb R$ is a function, then $g$ has a unique representation as a sum of an even and an odd function, $g=h+k$, with $h(-x)=h(x)$ and $k(-x)=-k(x)$. If $f:[-a,a]\to\mathbb R$ is even, then $g(x)f(x)=h(x)f(x)+k(x)f(x)$ has even part $h(x)f(x)$ and odd part $k(x)f(x)$. Since the integral of an odd function on $[-a,a]$ is zero and the integral of an even function on $[-a,a]$ is twice the integral on $[0,a]$, this yields

$$\int_{-a}^a g(x)f(x)dx=\int_{-a}^ah(x)f(x)dx=2\int_0^a h(x)f(x)dx.$$

As has been seen in previous questions on this site (like this one) the formula for $h$ is $h(x)=\frac{1}{2}(g(x)+g(-x))$. In this problem, $\displaystyle{g(x)=\frac{1}{1+e^x}}$, and $h(x)=\frac{1}{2}$.

Another way of looking at this, where you are naturally led to the result: Since $f(x)$ is even, what you need to show is that $$\int_{-a}^a {f(x) \over 1 + e^x}\,dx = {1 \over 2}\int_{-a}^a f(x)\,dx$$ The difference between the left hand side and the right hand side is $$\int_{-a}^a f(x)\left({1 \over 1 + e^x} - {1 \over 2}\right)\,dx$$ $$= {1 \over 2}\int_{-a}^a f(x) \frac{1 - e^x}{1 + e^x}\,dx$$ Since this is to be zero for all even $f(x)$, you'd expect the function $\frac{1 - e^x}{1 + e^x}$ to be odd, so that the product $f(x) \frac{1 - e^x}{1 + e^x}$ would be odd and thus the integral becomes zero. And sure enough, one can verify readily that this function is in fact odd, so that the above integral is always zero.

This was supposed to be a comment to Zarrax's answer, but it got too long.

Another way to look at Zarrax's answer goes like this:

We have the expression

$$\frac{1 - e^x}{1 + e^x}=\frac{e^{-\frac{x}{2}} - e^{\frac{x}{2}}}{e^{-\frac{x}{2}} + e^{\frac{x}{2}}}=-\tanh\frac{x}{2}=-\frac{\sinh\frac{x}{2}}{\cosh\frac{x}{2}}$$

Since $\frac{f(x)}{\cosh\frac{x}{2}}$ is even and $\sinh\frac{x}{2}$ is odd, their product is odd. Since $\int_{-a}^a g(x)\mathrm dx=0$ if $g(x)$ is odd, the integral of $f(x)\tanh\frac{x}{2}$ over the interval $[-a,a]$ is zero if $f(x)$ is even.

I've been looking at this more closely and it's now pretty much demystified:

If $$f(x)$$ is even and $$u_k(x)$$ a sequence of uneven functions, the integrals $$\int_{-a}^a$$ over $$f(x)\,u_k(x)$$ are trivially zero and so you have

$$\int_{-a}^a \, f(x) \left( \frac{1}{2} + \sum_{k=0}^\infty u_k(x) \right) = \frac{1}{2}\int_{-a}^a f(x) \,{\mathrm d}x = \int_0^a f(x) \,{\mathrm d}x.$$

The functions $$\dfrac{1}{1+e^{v(x)}} = \frac{1}{2} - \frac{1}{4}v(x)+\frac{1}{48} v(x)^3+\dots$$ are cases of functions with such an uneven expansion, where $$u_k(x)$$ are uneven powers of some fixed function $$v(x)$$.

Even more specifically, your case is that sequence with $$v(x)\propto x$$.