Let the length and width of the rectangular enclosure be x and 32-x yards, as shown in the figure above. If the area of the enclosure is represented by A, then  A= x (32-x).

 

For maximum area, derivative dA/dx should be equal to zero. Thus,

 dA/dx= 32-2x=0.  Solving for x, we will have x=16.

 

This means that the enclosure should be a square of side 16 yards.

                                                       ****