The cost of material used to make the other sides is
Now , the fence to be build around the rectangular pen has four sides, the first opposite sides are equal, let assume each of the to be x yard and the other opposite sides are also equal as well let assume of the to be y yard
So the cost is mathematically represented as
=>
=>
Now the area of the fence is mathematically represented as
=>
=>
=>
Now differentiating
At minimum
So
Now substituting for x in the equation above to obtain minimum cost