# Optimization fence problem with twist.

Suppose you have a 10x15 foot dog house and you wish to build a fence in a yard in a L shape to the north and east of the dog house. If you have 75 feet of fencing material available, what dimensions should the sides of the yard be to maximize the amount of area for the yard?

• Imgur – user199167 Dec 10 '14 at 14:52
• What have you tried? Can you figure out how much fence is in the other two sides from $w,h$? This becomes an equation linking $w,h$. What is the area? – Ross Millikan Dec 10 '14 at 14:57
• Well i tried this what i have in the picture. area being equal to the Length* Width - 150 = max....... W+(w-10)+h+h+(h-15) = 75 – user199167 Dec 10 '14 at 15:00
• @user199167 Do not deface your question. – Aditya Hase Dec 10 '14 at 16:39
• deface? sorry, im a first time poster. I just wanted people to know i got. – user199167 Dec 10 '14 at 17:02

Hint: The two equations you wrote down in your figure are

$$2w+2h-25=75$$ and $$wh-150=\text{max}$$

where I've taken the first step in simplifying the first equation. Now solve it for one variable in terms of the other, substitute the result into the second equation so that you have a function of one variable that you're seeking to maximize, and then use calculus.

An alternative hint: Imagine you've got $100$ feet of fence, but you've got to surround the dog house as well as the yard.

If a the perimeter of a rectangle is fixed, the area is the most when length and breadth are equal (a square). So, length=breadth=75/4=18.75 As the doghouse fits in the yard, this is the answer.

• This is not correct because the walls of the doghouse make part of the perimeter. – Ross Millikan Dec 10 '14 at 15:47

Perimeter of yard: $w+h+w-10+h-25=75$

$w+h=50$; $h=50-w$

Area of yard: $wh-150$ $\rightarrow$max

$w(50-w)-150$

$50w-w^2-150$

$-(w^2-50w+25^2)+25^2-150$

Area=$-(w-25)^2+475$ $\rightarrow$max when the bracket becomes $0$ i.e. $w=25$

$w+h=50$ $\rightarrow$ $25+h=50$; $h=25$

Therefore, for $Area_{max}$, $w=h=25$

• where did you get the 25^2? were you trying to make a perfect square? – user199167 Dec 10 '14 at 16:14
• I used $25^2$ to complete the square for w it made that bracket whole square of $(w-25)$ – Dheeraj Kumar Dec 10 '14 at 16:15
• as I added $25^2$ in the bracket i actually subtracted it from the whole equation because of negative sign on bracket so in order to balance the equation i added another $25^2$ on the outside – Dheeraj Kumar Dec 10 '14 at 16:17
• the equation is maximum when the stuff in the bracket is minimum i.e. 0 so i simply put w-25=0 – Dheeraj Kumar Dec 10 '14 at 16:19