1. Jan 25, 2012

### csc2iffy

1. The problem statement, all variables and given/known data
1. The problem statement, all variables and given/known data
A farmer wants to build a rectangular pen. He has a barn wall 40 feet long, some or all of which must be used for all or part of one side of the pen. In other words, with f feet of of fencing material, he can build a pen with a perimeter of up to f+40 feet, and remember he isn't required to use all 40 feet.
What is the maximum possible area for the pen if:
a. 60 feet of fencing material is available
b.100 feet of fencing material is available
c. 160 feet of fencing material is available

2. Relevant equations
a.
P=> 2x+y=60 => y=60-2x
A=> xy=60x-2x^2

3. The attempt at a solution
I worked through the problem and found
a. For 60 ft of fencing material
x=15, y=30 => A=450 sq ft

I am not sure how to do b and c.
This is my attempt, but I know it is wrong (slightly)
b. For 100 ft of fencing material,
P=> 2x+y=100 => y=100-2x
A=> xy=100x-2x^2
working through this, I end up with
x=25, y=50 => A=1250 sq ft

I know this is wrong because the barn wall is only 40 feet long, and y=50, but all of the 100 feet of fencing has been used up by 2x+y, so there will be 10 feet of fencing missing. How do I rework the problem? Please help i've been working on this for hours!! :(

2. Jan 25, 2012

### vela

Staff Emeritus

The variable y is the one with the constraint on it. It has to lie somewhere in the interval [0, 40]. Write the area as a function of y and find where it attains its maximum on that interval.

3. Jan 25, 2012

### issacnewton

$$x\geqslant 0\quad ; 0\leqslant y\leqslant 40$$
$$2x+2y \leqslant 140$$
Maximize the function $A=xy$. Use LP theorem