I need to calculate the sum $\sum_{A,B \subset X} |A \cup B|$ for $|X|=n$
Well I guess we can think of $X=\{1,...,n\}$.
Well, in my opinion this is basically this.
$\sum_{k=1}^n {{n}\choose{k}}*2^{k-1}$, because first we choose which elements appear in the sum $A \cup B$ and then we find $2^k$ subsets that fullfill this. We divide it by two because we counted each subset twice (one for $B$ and one for $A$).
And this sum can be easily deciphered using annihilators or generating functions.
Is my reasoning correct?