To find the volume of each garden, we need to multiply the area of the base by the depth of the soil.
For the rectangular garden, the area of the base is:
5 m x 4 m = 20 square meters
For the triangular garden, the area of the base is:
(1/2) x 10 m x 4 m = 20 square meters
Assuming the depth of the soil is the same in both gardens, we can compare the volumes of the two gardens based on their base areas. Since the base areas are the same for both gardens, they have the same volume.
Therefore, both gardens have the same volume when filled with the same depth of soil.