I was calculating the moment generating function, then got stuck and looked at the solutions at the end of the book. They show that:
$M_X(t) = E_X(t^X)=\sum_{k=1}^{\infty} t^k(1-p)^{k-1} = \frac{p}{1-p}\sum_{k=1}^{\infty}[t(1-p)]^k$
Given that a geometric series is equal to: $\frac{1}{1-x}$
We finally get:
$\frac{p}{1-p}\frac{1}{1-(t(1-p))}-\frac{p}{1-p}$
I am uncertain as how $-\frac{p}{1-p}$ gets introduced at the end here, could someone please kindly explain?
What you missed is that the geometric series starting at $0$ sums to $1/(1-x)$ but your sum starts at $1$.
i.e. $\sum_{k=0}^\infty x^k=\frac{1}{1-x}$ but $\sum_{k=1}^{\infty} x^k=\frac{x}{1-x}$ or $\frac{1}{1-x}-1$.
Thus,
$\frac{p}{1-p}\sum_{k=1}^{\infty}(t(1-p))^k=\frac{p}{p-1}\left(\frac{1}{t(1-p)}-1\right)$