I know that the expected value of a joint distribution is: $$E(XY) = \sum_{all\, x} \sum_{all\, y} xyP(x,y)$$
However, for $E(X^2 + Y^2)$, does the same hold true? ie.
$$E(X^2+Y^2) = \sum_x \sum_y (x^2 + y^2)P(x,y)$$
I feel like the P(x,y) should be something else, am I seeing it right?
Assuming the sum converges, it holds in general that $$E[ f(x,y)] = \sum_x \sum_y f(x,y) p(x,y)$$ Set $f(x,y) = x^2+y^2$ and your question is a special case.