What Are Optimization Problems?
Optimization problems ask you to find the largest or smallest possible value of some quantity under a set of constraints. In calculus, that quantity is modeled by a function, and the maximum or minimum is found using derivatives.
Real-world optimization questions sound like this: "A farmer has 400 feet of fence and wants to enclose the largest possible rectangular area. What dimensions should she use?" or "A company needs to design a cylindrical can of volume 355 mL using the least material possible. What radius and height minimize surface area?"
In every case the workflow is the same: (1) identify the quantity to maximize or minimize, (2) express it as a function of one variable using the constraint, and (3) use derivatives to find the critical points.
This turns a continuous question ("what's the largest area?") into an algebraic one ("where does the derivative equal zero?").
Optimization is the most practical topic in a first calculus course — it's the reason engineers, economists, and data scientists still rely on calculus every day. Once you have the method down, solving these problems becomes methodical rather than mysterious.
The 6-Step Method
Every optimization problem can be solved with the same six-step procedure. Memorize it and you'll be able to tackle any problem with confidence.
- Draw a picture and label variables
A clear diagram makes setting up the problem ten times easier. Label every dimension with a variable.
- Identify the quantity to optimize
Read the question carefully: is it area, volume, cost, distance, time? This is the quantity you will turn into a function, called the objective function.
- Write the objective function in terms of the variables
It will usually have more than one variable at this stage — don't worry.
- Use the constraint to reduce to one variable
The problem will always give a constraint (fixed perimeter, fixed volume, a side relationship, etc.). Solve the constraint for one variable and substitute into the objective function so it depends on only one variable.
- Differentiate and find critical points
Compute the derivative, set it equal to zero, and solve. Also check the endpoints of the domain if the variable is restricted to an interval.
- Verify the critical point is a max or min
Use the first or second derivative test, or check the values at the endpoints and critical points. Finally, answer the question that was actually asked: state dimensions, not just the value of the variable.
Following this procedure religiously will catch about 90% of the mistakes students typically make.
Fencing / Area Optimization
Classic problem: A farmer has 400 feet of fence and wants to enclose a rectangular field with the largest possible area. What dimensions should he use?
Step 1 — Picture: Draw a rectangle with width w and length l.
Step 2 — Objective: Maximize area A = w · l.
Step 3 — Constraint: The total fence is the perimeter: 2w + 2l = 400, so w + l = 200.
Step 4 — Reduce to one variable: From the constraint, l = 200 − w. Substitute: A(w) = w(200 − w) = 200w − w². The domain is 0 < w < 200.
Step 5 — Differentiate: A'(w) = 200 − 2w. Set equal to zero: 200 − 2w = 0, so w = 100.
Step 6 — Verify: A''(w) = −2 < 0, so w = 100 is a local max. Since it is the only critical point and the endpoints give A = 0, it is the absolute max. Then l = 200 − 100 = 100.
100 ft × 100 ft square, area = 10,000 ft²Variant — fence against a river
If one side needs no fence, the constraint becomes w + 2l = 400. Substituting and optimizing gives l = 100, w = 200, with area 20,000 ft² — double the enclosed area.
l = 100, w = 200, area = 20,000 ft²This variant shows how the constraint completely changes the optimal shape.
Box with Maximum Volume
Classic problem: A rectangular sheet of cardboard is 12 inches by 18 inches. Equal squares are cut from each corner and the sides are folded up to form an open-top box. What size square should be cut to maximize the volume?
Step 1 — Picture: Draw the flat sheet and mark the corner squares with side length x. When folded, the box has length 18 − 2x, width 12 − 2x, and height x.
Step 2 — Objective: Maximize volume V = (18 − 2x)(12 − 2x)(x).
Step 3 — Constraint: The domain is 0 < x < 6 (otherwise width or length becomes zero or negative).
Step 4 — Simplify the objective: Expand (18 − 2x)(12 − 2x) = 216 − 36x − 24x + 4x² = 216 − 60x + 4x². Multiply by x: V(x) = 216x − 60x² + 4x³.
Step 5 — Differentiate: V'(x) = 216 − 120x + 12x². Set equal to zero: 12x² − 120x + 216 = 0, or x² − 10x + 18 = 0. Use the quadratic formula: x = (10 ± √(100 − 72))/2 = (10 ± √28)/2 = 5 ± √7. Numerically, x ≈ 2.354 or x ≈ 7.646. The second root is outside the domain, so we take x ≈ 2.354 inches.
Step 6 — Verify: The second derivative V''(x) = −120 + 24x is negative at x ≈ 2.354, confirming a maximum.
x ≈ 2.354 in, V ≈ 228.16 in³Writing down every expansion step — especially when cubing — is the best way to avoid algebra errors on this classic problem.
Minimum Distance Problems
Classic problem: Find the point on the parabola y = x² closest to the point (3, 0).
Step 1 — Picture: Sketch the parabola and mark the point (3, 0) on the x-axis.
Step 2 — Objective: Minimize the distance from (x, y) = (x, x²) to (3, 0). The distance is D = √((x − 3)² + (x² − 0)²) = √((x − 3)² + x⁴).
Step 5 — Differentiate: f'(x) = 2(x − 3) + 4x³. Set equal to zero: 2x − 6 + 4x³ = 0, or 4x³ + 2x − 6 = 0, or 2x³ + x − 3 = 0. Notice that x = 1 is a solution: 2(1) + 1 − 3 = 0. ✓ Factor: 2x³ + x − 3 = (x − 1)(2x² + 2x + 3). The quadratic factor has discriminant 4 − 24 = −20 < 0, so there are no other real roots. The only critical point is x = 1.
Step 6 — Verify: f''(x) = 2 + 12x², which is always positive, so x = 1 is a minimum.
(1, 1), D = √5 ≈ 2.236Simplification trick: Minimizing D is equivalent to minimizing D² = (x − 3)² + x⁴. Squaring removes the square root and dramatically simplifies the derivative without changing where the minimum occurs — because the square root is monotonic. Use f(x) = D² = (x − 3)² + x⁴.
The squaring trick is standard for minimum-distance problems and should become automatic with practice.
Tips for Setting Up Equations
Most students who lose points on optimization problems do so in the setup, not the calculus. Here are the tips that matter most.
Even if the problem is algebraic, a diagram forces you to slow down and identify every variable. A mislabeled side is almost always a silent error that ruins the answer.
Don't try to combine them in your head. Writing P = 2w + 2l = 400 on one line and A = w · l on another makes substitution mechanical and reduces mistakes.
Optimization problems have physical domains (lengths must be positive, for example). If the critical point lies outside the domain, the maximum or minimum is at an endpoint. Students forget this regularly on exams.
It's usually the fastest way to confirm whether a critical point is a max or a min. If f'' at the critical point is negative, you have a local max; if positive, a local min.
If the problem asks for dimensions, give the dimensions. If it asks for the maximum area, give the area. Students often stop after finding the critical variable and forget to finish.
Plug in the endpoints of the domain and compare to the critical point value. If the critical point doesn't beat the endpoints, then the extremum is at an endpoint, not the interior.
Most exam optimization problems are variations of fencing, open-top boxes, cylindrical cans, and minimum distance. Recognizing the pattern gives you an instant head start.
If you want to check your setup or verify a tricky optimization problem, scan it with Solver AI for a complete step-by-step walkthrough.