Let the width of the rectangle be W, and the length be L; according to the given condition:
L = W - 9 eq. 1.
P = 2(L+W) eq. 2.
Put the eq(1) in (2); as follows:
42 = 2(W - 9 + W)
42/2 = 2W - 9
21 + 9 = 2W
30/2 = W
Width = 15 feet
Finally, Put the value of W in eq. 1:
L = 15 - 9
Length = 6 feet