Hamilton's derivation of direct fitness from his 1970 paper
Actually the derivation is pretty straightforward. It's easier to use the fact that $Cov(X,Y) = E(XY) - E(X)E(Y)$ to derive this result. Suppose
$x_{j} = \sum_{i} s_{ij}$.
\begin{align*} 
  Cov (x_j, q_{j}) &amp;= E (x_{j}q_{j}) - E (x_{j}) E (q_{j}) \\
                    &amp;= \frac{1}{n}\sum x_{j} q_{j} - \frac{1}{n}\sum
                      x_{j} q \\
                    &amp;= \frac{1}{n} \sum x_{j} (q_{j} - q)
\end{align*}