A square rug has a side length of x. A rectangular rug has a length that is 4 yards longer than the square rug and a width that is 2 yards shorter than the square rug. If the areas of the two rugs are equal, what is the length of the rectangular rug?