2
$\begingroup$

I wish to integrate $$\int_{-a}^a \frac{dx}{1+e^x}.$$ By symmetry, the above is equal to $$\int_{-a}^a \frac{dx}{1+e^{-x}}$$ Now multiply by $e^x/e^x$ to get $$\int_{-a}^a \frac{e^x}{1+e^x} dx$$ which integrates to $$\log(1+e^x) |^a_{-a} = \log((1+e^a)/(1+e^{-a})),$$ which is not correct. According to Wolfram, we should get $$2a + \log((1+e^{-a})/(1+e^a)).$$ Where is the mistake?

EDIT: Mistake found: was using log on calculator, which is base 10.

  • 0
    My guess is that you missed something in getting from $1+e^x$ to $1+e^{-x}$ because you later have $\frac{1}{1+e^x} = \frac{e^x}{1+e^x}$...2011-10-02
  • 2
    As a sidenote, this problem is a special case of http://math.stackexchange.com/questions/60045/showing-int-limits-aa-fracfx1ex-mathrm-dx-int-limits-0a-fx (but the core question here is different).2011-10-02
  • 0
    @El'endia: No, he has $\frac1{1+e^{-x}}\left(\frac{e^x}{e^x}\right)=\frac{e^x}{1+e^x}$, after using symmetry to replace the original integrand by $\frac1{1+e^{-x}}$.2011-10-02
  • 0
    A direct route to the Wolfram solution is via the substitution $u=1+e^x$, $du=e^x dx=(u-1)dx$, followed by integration of $\frac1{u(u-1)}$ by partial fractions. Your solution is nicer, though.2011-10-02
  • 0
    @Brian: I meant that he started with $\frac{dx}{1+e^x}$ and after using symmetry and multiplying by 1, got $\frac{e^x}{1+e^x} dx$. That just doesn't seem right... o.O? Of course, I have to mention that I have no idea what this symmetry mentioned is and that I was wrong in the first place. :P2011-10-02
  • 0
    According to Wolfram, both evaluate to exactly 2.2011-10-02
  • 0
    @El'endia: $\frac{e^x}{1+e^x}=1-\frac1{1+e^x}=1-\frac1{(e^{-x}+1)e^x}=1-\frac{e^{-x}}{1+e^{-x}}=\frac1{1+e^{-x}}$, so it really is just a matter of reflecting in the $y$-axis.2011-10-02
  • 0
    @Brian: Ah, I see now.2011-10-02

5 Answers 5