AP Calculus AB and BC

Optimization Cheat Sheet: Steps and Justifications

To solve an optimization problem, write the quantity to maximize or minimize as a function of one variable, state its domain, find the critical points, and justify the result. On a closed interval use the candidates test. On an open interval show the sign of the first or second derivative across the whole domain.

The steps

  1. Name the quantity to maximize or minimize and write a formula for it. This is the objective function.
  2. Write the constraint, the equation that links the variables.
  3. Solve the constraint for one variable and substitute, so the objective has a single variable.
  4. State the domain: the interval of values that make physical sense.
  5. Differentiate the objective and find the critical points inside the domain.
  6. Justify that the critical point gives the maximum or minimum, using one of the methods in the next table.
  7. Answer the question that was asked, with units. A problem may ask for the dimensions, the optimal value, or both.

Setup is taught step by step in optimization problems, and the optimization setup builder gives practice on steps 1 through 4.

Justification methods

MethodWhat you needConclusionUse it when
First derivative test (Topic 5.4)f′f' changes from positive to negative at ccRelative maximum at cc. A change from negative to positive gives a relative minimum.The sign of f′f' is easy to read on each side of cc.
First derivative sign on the whole domainff continuous, f′(x)>0f'(x) > 0 for all x<cx < c in the domain, and f′(x)<0f'(x) < 0 for all x>cx > c in the domainAbsolute maximum at cc. Reversed signs give an absolute minimum.The domain is an open or infinite interval.
Second derivative test (Topic 5.7)f′(c)=0f'(c) = 0 and f′′(c)<0f''(c) < 0Relative maximum at cc. If f′′(c)>0f''(c) > 0, relative minimum. If f′′(c)=0f''(c) = 0, no conclusion.f′′f'' is easy to compute.
Concavity on the whole domainf′(c)=0f'(c) = 0 and f′′(x)<0f''(x) < 0 for every xx in the domainAbsolute maximum at cc. With f′′(x)>0f''(x) > 0 throughout, absolute minimum.f′′f'' has one sign on the entire interval.
Candidates test (Topic 5.5)ff continuous on a closed interval [a,b][a, b]Evaluate ff at every critical point in (a,b)(a, b) and at both endpoints. The largest value is the absolute maximum and the smallest is the absolute minimum.The domain is a closed interval.
Only one critical pointff continuous on an interval with exactly one critical point cc, which is a relative maximumf(c)f(c) is the absolute maximum on that interval. The same holds for a minimum.The interval is open and there is a single critical point.

A relative extremum is not automatically an absolute one. The second derivative test at a single point proves a relative extremum only, so pair it with the single critical point argument or with concavity on the whole domain. The underlying tests are in the first derivative test and second derivative test guides.

Common objective and constraint setups

