Solution:
From the definition of the Bernoulli distribution, X has probability mass function:
Pr(X=n)=⎩⎨⎧qp0:n=0:n=1:n∈/{0,1}
From the definition of a moment generating function:
MX(t)=E(etX)=∑n=01Pr(X=n)etn
So:
MX(t)=Pr(X=0)e0+Pr(X=1)et=q+pet
where q=1−p
Hence, proved.
Comments