# Covariance value of joint density functions.

I'm trying to make sense of this problem.

Two random variables X and Y following joint density function: $$f(x_1,x_2) =\begin{cases} xy, & \text{if } 0 <= x <= 1, 0<= y<=2 \\ 0&\text{otherwise} \end{cases}$$

How to calculate the covariance of X and Y? Can I get some hints solving this problem?

• Can you find $\mathbb EXY$, $\mathbb EX$ and $\mathbb EY$? – drhab Jun 7 '16 at 11:05

If $g:\mathbb R^2\to\mathbb R$ is an integrable function then $$\mathbb Eg(X,Y)=\int\int g(x,y)f_{X,Y}(x,y)dxdy$$ where $f_{X,Y}$ denotes the PDF of the distribution of $(X,Y)$.

This can be used here to find $\mathbb EXY$, $\mathbb EX$ and $\mathbb EY$.

Finally you can use the equation: $$\text{Cov}(X,Y)=\mathbb EXY-\mathbb EX\mathbb EY$$

This of course is elementary theory that can be found in any introduction that concerns probability. So I cannot find a reason for you to ask this here. If it is not answering your question then what exactly is your question?

• Thanks for you kindness reply. I calculated E(X) = 2/3, E(Y) = 4/3, E(XY) = 8/9 , So Cov(X,Y)=E(XY)-E(X)E(Y) = 0. But I'm not sure this solution. I'm sorry I do not wrote detailed questions. – Sung Jin O Jun 7 '16 at 12:21
• Your calculations are okay. Shorter route: the PDF is can be written as a product $u(x)v(y)$. That implies independence (for a proof of that see this answer) and if the covariance exists then independence implies that the covariance equals $0$. – drhab Jun 7 '16 at 14:27

Hints:

• $Cov(X,Y)=\mathbb E(XY)-\mathbb E(X) \mathbb E(Y)$

• $\mathbb E(XY)=\int_0^2 \int_0^1 xy\cdot f_{X,Y}(x,y) \, dx \, dy$

• $\mathbb E(X)=\int_0^2 \int_0^1 x\cdot f_{X,Y}(x,y) \, dx \, dy$

• $\mathbb E(Y)=\int_0^2 \int_0^1 y\cdot f_{X,Y}(x,y) \, dx \, dy$