One way to do this is to try the different option to replace x. Let's start with 8. Two sides of the rectangle would be 8.
8*2=16
Now you have to take 16 from 40 to see what's left.
40-16=24
2(20-8)=2(12)=24
That means 8 is an option to use, but you still need to see if any of the other options work to find the greatest area.
9*2=18.......40-18=22.......2(20-9)=2(11)=22
9 would also work.
10*2=20.......40-20=20.......2(20-10)=2(10)=20
10 would work
11*2=22.......40-22=18.......2(20-11)=2(9)=18
So all of them would work. Now you just need to find the largest area, which is length x width.
x(20-x)
8(20-8)=8(12)=96
9(20-9)=9(11)=99
10(20-10)=10(10)=100
11(20-11)=11(9)=99
So if x is 10, It would make the largest area.
(Sorry for all the extra work. I never trust that all the answers would work for the perimeter)