AP® CALCULUS AB & BC · UNIT 5

Introduction to Optimization Problems

Turn a constraint into a one-variable objective. Use derivatives and feasible endpoints to find the best dimensions, smallest cost, or largest value.

Topic 5.10 study notes4 worked examples · 7 practice questionsUpdated 10 November 2026
Calculus notebook with limit and integral symbols, a compass and pencil on an olive and cream study desk

1. Identify the objective and constraint

An optimization problem asks for the largest or smallest value of a quantity among the choices that satisfy a constraint. In AP Calculus, write the quantity as a function of one variable, then use the derivative and the feasible domain to justify an absolute extremum.

Objective

The quantity you want to maximize or minimize, such as area, surface area, distance, or profit.

Constraint

A relationship or limit that every allowed choice must satisfy, such as a fixed perimeter or a maximum width.

Decision variable

The input you can choose. Define it with units and write the other dimensions in terms of it.

Feasible domain

All input values allowed by the situation. Check which boundaries represent valid choices.

Report the requested inputs and the resulting value separately. For a fencing problem, the best width is an input measured in feet, and the maximum area is an output measured in square feet.

2. Use a seven-step optimization method

  1. Identify the goal. Name the quantity to maximize or minimize. Sketch the setup when it helps identify a relationship.
  2. Define the variables. Assign each variable a meaning and units.
  3. Write the objective. Use a formula for the quantity the question asks you to optimize.
  4. Write the constraint. Use the stated relationship, such as a fixed sum, perimeter, volume, or distance from a boundary.
  5. Reduce to one variable. Substitute using the constraint. Determine the feasible domain from the original problem.
  6. Find and justify the optimum. For an objective f, solve f′(x)=0 in the interior and include feasible interior inputs where the derivative is undefined. Check included endpoints or analyze derivative signs and limits across the domain.
  7. Answer in context. Recover any other dimensions, give units, and check the original constraint.
Use the test that fits the domain.

If the objective is continuous on a closed bounded interval [a,b], an absolute maximum and minimum exist. Evaluate the objective at each interior critical input and at a and b. Compare those values.

On open or unbounded domains, analyze behavior across the whole domain. A change from increasing to decreasing over the two sides of a candidate proves an absolute maximum there. A change from decreasing to increasing over the two sides proves an absolute minimum. A local derivative test alone establishes local behavior.

3. Read the feasible interval on a graph

Both graphs use the area model A(w)=w(100−w) for a garden with 200 feet of fencing. They use the same horizontal and vertical scales. The second garden has a width cap of 40 feet, so its feasible curve stops at that width.

Fence length sets the domain

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 0 25 50 75 100 Width (ft) 0 500 1000 1500 2000 2500 Area (ft²) Max at 50
On 0<w<100, the absolute maximum occurs at w=50. The open circles show limiting areas at excluded widths.

An included width cap

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 0 25 50 75 100 Width (ft) 0 500 1000 1500 2000 2500 Area (ft²) Max at 40
On 0<w≤40, area is still increasing when the feasible interval ends. The filled diamond marks the maximum at w=40.

Determine the feasible interval before choosing a candidate. A derivative of zero inside the unrestricted model can fall outside the domain in a specific situation.

4. Four worked examples

Worked example 1

Maximize area with a fixed perimeter

A farmer has 200 feet of fencing to enclose all four sides of a rectangular garden. Find the dimensions that maximize its area and give the maximum area.

1 · Write the objective and the fence equation

Let ℓ and w be the length and width in feet.

A=ℓw
2ℓ+2w=200

Solving the constraint gives ℓ=100−w. Both sides must be positive, so 0<w<100.

2 · Find the critical width and justify the maximum

A(w)=w(100−w)
A′(w)=100−2w

The derivative is zero at w=50. It is positive for 0<w<50 and negative for 50<w<100. The area rises up to 50 and falls after it, so the maximum is absolute.

The formula extends to the boundaries for comparison. Those limiting cases give zero area.

Area at the critical width and limiting boundaries
Width (ft)Area (ft2)Role
00Excluded boundary
502500Feasible maximum
1000Excluded boundary

3 · Recover the dimensions and area

The constraint gives ℓ=100−50=50. The best dimensions are 50ft by 50ft.

A(50)=2500ft2
Worked example 2

Minimize the surface area of a closed can

A closed cylinder must hold 1000cm3. Find the radius and height that minimize its total surface area.

1 · Use the fixed volume to find the height

Let r and h be the radius and height in centimeters. The volume condition makes h a function of r.

πr2h=1000
h=1000πr2

Every r>0 gives a positive height.

2 · Write the surface area as one function

The two circular ends contribute 2πr2. The side contributes 2πrh.

