The expected value of \(X\) — its mean — is the mean of its marginal distribution.
\[ \begin{align} E[X] \;=\; \mu_X \;=\; \sum_{\text{all }x} {\sum_{\text{all }y}{x \times p(x,y)}} \;&=\; \sum_{\text{all }x} {x \times \sum_{\text{all }y}{p(x,y)}} \\ &=\; \sum_{\text{all }x} {x \times p_X(x)} \end{align} \]Integration replaces summation in this proof for continuous random variables. In a similar way, the variance of \(X\) is the variance of its marginal distribution,
\[ \Var(X) \;=\; E\left[(X-\mu_X)^2\right] \;=\; \sum_{\text{all }x} {(x-\mu_x)^2 \times p_X(x)} \]The same results hold for the mean and variance of \(Y\).