# expectation of ln(1+e^x) [closed]

x is a normal distributed variable. then what is the expectation of ln(1+e^x).

i simulated this distribution and find that when x is N(0, 100), the mean of this function is around 4.1, and when x is N(-10, 100), the mean is around 0.9.

can anyone tell me the exact expectation of this function, when x is normally distributed?

-

## closed as too localized by Henry Cohn, Andreas Blass, Carlo Beenakker, Andres Caicedo, Noah SteinMay 3 '13 at 13:35

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Of course it's easy to write down the answer as the integral of $\log(1+e^x)$ times the density of the distribution. This lets you compute to much greater precision than you can get by simulation, but offhand I don't see any reason to think the integral can be evaluated in closed form. I'd recommend asking about this at math.stackexchange.com instead. –  Henry Cohn May 3 '13 at 12:57

It is easy to obtain lower bounds on the expectation by noting that $$\ln(1+e^x) \geq \max\{0,x\}$$ which simplifies the expectation extremely and leads to the result for $X\sim \mathcal{N}(\mu,\sigma)$ $$E(\ln(1+\exp(X))) \geq E(\max\{0,X\}) = \frac{\sqrt{\sigma}}{\sqrt{2\pi}} e^{-\frac{\mu^2}{2\sigma}} + \mu \Phi_{\mu,\sigma}(0) ,$$ where $\Phi_{\mu,\sigma}$ is the distribution function of $X$.
The bounds obtained by this formula are $\mathcal{N}(0,100) : 3.99$ and $\mathcal{N}(-10,100): 0.833$.