AP Calculus AB and BC
Optimization Setup Builder: Objective vs Constraint
Set up an optimization problem by deciding what you are optimizing (the objective) and separating it from what the problem holds fixed (the constraint). Use the constraint to rewrite the objective in one variable, state the domain, differentiate, find critical points, and confirm the max or min with a derivative test.
A farmer has 100 meters of fencing to enclose a rectangular field. What dimensions x and y give the largest possible area?
First, which quantity does this problem ask you to maximize? (The other two are not what you optimize.)
- 1.Draw and label a picture.
- 2.Name the variables.
- 3.Write the objective (what you optimize).
- 4.Write the constraint (what is fixed).
- 5.Substitute to get the objective in one variable.
- 6.State the domain, endpoints included.
- 7.Differentiate and find the critical points.
- 8.Run a derivative test, then answer the actual question with units.
The hardest part of an optimization problem is not the calculus, it is deciding what to optimize. This builder makes you commit to that decision first: it shows a scenario and three candidate formulas, and you choose the one quantity the problem asks you to maximize or minimize. The other two are things you should not optimize: usually a quantity the problem holds fixed (a constraint), and sometimes a related quantity that is the wrong thing to make large or small. Getting this split right is the heart of Topics 5.10 and 5.11 (Introduction to Optimization Problems and Solving Optimization Problems); almost everything after it is procedure.
The objective is the quantity that is free to change and that you want as large or as small as possible: an area, a volume, a length of fence, a distance. The constraint is whatever the problem pins to a fixed value: the meters of fencing you already own, the square feet the pen must enclose, the inch sheet you start with. A quick test settles most cases: if the problem states a quantity as a specific number, that number is the constraint, so it cannot be the thing you optimize.
The mistake the tool is built to catch
Students routinely set up to optimize the quantity that is actually fixed. If you try to maximize the perimeter when the fencing is already meters, there is nothing to maximize, the perimeter is stuck at . When you pick one of the other two candidates in the builder, it explains specifically why that quantity is not the objective, often because the problem holds it fixed, and lets you try again; it never names the correct choice, so the retry is reasoning rather than copying.
Once you have named the objective, the builder reveals the rest of the setup one line at a time, in the order the AP rubric rewards. You write the constraint equation, use it to rewrite the objective in a single variable, state the domain, differentiate, solve for the critical points, and run a derivative test before you answer. A persistent checklist keeps the full procedure in view so you internalize the method, not one answer.
- Draw and label a picture.
- Name the variables.
- Write the objective, the quantity you optimize.
- Write the constraint, the quantity that is fixed.
- Substitute to get the objective in one variable.
- State the domain, endpoints included.
- Differentiate and find the critical points.
- Run a derivative test, then answer the actual question with units.
The reason for reducing to one variable is that the derivative tools you know act on a function of a single input. The constraint is what lets you do it: solve the constraint for one variable and substitute, and a two variable objective collapses into one you can differentiate. For a rectangle of fixed perimeter, the constraint gives , and the area becomes a function of alone.
With the objective in one variable you differentiate, set the derivative equal to to find the critical points, then confirm which one is the maximum or minimum. Skipping that confirmation is the most common way to lose points: a critical point is only a candidate until a derivative test, or a comparison against the endpoints, proves it wins.
One step in the checklist does more work than it looks: state the domain, endpoints included. The physical setup limits how large or small your variable can be, and those limits matter, because on a closed interval the maximum or minimum can occur at an endpoint rather than at an interior critical point. This is the candidates test for absolute extrema (Topic 5.5): on a closed interval, compare the objective at every critical point and at both endpoints, and the largest or smallest value wins.
For the open-top box cut from a inch square, the corner cut has to satisfy : a cut of leaves a flat sheet, and a cut of removes the whole side. At both endpoints the volume is , so neither endpoint can be the maximum, which is why the interior critical point governs here. State the domain anyway, every time, because the moment the endpoints are not obvious losers you will need them.
Closed interval versus open
On a closed interval like the endpoints are fair game and must be checked. On an open interval like , the three-sided-pen (minimum-fence) and cylinder problems for instance, no endpoint is attainable, so an interior critical point that a derivative test confirms is the answer. The maximum-area fencing problem, by contrast, is closed, , so its endpoints belong in the check. Reading the domain tells you which situation you are in before you commit to an answer.
Worked example
The largest open-top box
An open-top box is formed from a inch by inch square sheet by cutting a square of side from each corner and folding up the flaps. Find the value of that gives the largest volume.
- Step 1, name the objective. You are asked for the largest volume, so the objective is the volume . The area of the original sheet is fixed at square inches, so it is a constraint, not something you can maximize; the base area alone is largest when , but then the box has no height and no volume, so that is not the goal either.
- Step 2, write the constraint and reduce to one variable. Cutting from each corner leaves a base of side and a height of , so the volume is the product of these: .
- Step 3, state the domain. The cut cannot be negative and cannot exceed half the side, so . At and the volume is , so if there is a positive maximum it lives strictly inside the interval.
- Step 4, differentiate. Using the product and chain rules and factoring, the derivative comes out cleanly: .
- Step 5, find the critical points. Set : . The solution is an endpoint where the volume is , so discard it. The candidate is .
- Step 6, run a derivative test. Check the sign of on either side of : and . The derivative changes from positive to negative, so has a maximum at by the first derivative test.
- Step 7, answer the actual question with units. The problem asked for the cut length that maximizes volume, so report inches, and evaluate the volume there as a check: .
A corner cut of inches gives the largest box, with volume cubic inches. Notice where the last two steps land: the derivative test justifies the maximum, and the answer carries units. On a free response question, both are where the points live.
Frequently asked questions
How do I tell the objective from the constraint in an optimization problem?
The objective is the quantity you are asked to make as large or as small as possible, and it is free to change: an area, a volume, a length, a distance. The constraint is whatever the problem fixes to a specific value, like meters of fencing or an enclosed area of square feet. A fast test: if the problem states a quantity as a definite number, that number is the constraint, so it cannot be the thing you optimize. Name the objective first, then use the constraint to reduce it to one variable.
Why do I have to state the domain before I optimize?
Because the maximum or minimum can sit at an endpoint, not at an interior critical point. On a closed interval the candidates test (Topic 5.5) says to compare the objective at every critical point and at both endpoints and take the winner. For the open-top box the domain is , and the volume is at both endpoints, so the interior critical point wins; but you only know that after you have written the domain down. When the endpoints are not obvious losers, forgetting them costs the answer.
Should I use the first derivative test or the second derivative test?
Either one justifies a maximum or minimum, so use whichever is less work for your function. The first derivative test checks the sign of just before and just after the critical point: a change from positive to negative is a maximum, negative to positive is a minimum. The second derivative test checks concavity: at the critical point gives a maximum, gives a minimum. The second test is quick when is easy to evaluate, but it is inconclusive when , so fall back to the first derivative test or the candidates test there.
Is optimization on the AP Calculus exam?
Yes, in both AB and BC, as Topics 5.10 and 5.11. It appears in multiple choice and, classically, as a free response question that asks you to build the model and justify the extreme value. The graded steps are the setup and the justification: defining the objective, reducing to one variable, and confirming the maximum or minimum with a derivative test or the candidates test. Reporting a critical point without that justification does not earn full credit, which is exactly why this tool drills the setup rather than the number.