S(r)=2πr2+2000r
S′(r)=4πr−2000r2

3 · Solve and check both sides of the candidate

Set S′(r)=0. Multiplying by r2 gives 4πr3=2000.

r3=500π
r=500π3

The sign of S′ is the sign of 4πr3−2000 because r2>0. The surface area decreases before this radius and increases after it throughout the feasible domain. This gives the absolute minimum.

4 · Recover the height from the volume constraint

Use the cubic relation πr3=500 to simplify the height.

h=1000rπr3=2r

The radius is about 5.42cm and the height is about 10.84cm. At the minimum, the height equals the diameter.

Surface area versus radius

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 2 4 6 8 10 Radius (cm) 500 700 900 1100 1300 Surface area (cm²) Minimum
The curve shown is a portion of r>0. The marked minimum is where the derivative changes from negative to positive.
Worked example 3

Maximize a product with a fixed sum

Find the two positive numbers whose sum is 60 and whose product is as large as possible.

1 · Use the fixed sum

If the first number is x, the second is 60−x. Positivity gives 0<x<60.

P(x)=x(60−x)

This is the same fixed-sum structure as the rectangular garden. Each factor is positive and one falls as the other rises.

2 · Read the signs across the whole interval

P′(x)=60−2x

The derivative is positive before 30 and negative after 30 on the feasible interval. The absolute maximum occurs at x=30.

3 · State both numbers and their product

The second number is also 30, so the largest product is 900.

Product versus the first number

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 0 15 30 45 60 First number 0 300 600 900 Product Maximum
The vertex occurs when the two numbers are equal. Open circles mark the excluded cases with one factor equal to zero.
Worked example 4

Maximize area with a width cap

Use the 200-foot fence again. The site can accommodate a width of at most 40 feet. Find the best dimensions.

1 · Restrict the domain

The area formula is still A(w)=w(100−w), and now 0<w≤40. A width of 40 feet is permitted.

2 · Check the sign of the derivative on that domain

A′(w)=100−2w

This derivative is positive throughout the interior of the feasible interval. The area increases up to the included endpoint w=40.

3 · Evaluate the included endpoint

The length is 60ft. The dimensions 40ft by 60ft give the largest feasible area.

A(40)=2400ft2

5. Recognize common optimization models

How a constraint reduces a model
SituationObjective and constraint
Fixed fenceMaximize A=ℓw. A perimeter equation gives one side in terms of the other.
Fixed volumeMinimize surface area. Use the volume equation to eliminate the height.
Profit or revenueRevenue is price times quantity, R=px. For profit use P=R−C and express price and cost in terms of quantity.
Closest pointUse the curve equation to write both coordinates with one input, then minimize squared distance.
Inscribed shapeUse a geometric relationship to express height in terms of width. Common constraints come from circles and similar triangles.
Time or costFor a constant-speed leg use t=dv. Express the distances using the route constraint.
Squared distance preserves the minimizing point.

Distance is nonnegative, and squaring preserves the order of nonnegative numbers. Minimizing squared distance therefore gives the same closest point and often a simpler derivative.

6. Use the geometry formulas

Geometry used in introductory optimization
ShapeUseful formulas
RectangleA=ℓw
P=2ℓ+2w
CircleA=πr2
C=2πr
TriangleA=12bh
P=a+b+c
Closed boxV=ℓwh
S=2ℓw+2ℓh+2wh
Closed cylinderV=πr2h
S=2πr2+2πrh
SphereV=43πr3
S=4πr2
Cone with baseV=13πr2h
S=πr2+πrℓ, with slant height ℓ

For a container, count the faces that are present. An open-top box omits the top face from its surface area. For distance between (x1,y1) and (x2,y2), the squared distance is

d2=(x2−x1)2+(y2−y1)2

7. Seven practice questions

1. Product with a sum of twenty

Find two positive numbers with sum 20 and the largest possible product.

Show solution 1

1 · Eliminate the second number

Set P(x)=x(20−x) with 0<x<20. Then P′(x)=20−2x.

2 · Use the derivative sign

The derivative changes from positive to negative at 10, across the whole feasible interval. The two numbers are both 10, giving product 100.

2. Area with a forty-centimeter perimeter

Find the dimensions and maximum area of a rectangle with perimeter 40cm.

Show solution 2

1 · Express the area using the width

The constraint gives ℓ=20−w, so A(w)=w(20−w) on 0<w<20.

2 · Find the peak

A′(w)=20−2w changes from positive to negative at 10. The dimensions are 10cm by 10cm, with area 100cm2.

3. Closest point on a line

Find the point on the line y=2x+1 closest to the origin.

Show solution 3

1 · Use squared distance as the objective

The coordinates are (x,2x+1). The feasible values of x are all real numbers.

