
Mike D. answered 04/08/21
Effective, patient, empathic, math and science tutor
Suppose the sides are x, y
If the sides with the fence are x,x,y length is 2x+y, cost 4.2 (2x+y)
Wall, side y, length y, cost 6y
Total cost C - 4.2 (2x+y) + 6y = 8.4x + 10.2y
xy = 800 because of the area so y = 800/x
C = 8.4x + 8160/x
dC/dx = 8.4 - 8160/x2
dC/dx = 0 when x2 = 8160/8.4 = 971.42, giving x = 31.2
x = 31.2 then C = $ 523.62
Technically you should check that C has a minimum when x = 31.2, by showing the second derivative of C is positive when x = 31.2