# Using the moment generating function to find the point distribution of a two-dice roll

Let's roll 2 dice. Let $X_i$ be a random variable that returns the result of the die $i$ $(i=1,2)$. Find the probability distribution function of the random variable $X = X_1 +X_2$ by using the moment generating function.

The moment generating function of $X_i$ is $M_{X_i}(t)=\frac{1}{6}\frac{e^t(e^{6t}-1)}{e^t-1}$, as derived in the answer to Finding moment generating functions for a dice roll. Since $X_1$ and $X_2$ are independent, the MGF of X is: $$M_X(t) = M_{X_i}(t)^2 = \frac{1}{36}\frac{e^{2t}(e^{6t}-1)^2}{(e^t-1)^2}$$

My question is: is it possible to find the PDF of $X$ using this moment generating function? How would you do this?

I have an alternate form for the MGF from which it is easier to find the PDF. It can be derived as follows: $$M_{X}(t) = \left(\frac{1}{6}\sum_{x = 1}^6 e^{tx}\right)^2 = \frac{1}{36}\sum_{i = 1}^6\sum_{j = 1}^6e^{t(i+j)} =\frac{1}{36}\left(\sum_{s = 2}^7(s-1)e^{ts} + \sum_{s = 8}^{12}(12-s+1)e^{ts} \right)$$ By the definition of MGF: $$M_X(t) = \sum_{s=2}^{12}Pr(X=s)e^{ts}$$ and so we can see that: $$Pr(X=s) = \left\{ \begin{array}{lr} \frac{s-1}{36} & s=2,3,...,7 \\ \frac{12-s+1}{36} & s=8,9,...,12 \\ \end{array} \right.$$

One possibility is that you could expand your $\displaystyle M_X(t) = \frac{1}{36}\frac{e^{2t}(e^{6t}-1)^2}{(e^t-1)^2}$ into $\displaystyle \frac{1}{36}\frac{e^{14t}-2e^{8t}+e^{2t}}{e^{2t}-2e^t+1}$ and then by long division into
$\frac1{36}e^{2t}+\frac2{36}e^{3t}+ \frac3{36}e^{4t}+ \frac4{36}e^{5t}+ \frac5{36}e^{6t}+ \frac6{36}e^{7t}+ \frac5{36}e^{8t}+ \frac4{36}e^{9t}+ \frac3{36}e^{10t}+ \frac2{36}e^{11t}+ \frac1{36}e^{12t}$