A rectangular field will be fenced on all four sides. Fencing for the north and south sides costs $9 per foot and fencing for the other two sides costs $6 per foot. What is the maximum area that can be enclosed for $5400? feet sq. Solution Cost of fence=18x+24y, where is the NS length and y is the WE length. 18x+12y=5400 12y=5400-18x y=450-3x/2 area=xy=450x-3x.