1. ## Integral

Compute $\displaystyle \int_{-1}^1\frac{x^2}{1+e^x}\,dx$

I can't get it!

2. Facts you should know

$\displaystyle \frac1{1+e^x}+\frac1{1+e^{-x}}=1$

Set $\displaystyle u=-x$

3. Originally Posted by Krizalid
Facts you should know

$\displaystyle \frac1{1+e^x}+\frac1{1+e^{-x}}=1$

Set $\displaystyle u=-x$
Clever. No Physicist ever taught me that kind of trick when doing this integral. (It crops up in integrals over fermionic particles in solid state Physics.)

-Dan

4. Originally Posted by Krizalid
Facts you should know

$\displaystyle \frac1{1+e^x}+\frac1{1+e^{-x}}=1$

Set $\displaystyle u=-x$
...umm...i don't get it. how do we apply his exactly?

5. Originally Posted by liyi
Compute $\displaystyle \int_{-1}^1\frac{x^2}{1+e^x}\,dx$

I can't get it!
Originally Posted by Jhevon
...umm...i don't get it. how do we apply his exactly?
Look at the u = -x case:
$\displaystyle \int_1^{-1}\frac{(-u)^2}{1+e^{-u}}\,(-du)$

$\displaystyle = \int_{-1}^1 \frac{u^2}{1 + e^{-u}} \, du = \int_{-1}^1 \frac{x^2}{1 + e^{-x}} \, dx$

Now add the two integrals. (Hint: Do an integration by parts on the second integral and see what you get.)

-Dan

6. Originally Posted by Krizalid
Facts you should know

$\displaystyle \frac1{1+e^x}+\frac1{1+e^{-x}}=1$

Set $\displaystyle u=-x$
On second thought this trick isn't likely to work well in Physics. The reason this works here is because of the symmetric limits, and the Physics integrals go from 0 to $\displaystyle \infty$.

It's still a really cool way to do this integral, though.

-Dan

7. Originally Posted by topsquark
Look at the u = -x case:
$\displaystyle \int_1^{-1}\frac{(-u)^2}{1+e^{-u}}\,(-du)$

$\displaystyle = \int_{-1}^1 \frac{u^2}{1 + e^{-u}} \, du = \int_{-1}^1 \frac{x^2}{1 + e^{-x}} \, dx$

Now add the two integrals. (Hint: Do an integration by parts on the second integral and see what you get.)

-Dan
ok, i'm not getting anywhere with this:

$\displaystyle \int_{-1}^1 \frac{u^2}{1 + e^{-u}} \, du = \int_{-1}^1 \frac{x^2}{1 + e^{-x}} \, dx = -x^2 \ln \left( e^{-x} + 1 \right) + 2 \int x \ln \left( e^{-x} + 1 \right) ~dx$

i also did by parts on the last integral also, but it never seemed to be leading me anywhere. and even if i could get a nice result, i'm not exactly sure how you expect me to combine the two integrals when they have different variables.

8. Originally Posted by Jhevon
$\displaystyle \int_{-1}^1 \frac{u^2}{1 + e^{-u}} \, du = \int_{-1}^1 \frac{x^2}{1 + e^{-x}} \, dx$
This is the key, 'cause we have the same integration limits, so we can turn back the $\displaystyle u$ into $\displaystyle x$

Now

$\displaystyle \int_{-1}^1\frac{x^2}{1+e^x}\,dx+\int_{-1}^1\frac{x^2}{1+e^{-x}}\,dx=\frac13x^3\bigg|_{-1}^{\phantom{-}1}=\frac23$

Divide by two this last result and yields the desired.

9. Originally Posted by Jhevon
ok, i'm not getting anywhere with this:

$\displaystyle \int_{-1}^1 \frac{u^2}{1 + e^{-u}} \, du = \int_{-1}^1 \frac{x^2}{1 + e^{-x}} \, dx = -x^2 \ln \left( e^{-x} + 1 \right) + 2 \int x \ln \left( e^{-x} + 1 \right) ~dx$

i also did by parts on the last integral also, but it never seemed to be leading me anywhere. and even if i could get a nice result, i'm not exactly sure how you expect me to combine the two integrals when they have different variables.
Hmmm...

I plugged the integral in on my calculator and got that
$\displaystyle \int \frac{x^2}{1 + e^{-x}}dx = \frac{1}{3}x^3 - \int \frac{x^2}{1 + e^x} dx$

At a glance it looked like an integration by parts, but I guess it isn't. (Or, rather, it still may be but I can't figure how to do it.) I'll have to work on the integral a bit, but in any event you should be able to see where to go with it from here.

Edit: Ah wait! I see where Krizalid is going with this. The integrand isn't an even function, but the two are reflections of each other over the y-axis. Since the integration limits are symmetric the two integrals must be equal to each other.

-Dan

10. Originally Posted by Krizalid
This is the key, 'cause we have the same integration limits, so we can turn back the $\displaystyle u$ into $\displaystyle x$

Now

$\displaystyle \int_{-1}^1\frac{x^2}{1+e^x}\,dx+\int_{-1}^1\frac{x^2}{1+e^{-x}}\,dx=\frac13x^3\bigg|_{-1}^{\phantom{-}1}=\frac23$

Divide by two this last result and yields the desired.
Yes! that was the key! Got it! now i really appreciate the ingenious of your substitution, i wouldn't thought of that in a million years! how did you "see" that?!

11. It is just practice.

Since I like integrals too

12. Originally Posted by Krizalid
It is just practice.
no, it's because you are the man!!!!