Build an optimization model
An optimization problem asks for the largest or smallest value of a quantity, such as an area or a cost. Topic 5.5 finds such values for a function of one variable on an interval, but a word problem describes a situation instead. This topic turns the situation into a model: a function of one variable, and the inputs that the situation allows.
The objective and the constraint
A rectangular pen beside a river that runs along its bottom edge. The two sides perpendicular to the river are orange and x long; the side opposite the river is y long. Under the pen, a bar lays the three pieces of fence end to end, two orange and one plain, filling 120 meters. Below, the graph of the area A against x: a hill from 0 to 60, solid over a thick stretch of the axis from 0 to 60, with filled dots at both ends, and faint past 60, where it falls below the axis. Past 60 the pen and the point turn red. A button adds a red piece to the bar past the 120 meter mark.
In Figure 1, a farmer has 120 meters of fence for a rectangular pen beside a river, with no fence along the river. The two orange sides, perpendicular to the river, are each \(\cy{x}\) meters long, and the side opposite the river is \(y\) meters long. Move \(x\) with the slider. The numbers under the figure give \(y\) and the area.
The objective is the quantity that the question asks you to make largest or smallest. If the farmer wants the largest pen, the objective is the area \(\cb{A}=xy\) of the teal region. The graph under the pen plots \(\cb{A}\) against \(x\), and its orange point rises and falls as the shape changes.
A constraint is an equation that holds for every choice the problem allows, here every shape of the pen. Under the pen, a bar shows the three pieces of fence end to end: two orange pieces of length \(x\) and one of length \(y\). For every shape, they fill the 120 meters, so
To write a constraint, count every piece that the picture has. Use the button under Figure 1 to count a fence along the river as well. A red piece of length \(y\) joins the bar and runs past the 120 m mark. The equation \(2x+2y=120\) counts this fence, which the pen does not have.
To tell the objective from a constraint, change the shape. The area changes, so it can be the objective. The length of fence stays 120 meters for every allowed shape, so it belongs to a constraint. It cannot be the objective, because no shape gives it a better value.
A function of one variable
The area \(\cb{A}=xy\) depends on two lengths, but by the constraint, each \(x\) allows only one \(y\). Solve the constraint for \(y\). Then substitute the result for \(y\) in the objective:
The area is now a function \(\cb{A(x)}\) of one variable, called the objective function, and the graph in Figure 1 is its graph. In general, if the question names the input variable, solve the constraint for the other one. Otherwise, solve it for the variable that is easier to isolate, here \(y\), which appears once, with no coefficient. Replace it by its expression everywhere in the objective \(Q\). Then \(Q\) is a function of one variable.
The same steps work for other constraints. In Figure 2, a closed can of radius \(\cy{r}\) and height \(h\), in centimeters, must hold 1 liter, which is 1000 cubic centimeters. Its maker wants to use the least metal, so the objective is its surface area \(\cb{S}\). The can has two circular ends, each of area \(\pi r^2\), and its side unrolls into a rectangle \(2\pi r\) long and \(h\) tall. With the volume \(\pi r^2h\), the objective and the constraint are:
For \(r>0\), solve the constraint for \(h\), which appears once. Then substitute it in the side term \(2\pi rh\). The ends contain no \(h\), so they stay as they are:
A closed can drawn to scale, with its radius r in orange and its height h, holding 1000 cubic centimeters. Below, the graph of the surface area S against r. The curve comes down steeply from the top of the graph near r = 0, reaches a lowest point between r = 5 and r = 6, and rises again to the right edge. The thick stretch of the axis starts at an open ring at 0 and runs off the right edge.
Move \(\cy{r}\) in Figure 2. Tall, thin cans have a large side term \(\frac{2000}{r}\), and wide, flat cans have large ends, so the graph is high at both ends.
The feasible domain
The feasible domain is the set of inputs that the situation allows. Find it from the situation, not from the formula. In Figure 1, each length must be 0 or more:
Move \(x\) past 60. On the bar, the two orange pieces alone run past the 120 m mark, so \(y\) would be negative and no pen exists. The pen and the point on the graph turn red, but the formula still gives a value, a negative area. Other limits in a problem, such as the length of a wall, add more inequalities.
At \(x=0\) and at \(x=60\), the pen is flat, with area 0. A flat pen is a limiting case rather than a real pen, but it satisfies the constraint, so these endpoints stay in the domain. Figure 1 marks them with filled dots. The domain is then the closed interval \([0,60]\), on which the polynomial \(\cb{A}\) is continuous. By the Extreme Value Theorem (topic 5.2), \(\cb{A}\) has a largest value there, at an endpoint or where its derivative is 0 (topic 5.5). Topic 5.11 finds it.
An endpoint where no shape satisfies the constraint is impossible, and it is left out. At \(r=0\), the volume \(\pi r^2h\) of the can in Figure 2 is 0, whatever \(h\) is. No can of radius 0 holds 1000 cubic centimeters, and \(\cb{S(r)}\) is undefined there too. A can may be as wide as you like, so the domain \(r>0\) contains no endpoint, and the Extreme Value Theorem does not apply.
Example 1
Identify the quantity to optimize
A rectangular page must contain 40 square inches of print, with margins of 3 inches at the top and the bottom and 2 inches at each side. The printer wants to use the least paper. Let \(x\) and \(y\) be the width and the height of the print, in inches. Write the quantity to be minimized and the constraint in terms of \(x\) and \(y\).
Solution
The printer wants the least paper, so the objective is the area of the whole page, margins included. The page is \(x+4\) inches wide, with 2 inches at each side, and \(y+6\) inches tall, with 3 inches above and below the print:
The print covers 40 square inches on every allowed page, so its area gives the constraint:
To test the roles, compare a print 5 inches wide and 8 tall with one 8 wide and 5 tall. Their pages, 9 by 14 and 12 by 11, have areas 126 and 132 square inches, so the paper changes and the print does not.
Example 2
Write the constraint
A farmer uses 600 meters of fence to enclose a rectangular field and divide it into three pens, with two fences parallel to one pair of sides. These two fences and the sides parallel to them are each \(x\) meters long, and the other two sides are each \(y\) meters long. Write an equation that relates \(x\) and \(y\).
Solution
Count the pieces of each length. The two dividers and the two sides parallel to them are each \(x\) long, so \(x\) appears four times. The other two sides are each \(y\) long. Together the pieces use all 600 meters:
This equation holds for every field that the farmer can build, so it is the constraint. Solved for \(y\), it gives \(y=300-2x\).
Example 3
Build an objective in one variable
A theater sells 600 tickets to a show at a price of $10 each. For each $1 increase in the price, it sells 30 fewer tickets. Let \(p\ge 10\) be the price in dollars and \(n\) the number of tickets sold. Write the revenue \(R=pn\) as a function of \(p\) alone.
Solution
The number of tickets depends on the price, and this rule is the constraint. A price of \(p\) dollars is \(p-10\) dollars above $10, and each of those dollars means 30 fewer tickets:
Substitute this expression for \(n\) in the revenue. Then \(R\) depends on \(p\) alone:
As a check, \(R(10)=10\,(900-300)=6000\), the revenue from 600 tickets at $10.
Example 4
State the feasible domain
A box with a square base and no top is made from exactly 64 square meters of sheet metal. The side of the base is \(x\) meters and the height is \(h\) meters, so the volume is \(V(x)=16x-\tfrac{x^3}{4}\). Find the feasible domain of \(V\).
Solution
The base has area \(x^2\), and each of the four sides has area \(xh\), so the metal gives the constraint
Both lengths must be 0 or more. For \(x>0\), solve the constraint for \(h\). Because \(4x>0\), the height is 0 or more when \(64-x^2\ge 0\):
At \(x=8\), the height is 0. The box is flat, with all the metal in its base, but it satisfies the constraint, so this endpoint stays as a limiting case. At \(x=0\), the constraint reads \(0=64\) for every \(h\), so no box exists, even though \(V(0)=0\). The feasible domain is
Each example is one of the four skills of topic 5.10 in Which & Why: AP Calculus.