# How do you find the dimensions of the largest possible garden if you are given four hundred eighty dollars to fence a rectangular garden and the fencing for the north and south sides of the garden costs $10 per foot and the fencing for the east and west sides costs$15 per foot?

Mar 14, 2015

North and South sides should be 12 feet long and the other two sides should be 8 feet long.

The problem can be solved using the calculus of one variable or the calculus of two variables using Lagrange multipliers. The initial analysis is the same either way.
Because the question does not specify Lagrange Multipliers, I'll do the single variable solution. (It is accessible to more readers.)

Let $x$ = the length in feet of the North and South sides (their cost is $10 per foot). Let $y$= the length in feet of the East and West sides (their cost is $15 per foot)

The area is $A = x y$. We want to make $A$ as large as possible.

The total cost of the $x$ by $y$ rectangle is:
$C = 10 x + 15 y + 10 x + 15 y = 20 x + 30 y$ .

We have $480 to spend. Is is clear that we will not get the largest possible area if we spend less than $480. So we can see that, for largest area we'll have:
$20 x + 30 y = 480$

Single Variable Calculus Solution

We want $x$ and $y$ to make the product $A = x y$ as large as possible. We also know that
$20 x + 30 y = 480$. Solve for $y$ to get:

$y = 16 - \frac{2}{3} x$.

Now substitute in the area:
$A = x \left(16 - \frac{2}{3} x\right) = 16 x - \frac{2}{3} {x}^{2}$

Maximize as usual:

$A ' = 16 - \frac{4}{3} x = 0$ at $x = \frac{3}{4} \cdot 16 = 12$ Clearly $A '$ is never undefined. So, $12$ is the only critical number for $A$.

$A ' ' \left(12\right) < 0$ So $A \left(12\right)$ is the global maximum.

We weren't asked or the area, but the dimensions:

$x = 12$, $y = \frac{2}{3} x = 8$

North and South sides should be 12 feet long and the other 2 sides should be 8 feet long.