I am trying to prove that if $X$ and $Y$ have the same distribution, then they have the same moment generating function: $M_X(t) = M_Y(t)$ for all $t \in \mathbb{R}$. I came up with a proof, but am not sure if it is correct:
Suppose $X$ and $Y$ have the same distribution $F$. Then, the moment generating function for $X$ and $Y$ is: $M_X(t) = E(e^{tX})$ and $M_Y(t) = E(e^{tY})$.
Now, for the general case:
$$ M_X(t) = \int_{-\infty}^{\infty}e^{tx}dF(x). $$ and $$ M_X(t) = \int_{-\infty}^{\infty}e^{ty}dF(y). $$
But, since these two integrals differ only by indices, $M_X(t) = M_Y(t)$ for all $t \in \mathbb{R}$.
I tried looking into a proof by contradiction but was not able to formulate one. The above seems a bit too simple, does anyone have any ideas as to if it is correct or alternate proofs? Thanks!
Suppose $M_X(t)$ and $M_Y(t)$ exist. Then assuming the pdfs exist
$$M_X(t) = E[e^{tX}] = \int_{\mathbb R} e^{tx} f_X(x)dx$$
$$M_Y(t) = E[e^{tY}] = \int_{\mathbb R} e^{ty} f_Y(y)dy$$
Let's rewrite the arguments:
$$M_X(t) = E[e^{tX}] = \int_{\mathbb R} e^{tz} f_X(z)dz$$
$$M_Y(t) = E[e^{tY}] = \int_{\mathbb R} e^{tz} f_Y(z)dz$$
We are given that (or can deduce from $F_X(z) = F_Y(z)$)
$$f_X(z) = f_Y(z)$$
Hence we can rewrite $M_Y(t)$
$$M_Y(t) = E[e^{tY}] = \int_{\mathbb R} e^{tz} f_X(z)dz$$
$$\therefore, M_Y(t) = M_X(t) \ QED$$
If the pdfs don't exist, we replace $f_{*}dx$ w/ $dF_{*}(x)$