Can anyone verify whether what I am calculating for Expectation of $\exp(x^2)$ when $x\sim \mathcal{N}(\mu, \sigma^2)$ is mathematically correct or not?
We have to find out $\mathbb{E}(\exp({x^2}))$ i.e. $\int_{-\infty}^\infty \exp(x^2) f(x) dx$ where $f(x) = \mathcal{N}(\mu, \sigma^2)$.
Completing the square inside exponential we get $\displaystyle \exp[\frac{1- 2\sigma^2 }{2\sigma^2} (x - \frac{\mu}{1 - 2\sigma^2 })^2 + \frac{\mu^2}{1- 2\sigma^2}]$.
After this $\int_{-\infty}^\infty \exp(x^2) f(x) dx = \displaystyle \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi\sigma^2}} \exp[- \frac{1 - 2\sigma^2}{2\sigma^2} (x - \frac{\mu}{1 - 2\sigma^2})^2 + \frac{\mu^2}{1 - 2\sigma^2}] dx $
$= \displaystyle \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi\sigma^2}} \exp[- \frac{1 - 2\sigma^2}{2\sigma^2} (x - \frac{\mu}{1 - 2\sigma^2})^2] \exp[\frac{\mu^2}{1 - 2\sigma^2}] dx $
$= \displaystyle \int_{-\infty}^\infty \frac{1}{(1 - 2\sigma^2)^{1/2}\sqrt{2\pi\frac{\sigma^2}{1 - 2\sigma^2}}} \exp[- \frac{1 - 2\sigma^2}{2\sigma^2} (x - \frac{\mu}{1 - 2\sigma^2})^2] \exp[\frac{\mu^2}{1 - 2\sigma^2}] dx$
$= \displaystyle \frac{\exp[\frac{\mu^2}{1 - 2\sigma^2}]}{(1 - 2\sigma^2)^{1/2}} \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi\frac{\sigma^2}{1 - 2\sigma^2}}} \exp[- \frac{1 - 2\sigma^2}{2\sigma^2} (x - \frac{\mu}{1 - 2\sigma^2})^2] dx$
The integral must be $1$ and the final result is $\displaystyle\frac{\exp[\frac{\mu^2}{1 - 2\sigma^2}]}{(1 - 2\sigma^2)^{1/2}} $.
Please verify the above derivation and reply asap...
Thanks in advance.
The expectation is finite if $\sigma^2<\frac{1}{2}$ and in such a case it equals $\displaystyle\frac{1}{\sqrt{1-2\sigma^2}}\,\exp\left(\frac{\mu^2}{1-2\sigma^2}\right)$, correct.