The given quadrilateral (call it Q) is a trapezoid with "base" lengths of 6 and 12, and "height" 2, so its area is (6 + 12)/2*2 = 18. This means the joint density is
where Q is the set of points
(y = 12 - 3x is the equation of the line through the points (0, 12) and (2, 6))
Recall the definition of expectation:
(a) Using the definition above, we have
(b) Likewise,