# Let's say I have $480 to fence in a rectangular garden. 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. How can I find the dimensions of the largest possible garden.? ##### 1 Answer Jan 31, 2015 Let's call the length of the N and S sides $x$(feet) and the other two we will call $y$(also in feet) Then the cost of the fence will be: 2*x*$10 for N+S and 2*y*$15 for E+W Then the equation for the total cost of the fence will be: $20 x + 30 y = 480$We separate out the $y$: $30 y = 480 - 20 x \to y = 16 - \frac{2}{3} x$Area: $A = x \cdot y$, replacing the $y$in the equation we get: $A = x \cdot \left(16 - \frac{2}{3} x\right) = 16 x - \frac{2}{3} {x}^{2}$To find the maximum, we have to differentiate this function, and then set the derivative to $0$$A ' = 16 - 2 \cdot \frac{2}{3} x = 16 - \frac{4}{3} x = 0$Which solves for $x = 12$Substituting in the earlier equation $y = 16 - \frac{2}{3} x = 8\$

N and S sides are 12 feet
E and W sides are 8 feet
Area is 96 square feet