Solution
= Solution
Since $X^2=X(X-1)+X$, the <probability generating function> identities give
$$
\mathbb E[X^2]=G''(1)+G'(1).
$$
Subtracting the squared <mean> yields the <variance>
$$
\boxed{\operatorname{var}(X)=G''(1)+G'(1)-\bigl(G'(1)\bigr)^2.}
$$