A rectangle has four sides, two equal to the width and two equal to the length. So, the perimeter is

If we know that the width is 5, and the perimeter is 125, we have

In your case, the unkown is called x, but the concept is the same:

where x is the length of the rectangle.