Mean & Variance using Moment generating function If a random variable X has a Moment generating Function $Mx (t) = (1-2t)^{-1}$. What would $mu = E[X]$, $E[X^2]$ & $Var [X] = \sigma ^2$ be?
I'm very new to these concepts and any help will be appreciated!
 A: There are two possible approaches with this particular example. 
Approach 1: If $M_X(t)$ is the moment generating function of $X$, then $E(X)=M_X'(0)$, $E(X^2)=M_X''(0)$, $E(X^3)=M_X'''(0)$, and so on. 
Here $M_X(t)=(1-2t)^{-1}$, so $M_X'(t)=2(1-2t)^{-2}$, and $M_X''(t)=8(1-2t)^{-3}$.
It follows that $E(X)=2$ and $E(X^2)=8$. So $\text{Var}(X)=E(X^2)-(E(X))^2=4$.
Approach 2: We can write down the Maclaurin series expansion of  $M_X(t)$. In our case we get
$$M_X(t)=\frac{1}{1-2t}=1+2t+4t^2+8t^3+\cdots,$$
the familiar sum of an infinite geometric series. Rewrite as
$$M_X(t)=\frac{1}{1-2t}=1+\frac{2}{1!}t+\frac{8}{2!}t^2+\frac{24}{3!}t^3+\cdots.$$
The coefficients $2,8,24$ and so on are the first derivative, second derivative, third derivative, and so on of $M_X(t)$ at $t=0$. So we can conclude that $E(X)=2$, $E(X^2)=8$, $E(X^3)=24$ and so on. In particular, we have found $E(X)$ and $E(X^2)$, and can find $\text{Var}(X)$ like before.
Remark: We give a somewhat informal justification of the procedures that we used. Recall that $M_X(t)=E(e^{tX})$. If we expand $e^{tX}$ in a power series, we get
$$1+Xt+\frac{X^2}{2!}t^2+\frac{X^3}{3!}+\cdots.$$
Recall that the expectation of a sum is the sum of the expectations. If this also applies to infinite sums, we get
$$M_X(t)=1+E(X)t+\frac{E(X^2)}{2!}t^2+\frac{E(X^3)}{3!}t^3+\cdots.$$
This shows how the $E(X^k)$ are related to the coefficients of the power series expansion of $M_X(t)$, and that in general $E(X^k)=M_X^{(k)}(0)$.
