For the square I am assigning the sides lengths of S
Area=S2
For the rectangle
L=10+s
W=S-5
Area=(10+s)(S-5)
Since the areas are equal
S2=(10+s)(S-5)
Foil
S2=S2+5S-50
Subtract S2
0=5S-50
Add 50 to both Sides
50=5S
Divide by 5
10=S
Length of the rectangular garden is 10+S=10+10=20