# Second grade derivate in Galton Watson Process

I'm stuck in a proof inside a galton watsonn process. My goal is to extimate the variance of $$Z_n$$, where $$Z_n$$ is the population at time $$n$$.

I've already given the extimate of my generating function first and second derivate, but I'm stuck where the paper I'm using says:

Now if $$X$$ is a nonegative integer valued random variable with probability generating function $$g$$
35. $$EX=g'(1)$$
36. $$VarX=g''(1)+g'(1)-(g'(1))^2$$
whenever the quantities on either side of these equations are finite

Can anyone please explain me where those two equations comes our? Thanks in advance

If $$X$$ has PGF $$g(t)$$, then $$g(t)=\sum_{k=0}^\infty \mathbb P(X=k)\cdot t^k.$$ So for $$0, $$g'(t)=\sum_{k=1}^\infty k\cdot\mathbb P(X=k)\cdot t^{k-1}\implies\mathbb E[X]=g'(1^-)$$ and $$g''(t)=\sum_{k=2}^\infty k(k-1)\cdot\mathbb P(X=k)\cdot t^{k-2}\implies\mathbb E[X(X-1)]=g''(1^-).$$ So $$\operatorname{Var}(X)=\mathbb E[X(X-1)]+\mathbb E[X]-\mathbb E[X]^2=g''(1^-)+g'(1^-)-\left[g'(1^-)\right]^2$$.