# $E[1/(1+e^X)] = 1/2$ for standard normal $X$

I have normally distributed $$X\sim\mathcal{N}(0, 1)$$, and I want to compute $$\begin{equation*} \mathbb{E}[1/(1+e^X)] = \int_{-\infty}^\infty \frac{e^{-x^2/2}/\sqrt{2\pi}}{1+e^x} dx \end{equation*}$$

I found numerically (and confirmed with Mathematica) that $$\mathbb{E}[1/(1+e^X)] = 1/2$$; this result continues to hold for arbitrary variances but breaks down once I select non-zero mean for $$X$$.

How can I prove this result? The integration trick to use is not jumping out to me.

• Substitute x as -t. The integration result must be same. Let the both be C, and calculate 2C by adding those two integrals. They should give the answer. Jul 17, 2020 at 4:43

$$$$\frac{2}{1+e^X} = 1 + \frac{1-e^X}{1+e^X} = 1 - \tanh(X/2)$$$$ Hyperbolic tangent is odd, hence the expected is $$0$$ if mean of $$X$$ is $$0$$.
$$N=\left( \int_{-\infty}^{\infty}\sqrt{2\pi}~ e^{-x^2/2} dx\right)^{-1}=(2\pi)^{-1}$$ So $$E[1/(1+e^x)]=N\sqrt{2\pi} \int_{-\infty}^{\infty} \frac{e^{-x^2/2}}{1+e^x}dx =I$$ Use $$\int_{-a}^{a} f(x) dx= \int_{0}^{a} [f(x)+f(-x)] dx,$$ to get $$I=N\sqrt{2\pi} \int_{0}^{\infty} e^{-x^2/2}~ dx=N\sqrt{2\pi} \sqrt{\frac{\pi}{2}}= \frac{1}{2}$$