Let's assume
length of rectangle =L
width of rectangle =W
You enclose 3 sides of the garden with 40 feet of fencing
so, we get

now, we can solve for L

we know that
area of rectangle is


now, we can plug

now, we can solve for W

we can use quadratic formula


we can take anyone value ..because both are giving positive value
first dimensions:

now, we can find L


so, length is 34.142feet
width is 2.929 feet
Second dimensions:

now, we can find L


so, length is 5.858feet
width is 17.071 feet