Let's say the brick wall is one of the "length" sides.
The equation for perimeter is: P = l + l + w+ w
And since the perimeter is also the amount of fence, the cost of the fence is: C = $2l + $8l + $2w + $2w
Well then, you have the equation: 500 = $2l + $8l + $2w + $2wb) If you have only $500 to spend on materials, what are the dimensions of the largest (biggest area) plot you can enclose?
Substitute: 500 = 2l + 8l + 2w + 2w
Add: 500 = 10l + 4w
Subtract 10l from both sides: 500 - 10l = 4w
Divide both sides by 4: 125 - 2.5l = w
Now you want to find the largest area, so the equation for Area is: A = lw
Substitute: A = l(125-2.5l)
So: A = 125l - 2.5l^2
Let's say that A = y and l = x: y = 125x - 2.5x^2
Now graph that and find what value of x gives the largest area.