For a nonnegative integer-valued random variable, the probability generating function is
with always allowed. Its derivative at from below gives the expectation when finite.
The waiting time has the positive-integer geometric distribution . For the capped geometric waiting time, exactly when , while occurs whenever . Thus the terminal mass is , giving
The finite sum is a polynomial; any apparent singularity of the rational expression is removable. This includes , where .
Differentiating the rational form at yields
As a second interpretation, the expectation is the sum of the tail probabilities for . Their finite geometric sum gives the same answer.