Let $u \sim \mathcal{N}(0,\sigma^2)$. Then, I want to compute the expectation of $e^u$. Basically $u$ is the disturbance term of log-linear regression model, when I exponentiate the regression equation.
I proceed as follows: \begin{equation} E(e^u) = \int_{- \infty}^{\infty} u (2 \pi)^{- 1/2} \sigma^{-1/2} e^{- \frac{u^2}{2 \sigma^2}} du \end{equation}
How should I proceed next?
The textbook says that the expected value is $e^{\sigma^2 /2}$
We want to compute $$\int_{u=-\infty}^{\infty} e^u\ \frac{\exp({-u^2/2\sigma^2)}}{\sigma \sqrt{2 \pi }}\, du.$$
Notice that $$ \begin{aligned} \frac{\sigma^2}2 - \frac{ (u - \sigma^2)^2}{2 \sigma^2} =&\ \frac{\sigma^2}2 - \frac{u^2 - 2 u \sigma^2 + \sigma^4}{2 \sigma^2} \\ =&\ \frac{\sigma^2}2 - \frac{u^2}{2\sigma^2} + u - \frac{\sigma^2}2 \\ =&\ u -u^2/2\sigma^2. \end{aligned}$$
So,
$$\begin{aligned} \int_{u=-\infty}^{\infty} e^u \ \frac{\exp({-u^2/2\sigma^2)}}{\sigma \sqrt{2 \pi }}\, du &= \int_{u=-\infty}^{\infty} \frac{\exp({u-u^2/2\sigma^2)}}{\sigma \sqrt{2 \pi }}\, du \\ &= \int_{u=-\infty}^{\infty} \frac{\exp\left( \frac{\sigma^2}2 - \frac{ (u - \sigma^2)^2}{2 \sigma^2}\right) }{\sigma \sqrt{2 \pi }}\, du \\ &= \exp(\sigma^2/2) \int_{u=-\infty}^{\infty} \frac{\exp\left( - \frac{ (u - \sigma^2)^2}{2 \sigma^2}\right) }{\sigma \sqrt{2 \pi }}\, du \\ &= \exp(\sigma^2/2) \end{aligned}$$ where the last equality holds because the integral of the pdf of a Gaussian random varible is 1.