Answer:yes but only when using length=8m and width=5m.
Explanation
Table that shows some measurments for length and width to result in 40 m^2:
1*40 results in fencing of 2*(1+40) =82
2*20 results in fencing of 2*(2+20) =44
4*10 results in fencing of 2*(4+10) =28
5*8 results in fencing of 2*(5+8) =26