ProblemObjectiveConstraintOne-variable function and result
Rectangle with fixed perimeter PP, largest areaA=xyA = xy2x+2y=P2x + 2y = PA(x)=x(P2−x)A(x) = x\left(\frac{P}{2} - x\right). Maximum at x=P4x = \frac{P}{4}, a square.
Rectangular pen against a wall, three fenced sides, fencing LLA=xyA = xy2x+y=L2x + y = LA(x)=x(L−2x)A(x) = x(L - 2x). Maximum at x=L4x = \frac{L}{4} and y=L2y = \frac{L}{2}.
Open box from a square sheet of side ss, corner squares of side xx removedV=x(s−2x)2V = x(s - 2x)^2Built into the formulaDomain 0<x<s20 < x < \frac{s}{2}. Maximum at x=s6x = \frac{s}{6}.
Closed box with square base, fixed volume VV, least surface areaS=2x2+4xhS = 2x^2 + 4xhx2h=Vx^2 h = VS(x)=2x2+4VxS(x) = 2x^2 + \frac{4V}{x}. Minimum at x=V3x = \sqrt[3]{V}, a cube.
Open-top box with square base, fixed volume VV, least surface areaS=x2+4xhS = x^2 + 4xhx2h=Vx^2 h = VS(x)=x2+4VxS(x) = x^2 + \frac{4V}{x}. Minimum at x=2V3x = \sqrt[3]{2V}, where h=x2h = \frac{x}{2}.
Closed cylinder, fixed volume VV, least surface areaS=2πr2+2πrhS = 2\pi r^2 + 2\pi r hπr2h=V\pi r^2 h = VS(r)=2πr2+2VrS(r) = 2\pi r^2 + \frac{2V}{r}. Minimum at r=V2π3r = \sqrt[3]{\frac{V}{2\pi}}, where h=2rh = 2r.
Rectangle inscribed in a semicircle of radius RR, largest areaA=2xyA = 2xyx2+y2=R2x^2 + y^2 = R^2A(x)=2xR2−x2A(x) = 2x\sqrt{R^2 - x^2}. Maximum at x=R2x = \frac{R}{\sqrt{2}}, with area R2R^2.
Point on y=f(x)y = f(x) closest to (a,b)(a, b)D2=(x−a)2+(f(x)−b)2D^2 = (x - a)^2 + (f(x) - b)^2The point lies on the curveMinimize D2D^2 instead of DD. Both are smallest at the same xx.
Maximum profitP(x)=R(x)−C(x)P(x) = R(x) - C(x)NoneCritical points where R′(x)=C′(x)R'(x) = C'(x).

The results in the last column are worth recognizing, but a written solution still needs the derivative, the critical point, and a justification.

Domain and endpoints

DomainAbsolute extremum guaranteedHow to finish
Closed interval [a,b][a, b], ff continuousYes, by the Extreme Value TheoremCandidates test. Include both endpoints in the comparison.
Open or infinite interval, one critical pointNoShow the sign of f′f' on each side across the whole domain, or show f′′f'' has one sign throughout.
Open or infinite interval, several critical pointsNoCompare the values at the critical points with the limits of ff at the ends of the interval.
  • Endpoints often correspond to a degenerate shape, such as a box with zero height. They are still candidates on a closed interval.
  • If a critical point falls outside the domain, discard it. If no critical point is left inside a closed interval, both absolute extrema are at the endpoints.
  • The Extreme Value Theorem needs continuity on a closed interval. See the Extreme Value Theorem.

Common slips

  • Differentiating an objective that still has two variables. Use the constraint first.
  • Swapping the objective and the constraint. The objective is the quantity being maximized or minimized. The constraint is the fixed total.
  • Stopping at the critical point without justifying that it is a maximum or minimum.
  • Claiming an absolute extremum from f′′(c)<0f''(c) < 0 alone on a domain with more than one critical point.
  • Ignoring endpoints on a closed interval.
  • Answering with the xx-value when the question asks for the maximum area, or the reverse.

Worked examples

Worked example

Least material for a can

A closed cylindrical can must hold 54π cm354\pi\ \text{cm}^3. Find the radius and height that minimize its surface area.

  1. Objective: S=2πr2+2πrhS = 2\pi r^2 + 2\pi r h. Constraint: πr2h=54π\pi r^2 h = 54\pi, so h=54r2h = \frac{54}{r^2}.
  2. One variable: S(r)=2πr2+2πr⋅54r2=2πr2+108πrS(r) = 2\pi r^2 + 2\pi r \cdot \frac{54}{r^2} = 2\pi r^2 + \frac{108\pi}{r}, with domain r>0r > 0.
  3. Differentiate: S′(r)=4πr−108πr2S'(r) = 4\pi r - \frac{108\pi}{r^2}. Set S′(r)=0S'(r) = 0: 4πr3=108π4\pi r^3 = 108\pi, so r3=27r^3 = 27 and r=3r = 3.
  4. Justify: S′′(r)=4π+216πr3S''(r) = 4\pi + \frac{216\pi}{r^3}, which is positive for every r>0r > 0. The graph of SS is concave up on its whole domain, so the critical point r=3r = 3 gives the absolute minimum.
  5. Height: h=5432=6h = \frac{54}{3^2} = 6. Surface area: S(3)=18π+36π=54πS(3) = 18\pi + 36\pi = 54\pi.

