# Finding the length and width of a house that maximize its area

A house is built in the shape of a rectangle, with $3$ rectangular interior sections separated by parallel walls, using fencing. The owner has $900$ feet of fencing, and he wants to enclose the largest possible area. What should the length, width, and area be?

Let the two inside parallel walls each have length $x$. Let the sides of the rectangle perpendicular to these each have length $y$.

Then the total area enclosed is $xy$. The amount of fencing used is $4x+2y$. This is to be $900$, since it is clear that it is best to use up all the fencing.

So we want to maximize $xy$, under the constraint $4x+2y=900$.

Thus $y=450-2x$, and we want to maximize $x(450-2x)$.

Because of the physical situation, we need $x\ge 0$ and $y\ge 0$. This means $x\le 225$.

So mathematically, we want to minimize $f(x)=450x-2x^2$, where $0\le x\le 225$.

This can be done by standard tools, such as calculus or completing the square.

• i got x= 225/2 and y=1 please help me. What are the correct answers – Michael Rametta Mar 27 '13 at 2:29
• I agree with the $x=225/2$. The $y$ is then $225$. – André Nicolas Mar 27 '13 at 2:32
• You are welcome. Sorry that it could not be accompanied by a picture. That is often a very important part of a solution. – André Nicolas Mar 27 '13 at 2:44

Here are more details than you wanted to know:

Suppose the house has length $l$ and width $w$. The length and with must be non-negative, of course. Then the area is $A(l,w) = lw$. The length of fence required is $2l+2w$ for the exterior wall and $2w$ for the interior separators, hence we have $\lambda(l,w) = 2(l+2w)$. So the problems is $\max\{ A(l,w) | \lambda(l,w) \le 900 , l \ge 0, w \ge 0\}$.

Inequality constraints are a little harder to work with in general, so we try to remove them.

Since the feasible set is compact, there is a maximum. If $(l,w)$ are non-negative, and $\lambda(l,w) < 900$, then we can increase $l$ and $w$ a little and increase $A(l,w)$. Hence the problem is equivalent to $\max\{ A(l,w) | \lambda(l,w) = 900 , l \ge 0, w \ge 0\}$.

The two non-negativity constraints are still present, so one way is to just ignore them and check if the resulting points are feasible.

Solving $\max\{ A(l,w) | \lambda(l,w) = 900 \}$ is straightforward since we can let $l = 450-2w$ (because $\lambda(l,w) = 900$), and then $A(450-2w,w) = (450-2w)w$. Note that this is a strictly concave quadratic, hence it has a maximum. Setting the derivative to zero and solving gives $\hat{w} = \frac{255}{2}$, and then we have $\hat{l}=255$. Since $\hat{w}, \hat{l} \ge 0$, this is a solution to the original problem.

Hence we have $\hat{w} = \frac{255}{2}$, $\hat{l}=255$, and $A(\hat{l},\hat{w}) = \frac{50625}{2}$.