Claire bought just enough fencing to enclose either a rectangular garden or a triangular garden, as shown. The two gardens have the same perimeter. How many feet of fencing did she buy?

To find the perimeter of the rectangle, you would add all sides or use P=2L+2w (Perimeter = 2 times the length plus 2 times the width)
P= 2(3x-3) + 2(x-3)
P=6x-6+2x-6
P=8x-12
To find the perimeter of the triangle, add all the sides.
P=(2x-1)+2x+(2x-1)
P=6x-2
Now we know that both of the perimeters are the same so we can set them equal to each other.
8x-12 = 6x-2 solve by subtracting 6x from both sides.
2x-12 = -2 then add 12 to both sides
2x=10 last divide by 2 on both sides
x=5
Now replace x with 5 on either the rectangle or the triangle. I will use the triangle.
P=(2x-1)+2x+(2x-1)
P=(2*5-1)+2*5+(2*5-1)
P=28 feet