# Evaluate $\int_{0}^{\infty} \frac{x}{1+e^x}dx$ [duplicate]

This question already has an answer here:

$$\int_{0}^{\infty} \frac{x}{1+e^x}dx=\int_{0}^{\infty} \frac{x(e^x+1-e^x)}{1+e^x}dx=\int_{0}^{\infty} x\cdot dx - \int_{0}^{\infty} \frac{x\cdot e^x}{1+e^x}$$

I can't think of a way to proceed further

## marked as duplicate by imranfat, Community♦Jun 12 '18 at 14:10

• You have already dealt with similar integrals: math.stackexchange.com/questions/2814357/… . Just set $x=-\log u$ to find $\pi^2/12$. – Jack D'Aurizio Jun 12 '18 at 13:18
• Be careful when manipulating improper integrals. The first one exists while the last one leads to an indeterminate form. – nicomezi Jun 12 '18 at 13:19
• Divide the numerator and denominator by $e^x$ and substitute $u=e^{-x}$. The result can be expanded using the geometric series and integrated termwise. – Frank W. Jun 12 '18 at 13:19
• math.stackexchange.com/questions/700659/… – Ron Gordon Jun 12 '18 at 13:32
• @JackD'Aurizio thank you so much – So Lo Jun 12 '18 at 13:38

$${x\over1+e^x}={xe^{-x}\over1+e^{-x}}=xe^{-x}(1-e^{-x}+e^{-2x}-e^{-3x}+\cdots)=xe^{-x}-xe^{-2x}+xe^{-3x}-xe^{-4x}+\cdots$$
$$\int_0^\infty xe^{-nx}\,dx={1\over n^2}$$
\begin{align} \int_0^\infty{x\over1+e^x}\,dx &=1-{1\over4}+{1\over9}-{1\over16}+\cdots\\ &=\left(1+{1\over4}+{1\over9}+{1\over16}+\cdots\right)-2\left({1\over4}+{1\over16}+\cdots \right)\\ &=\left(1+{1\over4}+{1\over9}+{1\over16}+\cdots\right)-{1\over2}\left(1+{1\over4}+\cdots\right)\\ &={1\over2}\left(1+{1\over4}+{1\over9}+{1\over16}+\cdots\right)\\ &={\pi^2\over12} \end{align}