The fraction of the rectangle that is shaded is equal to the ratio of the area of triangle and the are of rectangle. First, we need to determine the value of x to be able to calculate the respective areas. We do as follows:
From the triangle,
tan 45 = 2 / (x/2)
1 = 4 / x
x = 4
L = 4 + 2 = 6
W = 4
A(triangle) = hb / 2 = 2(4) / 2 = 4
A(rectangle) = LW = 6(4) = 24
Fraction shaded = 4 / 24 = 1/6