Expected value of functions of Gaussian random variable I am trying to compute the following expectations:
(i) $E\left[\frac{1}{a^X}\right]$,
(ii) $E\left[\frac{X^2}{a^X}\right]$,
(iii) $E\left[\frac{X}{a^X}\right]$.
In above,  $a$ is a constant and $X$ is a Gaussian random variable with mean $\mu$ and variance $\sigma^2$.
My attempt on (i):
$$E\left[\frac{1}{a^X}\right]= E[e^{X (-ln(a))}]= e^{-\mu \ln(a) + \frac{\mu^2 \ln^2(a)}{\sigma^2} }$$
 by moment generating function of Gaussian distribution. 
 A: Writing $a=e^{-t}$ (that is, $t=-\log(a)$) puts all three expressions in the form
$$\lambda_k = E\left[ X^k e^{tX} \right]$$
for $k=0,2,1.$  The exponential generating function for this sequence is
$$\eqalign{
f(s;t)&=\lambda_0 + \lambda_1 s + \lambda_2\frac{s^2}{2!} + \cdots \\
&=\sum_{k=0}^\infty \frac{s^k}{k!}\lambda_k \tag{1}\\
&= \sum_{k=0}^\infty  E\left[ \frac{s^k}{k!} X^k e^{tX} \right] = E\left[e^{tX}\sum_{k=0}^\infty \frac{s^k}{k!} X^k  \right] = E\left[e^{tX} e^{sX}\right] \\
&=E\left[e^{(s+t)X}\right].
}$$
The final expression is the definition of the moment generating function of $X$, evaluated at the argument $s+t$, so we may immediately express it as
$$E\left[e^{(s+t)X}\right] = e^{(s+t)\mu + (s+t)^2\sigma^2/2}.$$
(The basic calculations are elaborated at https://stats.stackexchange.com/a/176814/919.)  Expanding this as a MacLaurin series in $s$ alone gives
$$f(s;t) = e^{t\mu + t^2\sigma^2/2}\left(1 + (\mu+t\sigma^2)s + (\sigma^2 + (\mu + t\sigma^2)^2)\frac{s^2}{2!} + \cdots \right).\tag{2}$$
You can read the answers $\lambda_0, \lambda_1, \lambda_2$ directly off $(2)$ by making a term-by-term comparison with the first line of $(1)$ and substituting $-\log (a)$ for $t$ everywhere.
