The area of a rectangle is A=LW, the area of a square is A=S^2.
W=S-2 and L=2S-3
And we are told that the areas of each figure are the same.
S^2=LW, using L and W found above we have:
S^2=(2S-3)(S-2)  perform indicated multiplication on right side
S^2=2S^2-4S-3S+6  combine like terms on right side
S^2=2S^2-7S+6  subtract S^2 from both sides
S^2-7S+6=0  factor:
S^2-S-6S+6=0
S(S-1)-6(S-1)=0
(S-6)(S-1)=0, since W=S-2, and W>0, S>2 so:
S=6 is the only valid value for S.  Now we can find the dimensions of the rectangle...
W=S-2 and L=2S-3  given that S=6 in
W=4 in and L=9 in
So the width of the rectangle is 4 inches and the length of the rectangle is 9 inches.