we know that
The perimeter of the rectangle is equal to
P=2(W+L)
where
L is the length
W is the width
In this problem we have
P=24 m
L=3x+1
W=x+1
substitute the given values in the formula
24=2(x+1+3x+1)
solve for x
24=2(4x+2)
24=8x+4
8x=24-4
8x=20
x=2.5 m