Calculate minimum perimeter of a rectangle with an extra constraint. I have been set this problem, and although I can derive a minimum perimeter using calculus, I now need to add an extra constraint to one side of the rectangle and I am having problems deriving a suitable equation for the second half of the problem.

An area of 800 $m^2$ is to be fenced off. If the cost per metre of fencing for the frontage is three times as much as the cost per metre of fencing for the remainder, calculate the dimensions for which the cost of fencing is a minimum.

I've worked out that the minimum perimeter is a square 28.28m on a size and the cost of fencing is given by $\textrm{Cost} = 4x + 2y$.
 A: You have posited a rectangle enclosing $800 m^2$. The dimensions are $ x m × {800\over x}m$, where $x$ is deemed to be the length (in meters) of the frontage and the side opposite. Îf it were not for the enhanced cost of the frontal side, then minimizing the perimeter and minimizing the cost would be the same problem -- i.e., find the minimum of the function $2x+{1600\over x}$.  
But the fact that the frontal fencing costs treble the fencing for the non-frontal sides changes the function whose minimum is required (so as to minimize the outlay) to $4x+{1600\over x}$ or $4x+1600 x^{-1}$. Differentiating this function gives $4-1600x^{-2}$ or $4-{1600\over x^2}$. Setting this equal to zero and solving for $x$ yields the length of the frontage from which the depth of the rectangle can be found. 
A: Let $x$ be the length of the frontage and $y$ be the width of the rectangle.  If the base cost of fencing is [constant] $c$ dollars per meter, then the cost of erecting the pen is 
$$C(x,y) = 3cx + cx + cy + cy = c(4x + 2y).$$
Since $c > 0$, you can ignore it and minimize $C$ in the presence of the constraint $xy = 800.$
A: HINT
You need to minimise the cost, and not simply the length.
Assume the rectangle has length $\ell$ and width $w$. Assume that the width is along the front. Assume that the price is $p$ units of currancy per unit of length. Then the cost is $3wp$ for the front, $\ell p$ each for the two sides and $w$ for the back. The total cost is then
$$C = 4wp + 2\ell p$$
You need to minimise $C$ subject to the constraint that the enclosed area $\ell w = 800$.
This is pretty much the same question as before, except you need to minimise the cost $4wp + 2\ell p$ instead of the perimeter $2w + 2\ell$.
