If the rancher has 240 m of fencing, then your area function is correct, and you could just find the arithmetic mean (average) of the two roots to find the critical value of:

Then take half of the other dimension of the combined area to get the other dimension of the two corrals. What do you find?