Setting Up Optimization Problems
Textbook Reference
| Primary source | OpenStax Calculus Volume 1, Section 4.7: “Applied Optimization Problems” |
| Direct link | https://openstax.org/books/calculus-volume-1/pages/4-7-applied-optimization-problems |
| Textbook used in class | Stewart, Calculus, Section 3.7: “Optimization Problems” |
Opening Scenario
A sheet of cardboard is $12$ inches by $12$ inches. Cut equal squares of side length $x$ from each corner, fold up the sides, and tape the edges to form an open-top box. What value of $x$ produces the largest possible volume?
Before any calculus, notice: if $x$ is very small, the box is nearly flat and the volume is near zero. If $x$ is nearly $6$ inches (half the sheet width), the base is nearly gone and again the volume is near zero. So the maximum volume occurs somewhere in between -- but where? That is an optimization problem.
The Setup Strategy
The calculus at the end of an optimization problem is almost always straightforward: find a critical number and classify it. The hard part is getting to a function you can differentiate. Setting up the problem carefully is the whole challenge.
Five-step setup:
Read slowly and identify the quantity to maximize or minimize. This is called the objective quantity. Write it in words: “I want to maximize the volume.”
Draw a diagram and label it with variables. Every geometric dimension gets a variable name. The diagram is not decoration; it is a record of what you decided to call things.
Write the objective as a formula. Express the objective quantity in terms of the variables from Step 2. This is the objective function before the constraint is applied.
Write the constraint. A constraint is a fixed relationship among the variables (perimeter, surface area, total material, total cost, etc.). Write it as an equation.
Use the constraint to reduce to one variable. Solve the constraint equation for one variable and substitute into the objective function. The result is a function of one variable, ready for calculus.
State the domain. What values of the remaining variable make physical sense?
Key Concepts
1. Identifying the Objective and the Constraint
Many students confuse the objective with the constraint. The two are different.
- The objective is what you want to make as large or as small as possible.
- The constraint is a fixed condition the answer must satisfy. It is not optional; it is given.
In the box problem: the objective is the volume (maximize it); the constraint is the size of the cardboard sheet (it is $12 \times 12$, fixed).
2. Setting Up the Box Problem
Step 1: Identify the objective. Maximize the volume $V$ of the box.
Step 2: Draw and label. Let $x$ = the side length of each cut square (in inches). After cutting and folding, the box has:
- base dimensions: $(12 - 2x)$ by $(12 - 2x)$,
- height: $x$.
Step 3: Write the objective function. $$V = x(12 - 2x)^2$$
Step 4: Write the constraint. The constraint is already built into the formula: $x$ is the only free variable, and the $12$ comes from the sheet size (fixed). There is no separate constraint equation to write here because the geometry already expresses $V$ in one variable.
Step 5: Simplify (optional, but helpful). $$V = x(144 - 48x + 4x^2) = 4x^3 - 48x^2 + 144x$$
Step 6: Determine the domain. The cut square must have positive side length ($x > 0$) and must fit on the sheet (each side is $12$ inches, so two cuts of $x$ each must leave something: $12 - 2x > 0 \Rightarrow x < 6$).
Domain: $0 < x < 6$, an open interval.
The calculus part -- finding the maximum -- is the next lesson. The setup is done.
3. A Two-Variable Setup That Requires a Constraint
Example 2. A rectangular storage area is to be enclosed using $100$ meters of fencing. One side of the rectangle uses the wall of an existing building and needs no fencing. Find the dimensions that maximize the enclosed area.
Step 1: Objective: maximize the area $A$ of the rectangle.
Step 2: Let the side parallel to the building wall have length $l$ and the two sides perpendicular to the wall have length $w$. (Draw this.)
Step 3: Objective function (with two variables): $A = l \cdot w$.
Step 4: Constraint (only three sides need fencing, not four): $l + 2w = 100$.
Step 5: Solve the constraint for $l$: $l = 100 - 2w$. Substitute: $$A = (100 - 2w)w = 100w - 2w^2.$$
Step 6: Domain. We need $l > 0$ and $w > 0$: $100 - 2w > 0 \Rightarrow w < 50$. So $w \in (0, 50)$.
Ready for calculus: $A(w) = 100w - 2w^2$ on $(0, 50)$.
4. The Most Common Setup Errors
“Set the derivative of the objective function equal to zero immediately, before applying the constraint.” If the objective has two variables (e.g., $A = lw$), its derivative is meaningless until you reduce to one variable. Always apply the constraint first.
“The constraint must be an equation I am given.” Sometimes the constraint comes from a formula that must be satisfied (e.g., the volume must equal a given amount), and sometimes it comes from the geometry of the situation (e.g., the perimeter of a rectangle is fixed). Either way, the constraint is a relationship that restricts the variables.
Common Errors Summary
| Error | Example | Correction |
|---|---|---|
| Skipping the diagram | Writing formulas without drawing the rectangle or box | Draw first; the diagram prevents variable confusion |
| Using too many variables without a constraint | Writing $A = lw$ and differentiating with respect to $l$ while $w$ changes | Identify the constraint, eliminate one variable, then differentiate |
| Setting the wrong thing equal to zero | Setting the area equal to zero to find the maximum | Set the derivative of the area equal to zero |
| Wrong domain | Forgetting that $x < 6$ for the box problem | Check both $x > 0$ and that dimensions remain positive |
Leveled Practice
Level 1 -- Identify Objective and Constraint
Problem 1. A farmer has $300$ feet of fencing to enclose a rectangular field. Identify the objective and the constraint. Do not solve.
Show answer
Objective: maximize the area $A = lw$ of the rectangular field.
Constraint: the total fencing used is $300$ feet: $2l + 2w = 300$, i.e., $l + w = 150$.
Problem 2. For the farmer’s field in Problem 1, express the area as a function of one variable and state the domain.
Show answer
From the constraint: $l = 150 - w$. Substitute into the objective: $$A(w) = (150 - w) \cdot w = 150w - w^2.$$
Domain: $w > 0$ and $l = 150 - w > 0$, so $0 < w < 150$.
Level 2 -- Full Setup
Problem 3. A cylindrical can (no top) must hold exactly $500 \text{ cm}^3$. The material for the bottom costs twice as much per square centimeter as the material for the sides. Express the total cost as a function of the radius $r$.
Show answer
Variables: $r$ = radius, $h$ = height.
Objective: minimize cost. Let the side material cost $c$ per $\text{cm}^2$; bottom costs $2c$ per $\text{cm}^2$.
- Side area: $2\pi r h$. Side cost: $2\pi r h \cdot c$.
- Bottom area: $\pi r^2$. Bottom cost: $2c \pi r^2$.
- Total cost: $C = 2c\pi r h + 2c\pi r^2$.
Constraint: $\pi r^2 h = 500$, so $h = \dfrac{500}{\pi r^2}$.
Substitute: $$C = 2c\pi r \cdot \frac{500}{\pi r^2} + 2c\pi r^2 = \frac{1000c}{r} + 2c\pi r^2.$$
Factor out $c$ (a positive constant, does not affect where the minimum is): $$C(r) = c\!\left(\frac{1000}{r} + 2\pi r^2\right).$$
Domain: $r > 0$.
Mastery Checklist
Mental Model
Setting up an optimization problem is a translation task: the problem statement, written in English, must be translated into a single function of one variable over a given domain. The five setup steps guide the translation:
- Steps 1-3: build a formula from the geometry or context.
- Step 4: find the rule that relates the variables (the constraint).
- Steps 5-6: eliminate variables until you have one function of one variable on a known domain.
The calculus then finds the optimal value. But calculus is useless without a correct single-variable function to differentiate. The setup is the work.
Back to Applications of Differentiation | Next: Solving Optimization Problems