Mary wants to fence a rectangular garden to keep the deer from eating her fruit and vegetables. One side of her garden abuts her shed wall so she will not need to fence that side. However, she also wants to use material to separate the rectangular garden in two sections (see Figure \(\PageIndex{5}\)). She can afford to buy 80 total feet of fencing to use for the perimeter and the section dividing the rectangular garden. What dimensions will maximize the total area of the rectangular garden?
Figure \(\PageIndex{5}\) Mary’s rectangular garden needs fencing on three sides and also for the fence to divide the garden.
Solution
Again, before we take an algebraic approach, let’s just experiment. Note that we’ve labeled the width with the letter x and the height with the letter y in our sketch of the garden in Figure \(\PageIndex{5}\).
There is a total of 80 feet of fence material. Suppose that we let y = 5 ft. Because there are three sides of length y = 5 ft, we’ve used 15 feet of material. That leaves 65 feet of material which will be used to fence the width of the garden. That is, the width is x = 65 ft. Thus, the dimensions of the garden are x = 65 ft by y = 5 ft. The area equals the product of these two measures, so \(A=325 \mathrm{ft}^{2}\). Let’s put this result into a table.
| x |
y |
A=xy |
| 65 ft |
5 ft |
325 \(\text{ft}^{2}\) |
Suppose instead that we let the height be y = 10 ft. Again, there are three sections with this length, so this will take 30 ft of material. That leaves 50 ft of material, so the width x = 50 ft. The area is the product of these two measures, so \(A=500 \mathrm{ft}^{2}\). As a third experiment, let the height y = 15 ft. Subtracting three of these lengths from 80 ft, we see that the width x = 35 ft. The area is the product of these measures, so \(A=525 \mathrm{ft}^{2}\). Let’s add these last two number experiments to our table.
| x |
y |
A=xy |
| 65 ft |
5 ft |
325 \(\text{ft}^{2}\) |
| 50 ft |
10 ft |
500 \(\text{ft}^{2}\) |
| 35 ft |
15 ft |
525 \(\text{ft}^{2}\) |
At this point, the last set of dimensions yields the maximum area, but is it possible that another choice of x and y will yield a larger area? Experiment further with numbers of your choice to see if you can find dimensions that will yield an area larger than the current maximum in the table, namely 525 \(\mathrm{ft}^{2}\).
Let’s now call on what we’ve learned in this section to attack this model. First, we’re constrained by the amount of material we have for the job, a total of 80 ft of fencing. This constraint requires that 3 times the height of the garden, added to the width of the garden, should equal the available amount of fencing material. In symbols,
\[x+3 y=80 \nonumber \]
We’re asked to maximize the area, so we focus our efforts on finding a formula for the area of the rectangular garden. Because the area A of the rectangular garden is the product of the width and the height, \[A=x y \nonumber \]
We now have a formula for the area of the rectangular garden, but unfortunately we have the area A as a function of two variables. We need to eliminate one or the other of these variables. This is easily done by solving equation (18) for x. \[x=80-3 y \nonumber \]
Next, substitute this result in equation (19) to get \[A=(80-3 y) y \nonumber \]
or, equivalently, \[A=-3 y^{2}+80 y \nonumber \]
Note that we have expressed the area A as a function of a single variable y. Also, the function defined by equation (21) is quadratic. Compare \(A=-3 y^{2}+80 y\) with the general form \(A=a y^{2}+b y+c\) and note that a = −3 and b = 80 (we have no need of the fact that c = 0). Therefore, if we plot A versus y, the graph is a parabola that opens downward (see Figure \(\PageIndex{6}\)), so the maximum value of A will occur at the vertex. The y-coordinate of the vertex is found with
\[y_{\mathrm{vertex}}=-\frac{b}{2 a}=-\frac{80}{2(-3)}=\frac{80}{6}=\frac{40}{3} \nonumber \]
To find the width of the rectangular garden, substitute y = 40/3 into equation (20) and solve for x.
\[x=80-3 y=80-3\left(\frac{40}{3}\right)=80-40=40 \nonumber \]
Thus, the width of the rectangular garden is 40 ft. We can find the area of the garden by multiplying the width and the height.
\[A=x y=(40)\left(\frac{40}{3}\right)=\frac{1600}{3}=533 \frac{1}{3} \nonumber \]
Note that the resulting area, \(A=533 \frac{1}{3} \mathrm{ft}^{2}\), is only slightly bigger the last tabular entry found with our numerical experiments.
You can also find the area of the rectangular region by substituting y = 40/3 into equation (21). We’ll leave it to our readers to check that this provides the same measure for the area. You will also notice that the second coordinate of the vertex in Figure \(\PageIndex{6}\) is the maximum area \(A=1600 / 3 \mathrm{ft}^{2}\).

Figure \(\PageIndex{6}\). The maximum area, A=1600\(/ 3 \mathrm{ft}^{2}\), occurs at the vertex of the parabola, (40/3, 1600/3).