Suppose I have 2 random variables:
$X\sim \textrm{Bin}(m,p_1)$ and $Y\sim \textrm{Bin}(n,p_2).$
I want to find the distribution of $S=X-Y$ using the probability generating function ($PGF$) treating $S$ as a function of random variables.
$$G_{S}(z) = G_X(z) G_Y(1/z)$$
Using the PGF for a single binomially distributed random variable:
$$G_{S}(z) = {[1-p_1+p_1 z]}^m \space {\left[1-p_2+\frac{p_2}{z}\right]}^n$$
Then to find the probability mass function PMF of the resulting distribution I use:
$$p(k) = \Pr(S=k) = \frac{G_{S}^{(k)} (0)}{k!}$$
where the numerator is the $k$-th derivative of the $PGF$.
My question is how is it possible to evaluate this expression when $G_{S}^{(k)}$ contains $1/z$ terms that would be undefined at $0$ (this problem doesn't exist for sum of random variables).
(I'm aware there are other ways to find this distribution, but I just wanted to understand how to find it using the PGF).