I'm doing a question on a Gamma/Poisson mix, which turns into a negative binomial. What I don't understand is the answer to the question - most of the answer makes sense to me (normal approximation and so forth), but the author seems to be using variance as:
$$V[Total] = (E[Count] * (E[X^2]-E[X]^2)) + E[X]^2*V[Count])$$
How did the author arrive at such a conclusion? I'm very confused.



If $T = \sum^C_{i=1} X_i$ where $C$ and $X_i$ are independent, by the law of total variance,
\begin{align} Var(T) &= E(Var(T|C)) + Var(E(T|C)) \\&= E(CVar(X_i)) + Var(CE[X])\\ &=E(C) Var(X) + E[X]^2 Var(C) \end{align}