Math 1350 Calculus I -
Lab 3 - Maximization and Minimization

Math 135 - Calculus I - Lab 3. Optimization

A large class of problems spanning many fields of human endeavor are those concerned with optimization. Simply put, in an optimization problem we attempt to maximize or minimize a given quantity in a particular situation. For example, a dairy company may want to optimize its delivery routes so that fuel expenses are kept to a minimum. In order to find a suitable solution to this problem, it is necessary for us to develop a mathematical model that accurately describes how the choice of delivery routes effects the consumption of fuel. In general, problems in optimization can be extremely difficult to solve (try to analytically describe the relationship just presented!) However problems of this type are so important that an entire branch of mathematics, the calculus of variations, was developed to handle these kinds of problems. Fortunately for us, many optimization problems such as the one below are solvable by applying fundamental principles of calculus.

Suppose a company has a contract to build several open metal trash bins. Each has a square base and will hold 1000 cubic feet. It orders a pre-cut sheet for the bottom and another that it bends three times to form the four sides. (There is no top.) It must then weld the seams - one vertical and four horizontal. Records indicate that welding costs $2.10 per foot including labor and materials. The cost of the sheet metal is $1.85 per square foot. The company needs to answer the following questions:

1) What are the dimensions of the box that will minimize the cost?
2) What is the minimal cost?

The Solution:

In order to minimize the cost, we must first describe how the dimensions and the cost are related. Let h denote the height of the box and let b denote the length (and width) of the base. The total cost of the box is given by the equation

[Maple OLE 2.0 Object]

We now need to describe these costs in terms of the relevant variables h and b . The bottom of the box has an area of b2 square feet, and there are four sides each having an area of bh square feet. Therefore the total cost of the metal is given by 1.85(b2+4bh). The total length of the weld is the perimeter of the base, 4 b feet, plus the height of the seam along one side, h feet. The total cost of the welding is therefore 2.10(h+4b). Substituting these expressions into the cost equation gives us [Maple OLE 2.0 Object]

We have described the cost in terms of two variables. In order to find the minimal cost we must describe the cost in terms of only one variable so that we may calculate the derivative. The total volume gives the needed relationship between h and b . The volume of the box is 1000 cubic feet. In terms of h and b , the volume is hb2 . Therefore we have h=1000/b2. Now we can write the cost as a function of b alone:

[Maple OLE 2.0 Object]

We define the cost function in Maple:

> Cost:=1.85*(b^2+4000/b)+2.1*(1000/b^2+4*b);

[Maple Math]

Now we find the derivative and plot it. We will use the plot to estimate the location of the stationary point so that we may the use the "fsolve"  command to find the actual value. The reason, of course, that we do this is that a function's minimum or maximum value will occur at stationary points or endpoints.  To get Maple to take the derivative of the function we have named "Cost," we simply use the diff command and tell Maple what we want to take the derivative of and what to differentiate with respect to.

> dCost:=diff(Cost,b);

[Maple Math]

> plot(dCost,b=-20..20,y=-500..100,title=`Derivative of the cost function`);

[Maple Plot]

Note that you will have to experiment with the plot window in order to find the appropriate range and domain settings. From the graph it appears that the derivative is zero somewhere between b = 10 and b = 15. We use "fsolve" to tell it to look for a solution in the interval [10,15]:

> bmin:=fsolve(dCost=0,b,10..15);

[Maple Math]

This value of b tells what the base should be for the minimum cost to occur. We next determine the height corresponding to the minimal cost

> hmin:=1000/bmin^2;

[Maple Math]

In order to find the actual cost with these dimensions we can use the substitution command, "subs" in order to evaluate the cost when b = bmin .

> subs(b=bmin,Cost);

[Maple Math]

So each box costs approximately $998.41 to manufacture.


1. A contractor wants to bid on an order to make 150,000 boxes out of cardboard that costs 12 cents per square foot. The base of each box must be square and reinforced with an extra layer of cardboard. The contractor must assemble each box by taping the four seams around the bottom, one seam up the side, and one seam on top to make a hinged lid. Company records indicate that taping costs 11 cents per foot including labor and materials.

a) Assuming that the boxes are to hold 3.5 cubic feet, write the cost of a single box as a function of the length of the base.

b) What should the dimensions of the boxes be so that the production cost per box is lowest?
c) If the contractor wants to make a profit of 17%, what should she bid?

2.  A road from City A to City B must cross a strip of private land as shown in the figure below.  Due to fees demanded by the owner, the cost of building the road on private land is 20%  more per mile than it is on public land. 
a)  Assuming the cost on public land is $89,650 per mile, what is the minimum cost of the project?
b)  Draw a road map with the distances clearly labeled that ensures a minimum cost, and write and explanation that the City Commissioners can understand.