title pretty much says it all:
$\sum_{i \in X} \sum_{j \in X} ij = (\sum_{i \in X}i)^2$
I'm trying to find out why two ways of writing the same formula are identical, and this is what it comes down to. I find this to be true for all cases I look at (and I assume it is, because the equality of the two original formulations is pretty well-established), but I have no idea why, nor how to proceed such a kind of question.