Let $\Omega$ be a circle of radius $r$ and let $Z$ be the random variable that measures the distance from the center of the circle to a point. Let $X$ be the random variable that given $(x,y)$ associates the value of $x$. Calculate $cov(X,Z)$.
I'm having trouble thinking in a way to relate $X$ and $Z$ in order to find $E[XY]$. What limits should I consider when integrating? What I have done so far is define $p_{X,Y}(x,y)$ as: $$ p_{X,Y}(x,y) = \frac{1}{\pi r^2},\;\text{for } x^2+y^2 ≤ r^2 $$ and $$ p_{X,Y}(x,y) = 0\;\text{otherwise} $$
Because I need to find $E[X]$, $E[Z]$ and $E[XZ]$ I defined first $p_{Z}$ as: $$ p_{Z}(t) = \frac{2x}{r^2},\;\text{for } 0<t≤r $$ Which resulted in: $E[Z]=\frac{2}{3}r$.
Then with $p_{X,Y}$ I integrated with the limits where $x$ is inside the circle to find $p_{X}$ as follows: $$ p_X(x) = \int_{-\sqrt{r^2-x^2}}^{\sqrt{r^2-x^2}}p_{X,Y}dy = \int_{-\sqrt{r^2-x^2}}^{\sqrt{r^2-x^2}}\frac{1}{\pi r^2}dy = \frac{1}{\pi r^2}\int_{-\sqrt{r^2-x^2}}^{\sqrt{r^2-x^2}}dy = \frac{1}{\pi r^2}\left(\sqrt{r^2-x^2} + \sqrt{r^2-x^2}\right)= \frac{2}{\pi r^2}\sqrt{r^2-x^2} $$
This left me with: $$ E[X] = \int_{-r}^{r}xp_{X}(x)dx = \int_{-r}^{r}x\cdot\frac{2}{\pi r^2}\sqrt{r^2-x^2}dx = 0 $$
My main problem comes when finding $E[XZ]$. How should I define $p_{X,Z}$? I think I should be doing the double integral of $p_{X,Z}$, but how? I guess it is with establishing it as follows: $$ \int_{-r}^{r}\int_{\sqrt{r^2-x^2}}^{\sqrt{r^2-x^2}}xtp_{X,Z}dxdt $$ I don't know if that's the way to go, because I've seen the limits of $p_{Z}$ defined from $0$ to $r$ instead of $-r$ to $r$. Any help in defining $p_{X,Z}$, the limits of these integrals or in telling me what should I do is appreciated.
Here is a nicely written solution for your own reference.
Let $\Sigma$ be a disc of radius $R$ centered about the origin, and suppose $(X,Y)\sim \mathcal{U}(\Sigma)$. The density of $(X,Y)$, namely $f_{XY}$, has formula $f_{XY}(x,y)=\frac{1}{\pi R^2}$ for $(x,y)\in \Sigma$ and $f_{XY}(x,y)=0$ elsewhere. You're trying to compute $$\text{cov}(X,Z)=\mathbb{E}\Big(X\sqrt{X^2+Y^2}\Big)-\mathbb{E}(X)\mathbb{E}\Big(\sqrt{X^2+Y^2}\Big)$$ From the law of the unconscious statistician, $$\mathbb{E}\Big(X\sqrt{X^2+Y^2}\Big)=\int_{-R}^R \int _{-\sqrt{R^2-x^2}}^{\sqrt{R^2-x^2}}x\sqrt{x^2+y^2}f_{XY}(x,y)dydx=0$$ $$\mathbb{E}\big(X\big)=\int_{-R}^R \int _{-\sqrt{R^2-x^2}}^{\sqrt{R^2-x^2}}xf_{XY}(x,y)dydx=0$$ $$\mathbb{E}\Big(\sqrt{X^2+Y^2}\Big)=\int_{-R}^R \int _{-\sqrt{R^2-x^2}}^{\sqrt{R^2-x^2}}\sqrt{x^2+y^2}f_{XY}(x,y)dydx=\frac{2R}{3}$$ Putting this all together we get $$\text{cov}(X,Z)=0$$