D(x)=x2+(2x+1)2
D′(x)=10x+4

2 · Find the minimizing input and recover the point

The derivative changes from negative to positive at x=−25. The closest point is (−25,15).

Closest point and perpendicular segment

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ −2 −1 0 1 2 Horizontal position −1 0 1 2 Vertical position Nearest Origin
The segment joins the origin to the minimizing point. It meets the line at a right angle.

4. Material for an open-top box

A box with a square base and open top must have volume 32000cm3. Find the dimensions that minimize its surface area.

Show solution 4

1 · Count the base and four sides

Let x be the side of the base and h the height, both in centimeters. The volume is x2h=32000, so h=32000x2 for x>0.

S(x)=x2+128000x

2 · Solve the derivative equation

S′(x)=2x−128000x2

Its sign comes from 2x3−128000, which increases through zero at x=40. The area falls and then rises, so the absolute minimum is at this base width. The height is 20cm, and the base is 40cm by 40cm.

5. Fencing along a river

A farmer uses 800 meters of fence for three sides of a rectangle. The river forms the fourth side. Find the dimensions that maximize area.

Show solution 5

1 · Use the correct fence constraint

Let x be the distance perpendicular to the river and y the side parallel to it, in meters. Then 2x+y=800 and 0<x<400.

A(x)=x(800−2x)

2 · Find the dimensions at the maximum

A′(x)=800−4x changes from positive to negative at 200. Use y=800−2x. The best dimensions are 200m perpendicular and 400m parallel, with area 80000m2.

6. Largest rectangle in a semicircle

A rectangle has its base on the diameter of a semicircle of radius 10cm, with its upper corners on the arc. Find the dimensions that maximize its area.

Show solution 6

1 · Use the half-width in the circle equation

Let t be the half-width. The height is 100−t2, and 0<t<10.

A(t)=2t100−t2

2 · Optimize squared area on the feasible interval

The area is positive, so it is largest where its square is largest.

F(t)=4t2(100−t2)
F′(t)=8t(100−2t2)

The derivative switches from positive to negative at t=52. The width is 102cm, and the height is 52cm.

Rectangle at the maximum

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ −10 −5 0 5 10 Horizontal position (cm) 0 5 10 Height (cm) Rectangle
The upper corners lie on the arc. At this optimum the width is twice the height.

7. Minimum poster area

A poster must have 50cm2 of print area. It has 4cm margins at the top and bottom and 2cm margins on each side. Find the total poster dimensions that minimize area.

Show solution 7

1 · Distinguish print dimensions from poster dimensions

If the print width is x>0, the print height is 50x. Add both margins in each direction.

T(x)=(x+4)(50x+8)
T(x)=82+8x+200x

2 · Use the sign change and add the margins back

T′(x)=8−200x2

The derivative is negative for 0<x<5 and positive for x>5. The print area should be 5cm by 10cm. The total poster is 9cm by 18cm.

8. Write an AP-style justification

Show how the constraint produces a one-variable objective. Include the domain, the derivative, and a reason the chosen point is best among all feasible choices. A sign change near a candidate gives a local conclusion. Sign information over the full feasible domain or comparison of all closed-interval candidates gives a global conclusion.

AP-style justification

Make the absolute conclusion explicit

Give the relevant signs

For the 200-foot fence, A′(w)>0 on (0,50) and A′(w)<0 on (50,100).

Use the entire feasible interval

Area increases up to w=50 and decreases afterward throughout 0<w<100. Therefore A(50) is the absolute maximum area, and the constraint gives the other side.

  • Check the units for both the input and the objective. Length, area, and volume use different units.
  • Substitute the final dimensions back into the original constraint.
  • For excluded boundaries, use limits to describe the behavior as the input approaches them.
  • For an integer-only model, compare allowed integer inputs. If the continuous objective rises to one peak and then falls throughout the domain, compare the closest feasible integer on each side of that peak.

9. Frequently asked questions

Can an endpoint give the absolute maximum?

Yes. If the endpoint is included, compare its objective value with the other candidates. The capped garden reaches its largest area at the allowed width 40ft.

What if the derivative is undefined at a feasible input?

If the objective is defined there and the input is interior, it is a critical candidate. Compare its value with the other candidates or check the signs on the surrounding intervals.

Does the Second Derivative Test prove an absolute extremum?

The test classifies local behavior at a stationary input. To establish an absolute extremum, compare all candidates on a closed bounded interval or justify the behavior over the entire feasible domain.

Why check dimensions after finding a critical input?

The input often represents only one dimension. Use the original constraint to recover the others and check that they satisfy the problem.

10. Continue studying calculus

Review the Candidates Test for a closed interval, then use the same setup and justification in the applied problems in Topic 5.11.