AP Calculus AB · Topic 5.10 · Reading guide, about 4 min

Setting up a max or min word problem

Turn an optimization word problem into one function of one variable, with a constraint and a feasible domain.

In one minute

Optimization problems ask for the biggest area, the smallest cost, the shortest distance. The calculus is the easy part. The hard part is the setup: turning words into a function of a single variable and finding the interval where it makes sense.

This topic is mostly about setup, with a short solved example. Topic 5.11 shows how to finish and justify problems.

Key terms

Objective function
The quantity you want to maximize or minimize, such as area AA, volume VV or cost CC, written in terms of one variable.
Constraint
An equation that links the variables, like a fixed length of fence or a fixed volume.
Primary equation
The formula for the objective function before you eliminate extra variables.
Secondary equation
The constraint, used to solve for one variable and substitute it into the primary equation.
Feasible domain
The set of inputs that make physical sense, like lengths that are not negative.
Optimize
To find the input that gives the largest or smallest output of the objective function over its domain.
Endpoints of the domain
The boundary values of the feasible domain, which must be checked when the interval is closed.

A five-step setup routine

Use the same routine every time. First, draw a picture and label every quantity with a letter. Second, name the objective: what exactly is being made as large or as small as possible. Third, write the primary equation for that objective. Fourth, write the constraint and use it to eliminate all but one variable. Fifth, state the domain, then decide what the endpoints mean.

Two variables will usually appear in your primary equation. Because calculus here handles one variable at a time, the constraint is the tool that removes the second one. If there is no constraint, the problem usually has a hidden one, such as a given volume or a given amount of material.

When different parts cost different amounts, multiply each part's area by its price per unit area before adding; the objective is then a cost (here in cents), not an area.

Common optimization setups
SituationObjectiveConstraintFunction of one variable
Rectangle with 240 m of fence on three sidesA=xyA=xy2x+y=2402x+y=240A(x)=x(240−2x)A(x)=x(240-2x)
Open box from a 12 in by 12 in sheet, squares of side x cut outV=x(12−2x)2V=x(12-2x)^2Built into the pictureV(x)=x(12−2x)2V(x)=x(12-2x)^2
Closed can of volume 500 cubic cm, least materialS=2πr2+2πrhS=2\pi r^2+2\pi rhπr2h=500\pi r^2h=500S(r)=2πr2+1000rS(r)=2\pi r^2+\frac{1000}{r}
Closed can of volume 500 cubic cm; top and bottom cost 3 cents per square cm, side costs 2 cents per square cmC=3(2πr2)+2(2πrh)C=3(2\pi r^2)+2(2\pi rh)πr2h=500\pi r^2h=500C(r)=6πr2+2000rC(r)=6\pi r^2+\frac{2000}{r}
Closest point on y=xy=\sqrt{x} to (4,0)(4,0)D2=(x−4)2+y2D^2=(x-4)^2+y^2y=xy=\sqrt{x}D2=(x−4)2+xD^2=(x-4)^2+x

Finding the domain

Domain mistakes are common, so give them real attention. Ask what values of your variable are physically possible. Lengths cannot be negative. A cut cannot be larger than half the side of the sheet. If an endpoint produces zero area or zero volume, you can usually still include it in the interval and check it, but it will not be the maximum.

Sometimes the domain is an open interval, like r>0r>0 for a can. There is no largest or smallest radius allowed, so there are no endpoints to test, and you will need a derivative test to justify your answer in 5.11.

Minimizing a distance has a famous shortcut. The distance DD is smallest exactly when D2D^2 is smallest, because the square root only increases. So minimize D2D^2 and skip the radical.

A fully worked example

A farmer has 240 meters of fencing and wants a rectangular pen along a straight river, with no fence on the river side. What dimensions give the largest area?

Setup: let xx be the length of each of the two sides that run away from the river and yy the side parallel to it. The objective is area A=xyA=xy. The constraint is 2x+y=2402x+y=240, so y=240−2xy=240-2x. Substituting gives A(x)=x(240−2x)=240x−2x2A(x)=x(240-2x)=240x-2x^2.

Domain: x≥0x\ge 0, and y≥0y\ge 0 requires 240−2x≥0240-2x\ge 0, so x≤120x\le 120. The domain is [0,120][0,120].

Solve: A′(x)=240−4xA'(x)=240-4x, which is zero at x=60x=60. Compare values: A(0)=0A(0)=0, A(60)=60⋅120=7200A(60)=60\cdot120=7200, and A(120)=120⋅0=0A(120)=120\cdot 0=0. The absolute maximum is 72007200 square meters, at x=60x=60 m and y=120y=120 m. So the pen should be 60 m by 120 m.

How it connects

  • Back to 5.2 and 5.5: the Extreme Value Theorem and the closed-interval method need a closed feasible domain, which is why you determine it.
  • Back to 5.7: when the domain is open, the second derivative test helps you confirm an absolute extremum.
  • Forward to 5.11: you will finish each problem, justify the extremum and answer with units.

Common mistakes

  • Leaving two variables in the function. Use the constraint to eliminate one before differentiating.
  • Skipping the domain. Without it you cannot test endpoints or know whether the critical point is valid.
  • Optimizing the wrong quantity. Reread the last sentence: sometimes the question asks for dimensions, not the maximum value.
  • Using the wrong constraint. If the fence is on three sides, it is 2x+y2x+y, not 2x+2y2x+2y.

How it shows up on the exam

  • A word problem describes a geometric or real-world situation, and you write the objective as a function of one variable with its domain.
  • A multiple-choice question gives several functions and asks which one correctly models the situation, testing the constraint substitution.
  • A free-response part uses a table or graph for a rate or cost and asks you to identify when it is largest or smallest.

Check yourself

  1. For a box with a square base and fixed volume, what are the objective, constraint and one-variable function if you want least material?
  2. Why is minimizing D2D^2 a valid way to minimize DD?
  3. What would the domain be if you cut squares of side xx from a 20 in by 20 in sheet?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.