Let the length be represented by l and the width, w.
The question says that the length is 3 feet longer than the width. This means that

The perimeter of a rectangle is given as

The perimeter of the sandbox is given as 22 feet.
Substituting the values for the perimeter and the length (w + 3) into the perimeter formula, we have

Solving, we have

Now that we have the value for the width, we can calculate the length as

The length is 7 feet and the width is 4 feet.