#Cov_(f_(X,Y))(X,Y)=σ_(XY)=E[(X−μ_X)(Y−μ_Y)]#

#Cov_(f_(X,Y)) [X, Y ] = E_(f_(X,Y)) [XY ] − E_(f_(X)) [X] E_(f_(Y)) [Y ]#

So we want to calculate the the marginal pdfs, expectations and variances of X and Y for #f(x,y) = 6(1-y) " for " 0 ≤ x ≤ y ≤ 1#

====marginal pdf, mean and variance with respect to x=======

#f_(X)(x) = int f_(X,Y) (x,y) dy = int_x^1 6(1-y) dy = 6(y-1/2y^2)_x^1#

#f_(X)(x) = 3(x^2-2x+1)#

#E_(f_(X)) [X]= int xf_(X)(x)dx = 3int_(0)^1 (x^3-2x^2+x)dx#

#E_(f_(X)) [X]= 3(1/4x^4-2/3x^3+1/2x^2)_0^1=1/4#

#E_(f_(X)) [X^2] =intx^2f_(X)(x)dx = 3int_0^1x^2(x^2-2x+1)dx#

#E_(f_(X)) [X^2] = 3(x^5/5-2/4x^4+x^3/3)_0^1=1/10#

You really don't need the variance Var for this problem, but I am calculating it for you for future problems, so you see how it is done. Typically you would need the Var is the question had asked the Correlation...

#Var_(f_(X))= E_(f_(X)) [X^2] - {E_(f_(X)) [X]}^2=1/10-{1/4}^2=6/160#

====marginal pdf, mean and variance with respect to x=======

#f_(Y)(y) = int f_(X,Y) (x,y) dx = int_0^y 6(1-y) dx =6[(1-y)x]_0^y #

#f_(Y)(y) = 6(y-y^2)#

#E_(f_(Y)) [Y]=int yf_(y)(y)dx=6int_(0)^1(y^2-y^3)dx=[2y^3-3/2y^4]_0^1#

#E_(f_(Y)) [Y]=1/2#

#E_(f_(Y)) [Y^2]=inty^2f_(y)(y)dy=6int_0^1y^2(y-y^2)dy=6(y^4/4-y^5/5)_0^1#

#E_(f_(Y)) [Y^2] =6(1/4-1/5)=3/10#

#Var_(f_(Y)) = E_(f_(Y)) [Y^2]-{E_(f_(Y)) [Y]}^2 = 3/10-{1/2}^2 = 1/20#

=============Finally Covariance=============

to compute the covariance we also need to compute

#E_(f_(X,Y)) [XY] = int_(0)^(1) int_(0)^(y) xyf(x,y)dxdy#

#E_(f_(X,Y)) [XY] = 6int_(0)^(1) int_(0)^(y) {xdx}y(1-y)dy#

#E_(f_(X,Y)) [XY] = 6int_(0)^(1) [x^2/2]_0^yy(1-y)dy#

#E_(f_(X,Y)) [XY] = 3 int_0^1(y^3-y^4)dy=2(y^4/4-y^5/5)_0^1 =3/20 #

Now finally we compute the #Cov_(f_(X,Y)) [X, Y]#:

#Cov_(f_(X,Y)) [X, Y]=E_(f_(X,Y)) [XY ] − E_(f_(X))[X] E_(f_(Y))[Y]#

#Cov_(f_(X,Y)) [X, Y]=3/20− 1/4*1/2 = 1/40#