The answer to this question:
north and south sides 16ft
east and west sides 8ft
In this question, the east and west fencing cost is $4/ft but the south and north fencing cost is $2/ft. The cost is cheaper for fencing north and south side which cost half of the east and west side. The perimeter is made by adding the south, north, east and west side.
If x = north and south fencing and y= is east and west side, then you can get this equation
cost= (south+north) * $2 + (east+west)*$4
128=(x+x) * 2 + (y+ y) * 4
128= 4x + 8y
32= x+ 2y
x= 32-2y
The area is count by multiplying the width and length, which was x and y in this question. The formula should be:
area= length * width
area= x * y
area= (32-2y) * y
area= 32y - 2y^2
Then, you need to find the value of y needed for the maximum area.
32y- 2y^2
32 - 2*2y=0
32= 4y
y= 8
If y=8 then
x= 32-2y
x= 32- 16= 16