Radius 33 cm and height 66 cm, for a minimum surface area of 54π cm254\pi\ \text{cm}^2.

Worked example

Candidates test on a closed interval

Find the absolute maximum and minimum values of f(x)=x3−3x2−9x+5f(x) = x^3 - 3x^2 - 9x + 5 on [−2,6][-2, 6].

  1. ff is a polynomial, so it is continuous on [−2,6][-2, 6] and the Extreme Value Theorem guarantees both extrema.
  2. Critical points: f′(x)=3x2−6x−9=3(x−3)(x+1)f'(x) = 3x^2 - 6x - 9 = 3(x - 3)(x + 1), which is zero at x=−1x = -1 and x=3x = 3. Both are inside the interval.
  3. Evaluate at the endpoints and critical points: f(−2)=−8−12+18+5=3f(-2) = -8 - 12 + 18 + 5 = 3, f(−1)=−1−3+9+5=10f(-1) = -1 - 3 + 9 + 5 = 10, f(3)=27−27−27+5=−22f(3) = 27 - 27 - 27 + 5 = -22, f(6)=216−108−54+5=59f(6) = 216 - 108 - 54 + 5 = 59.
  4. Compare the four values: the largest is 5959 and the smallest is −22-22.

The absolute maximum is 5959 at x=6x = 6 (an endpoint) and the absolute minimum is −22-22 at x=3x = 3.

Worked example

Closest point on a curve

Find the point on the curve y=xy = \sqrt{x} that is closest to the point (4,0)(4, 0).

  1. Distance squared from (x,x)(x, \sqrt{x}) to (4,0)(4, 0): g(x)=(x−4)2+(x)2=(x−4)2+xg(x) = (x - 4)^2 + (\sqrt{x})^2 = (x - 4)^2 + x, with domain x≥0x \geq 0.
  2. Differentiate: g′(x)=2(x−4)+1=2x−7g'(x) = 2(x - 4) + 1 = 2x - 7. Set g′(x)=0g'(x) = 0: x=72x = \frac{7}{2}.
  3. Justify: g′(x)<0g'(x) < 0 for 0≤x<720 \leq x < \frac{7}{2} and g′(x)>0g'(x) > 0 for x>72x > \frac{7}{2}, so gg decreases and then increases across its whole domain. The absolute minimum is at x=72x = \frac{7}{2}.
  4. The point is (72,72)\left(\frac{7}{2}, \sqrt{\frac{7}{2}}\right). The minimum distance is g(72)=14+72=154=152\sqrt{g\left(\frac{7}{2}\right)} = \sqrt{\frac{1}{4} + \frac{7}{2}} = \sqrt{\frac{15}{4}} = \frac{\sqrt{15}}{2}.

The closest point is (72,72)\left(\frac{7}{2}, \sqrt{\frac{7}{2}}\right), at distance 152≈1.94\frac{\sqrt{15}}{2} \approx 1.94.

Frequently asked questions

What is the difference between the objective function and the constraint?

The objective function is the quantity you are asked to make as large or as small as possible, such as area, volume, cost, or distance. The constraint is an equation that limits the variables, such as a fixed amount of fencing or a required volume. You use the constraint to rewrite the objective in one variable.

When do I need to check the endpoints?

Whenever the domain is a closed interval. The absolute maximum or minimum of a continuous function on [a,b][a, b] occurs at a critical point or at an endpoint, so both endpoints belong in the comparison. On an open interval there are no endpoints to evaluate, and you justify the answer with the sign of f′f' or f′′f'' across the domain.

Is the second derivative test enough to justify an absolute maximum?

On its own it shows only a relative maximum at that point. It becomes an absolute maximum argument when you add one more fact: either the function is continuous with only one critical point on the interval, or f′′(x)<0f''(x) < 0 on the entire domain so the graph is concave down everywhere.