# Given $E[e^{tX}]=e^{t^2}$, find $E[X^2]$

I tried approaching it from the variance perspective, ie $$\operatorname{var}(X)=e^{t^2}(1-e^{t^2})$$ and then I thought that maybe I should take the integral from $$-\infty$$ to $$+\infty$$ of the pdf, but that's not really the right approach either.

I think I'm missing some kind of algebraic manipulation here, if someone wouldn't mind pointing me in the right direction...thanks!

• Hint: what is the second derivative of $E[e^{tX}]$ with respect to $t$?
– J.G.
Sep 19, 2022 at 15:39

Among others, there are two ways to solve this. First, note that for any random variable X whose moment generating function (MGF) exists, $$E(X^2) = \frac{d^2}{dt^2} E(e^{tX})|_{t = 0}$$. In words, the second moment is the second derivative of the MGF evaluated at 0. Hence, using this approach, and since you know the form of the MGF, we have
$$E(X^2) = \frac{d^2}{dt^2} E(e^{tX})|_{t = 0} = \frac{d^2}{dt^2}e^{t^2} = \left(2e^{t^2} + 4t^2 e^{t^2}\right)|_{t = 0} = 2.$$ Another way is if you know the MGF of the normal distribution. Indeed for a normal distribution with mean $$\mu$$ and variance $$\sigma^2$$, the MGF is $$E(e^{tX}) = e^{\mu t + \sigma^2 t^2 /2}$$. So you could view your $$E(e^{tX})$$ as the MGF of a normal distribution with mean $$0$$ and variance $$2$$. Thus, $$E(X^2) = Var(X) = 2$$. Hope this helps!