The first thing you should know for this case is that the perimeter of a rectangle is defined as:
P = 2L + 2W
Where
L = length
W = Wide
We then have to clear the length:
L = (P-2W) / 2
Substituting the values
L = ((6x-6) -2x) / 2
Rewriting:
L = ((3x-3) -x)
L = 2x-3
Answer:
the length is
2x-3