All four sides of the original square have length s.
Adding 3 to s results in s+3, the length of the resulting rectangle.
Subtracting 3 from s results in s-3, the width of the rectangle.
The area of the rectangle is (s+3)(s-3) = s^2 - 9 = 27,
and therefore s^2 = 36, and s = 6 square units.