Chalk−1

Math · Calculus I · Concept

Optimization problems in calculus

To solve an optimization problem, write the quantity to maximize or minimize as a function of one variable, using the constraint to remove any other variable. Find the critical points where the derivative is zero, then compare the function’s values there and at the endpoints of the allowed interval.

Try one — Chalk checks each line

A concrete case

Try some fields first

A farmer has 240 m of fence for a rectangular field beside a straight river. The river side needs no fence. The fence runs out from the river a distance x, along it a distance y, and back, so 2⁢x+y=240.

Try a few depths. A depth of 20 m leaves 200 m for the long side, an area of 4000 m2. A depth of 40 m leaves 160 m and an area of 6400 m2. The table carries on. The area climbs, peaks and falls back to 0, because a very deep field is also very narrow.

The areas at 40 m and 80 m are both 6400 m2, less than at 60 m, so the peak lies somewhere between 40 and 80. The table can’t say exactly where. Calculus finds it, by looking for the depth where the area stops rising and starts to fall.

The area for some depths, with 240 m of fence
Depth x (m)Long side y =240−2⁢x (m)Area x⁢y (m2)
202004000
401606400
601207200
80806400
100404000
12000

The rule

The largest and smallest values on an interval

An optimization problem asks for the largest or smallest value of a quantity. Once the quantity is written as a function f of one variable, the question becomes where f is largest or smallest on the interval of allowed inputs.

The Extreme Value Theorem says that a function continuous on a closed interval [a,b] has a largest value and a smallest value there. These are its absolute maximum and absolute minimum. Each one occurs either at an endpoint, a or b, or at a critical point inside the interval. A critical point is an input c where f′(c)=0 or f′(c) does not exist.

That gives the closed interval method. List the critical points inside [a,b], work out f at each of them and at both endpoints, and compare. The largest value is the maximum and the smallest is the minimum.

candidates: ⁢x=a,x=b,x=c with f′(c)=0 or undefined
candidates: ⁢x=a,x=bx=c with f′(c)=0 or undefined

When the interval has no endpoints

Some problems have no endpoints to test. A can’s radius can be any positive number, so its interval is r>0. On an interval like this, a largest or smallest value may not exist at all.

When f has only one critical point c in the interval, the sign of f′ settles the question. If f′ is negative to the left of c and positive to the right, f falls and then rises, so f⁡(c) is the absolute minimum. If f′ changes from positive to negative, f⁡(c) is the absolute maximum.

The second derivative gives the same verdict for a single critical point. f′⁢′(c)>0 means the graph is concave up at c, a valley. f′⁢′(c)<0 means it is concave down, a peak.

f′′(c)>0 ⇒ minimumf′′(c)<0 ⇒ maximum
f′′(c)>0 ⇒ minimumf′′(c)<0 ⇒ maximum

Why it works

Why the top of the curve is flat

Suppose the area is largest at a depth c strictly between the ends, and the slope there is positive. Then a slightly deeper field would have a larger area, and c was not the maximum after all. If the slope were negative, a slightly shallower field would be larger. The only slope left at an inside maximum is 0, unless the graph has a corner there and no slope at all.

At an endpoint this argument fails, because there is no room to step past the end. At x=0 the slope is A′(0)=240, steeply upward, yet A⁢(0)=0 is the smallest area, not the largest. The field can’t be shallower than 0, so nothing to the left can beat it. That is why both endpoints join the list of candidates.

The same reasoning works for a minimum. Every candidate on the list is a place where stepping sideways can’t prove that a better value exists.

A′(x)=240−4⁢x=0⟹x=60

The method

The method in six steps

Every optimization problem follows the same six steps. The table works through the fence. Write each step down, because the derivative is rarely the hard part. Choosing the variable, using the constraint and stating the interval are where most answers go wrong.

A⁢(x)=x⁢(240−2⁢x)=240⁢x−2x2,0≤x≤120
A⁢(x)=x⁢(240−2⁢x)=240⁢x−2x20≤x≤120
The six steps on the fenced field
StepWhat to doFor the fence
1Draw the situation and name each quantitydepth x, long side y, area A
2Write the quantity to optimizeA=x⁢y
3Use the constraint to leave one variabley =240−2⁢x, so A⁢(x) =240⁢x−2x2
4State the interval the variable can take0 ≤x ≤120
5Find the critical points and test the candidatesA′(x) =0 at x=60, and A⁢(60) =7200 beats A⁢(0) =A⁢(120) =0
6Answer the question asked, with units60 m deep and 120 m long, enclosing 7200 m2

Testing the candidates

Step 5 depends on the interval. On a closed interval, work out the function at every critical point and at both endpoints, and compare the values. Nothing else is needed.

On an open or endless interval, there are no endpoints to compare. With one critical point, use the sign of f′ on each side or the sign of f′⁢′ at the point. With several, compare their values and also see what f does near the ends of the interval, for example as r approaches 0 or grows without bound.

Where it breaks

Where it breaks

The closed interval method needs a continuous function on a closed interval. Without both, a maximum or minimum can fail to exist. On 0<x≤1 the function 1⁢/⁢x grows without bound as x approaches 0, so it has no maximum. A can holding 1 L has a least possible surface area but no greatest one. A very thin can or a very wide one needs as much metal as you like.

A zero derivative makes a candidate, not an answer. f⁡(x)=x3 has f′(0)=0, yet f keeps rising through 0, so x=0 is neither a maximum nor a minimum. On [−1,2] the maximum of x3 is f⁡(2)=8, at an endpoint.

A critical point outside the allowed interval is not a candidate. A negative length, or a cut wider than the sheet of cardboard, is not a real design, however neatly it solves f′=0.

The method treats the variable as able to take every value in its interval. When it must be a whole number, such as a number of trucks, the calculus answer may land between two whole numbers. Work out f at the whole number on each side and compare.

Check your answer

Check your answer

A maximum has to beat its neighbors, obey the constraint and sit inside the interval.

Try the neighbors. For the fence, A⁢(59)=59×122=7198 and A⁢(61)=61×118=7198. Both are less than A⁢(60)=7200, as a maximum requires.

Check the constraint and the units. A field 60 m deep and 120 m long uses 60+120+60=240 m of fence, and its area is in square meters.

Look at the extremes. A depth of 0 or of 120 m encloses nothing, so a maximum strictly between them makes sense. An answer at an extreme, or outside the interval, is a reason to look again.

To have Chalk check the work, write it in a Math box. Put the function on the first row, such as A⁢(x)=x⁢(240−2⁢x), with A′(x)=240−4⁢x below it, then the values A′(60)=0 and A⁢(60)=7200. The Checker marks each row ✓ or ✗ against the function on the first row. It checks the derivative and every value you work out. It does not decide which candidate is the maximum, and it does not check how you used the constraint. Those two steps are yours.

On [0,3], f⁡(x)=∣⁢x−1⁢∣+2 has no point where f′=0. Where is its smallest value?

At x=1, where f⁡(1)=2. The slope is −1 to the left of 1 and 1 to the right, so f′(1) does not exist, and a point with no derivative is a candidate too. The endpoints give f⁡(0)=3 and f⁡(3)=4, so 4 is the maximum. A search for f′=0 alone finds no candidate inside.

Why a near miss costs so little

Expand the area around the best depth. Substituting x=60+h into 240⁢x−2x2 gives A⁢(60+h)=7200−2h2. A depth that misses by 1 m loses only 2 m2, and one that misses by 3 m loses 18 m2. Near a maximum the graph is flat, so the loss grows with the square of the miss. A design close to its optimum barely suffers from small errors in its measurements.

The Extreme Value Theorem is harder to prove than it looks. Its proof rests on the completeness of the real numbers, the fact that the number line has no gaps. On the rational numbers alone it fails. There, −(x2−2)2 on 1≤x≤2 comes as close to 0 as you like but never reaches it, because 2 is not rational.

Solving the constraint for one variable stops working when the constraint can’t be solved neatly, such as a point confined to an ellipse. Multivariable calculus handles that case with a method called Lagrange multipliers.

A⁢(60+h)=7200−2h2

Common mistakes

  • Differentiating before using the constraint. With A=x⁢y, treating y as a constant gives A′=y, which says nothing useful. Substitute y=240−2⁢x first, so that A⁢(x)=240⁢x−2x2 has one variable and A′(x)=240−4⁢x.
  • Forgetting the endpoints. On [0,3], f⁡(x)=x3−3⁢x has its only critical point at x=1, where f⁡(1)=−2 is the minimum. The maximum is f⁡(3)=18, at an endpoint, which a search for f′=0 alone never finds.
  • Keeping a critical point outside the interval. On [0,3], f⁡(x)=x3−12⁢x has f′(x)=0 at x=2 and at x=−2. Counting x=−2, where f⁡(−2)=16, reports a value the interval never reaches. The true maximum is f⁡(0)=0.
  • Answering a different question. The fence problem asks for dimensions, so x=60 is half an answer. The full answer is 60 m deep and 120 m along the river, which encloses 7200 m2.
  • Taking f′(c)=0 as proof of a maximum. The can’s surface area has S′(r)=0 at r≈5.42 cm, and that point is the minimum. Check the sign of f′ on each side, or the sign of f′⁢′, before naming it.

Key terms

Optimization
Finding the largest or smallest value of a quantity, often under a constraint. In calculus the candidates are the critical points inside the allowed interval and its endpoints.
Critical point
A point in the function’s domain where the derivative is zero or doesn’t exist. Local maxima and minima can happen only at critical points or endpoints, so these are where to look.
Extremum
A maximum or minimum value. A local extremum is highest or lowest among nearby values. An absolute extremum is highest or lowest over the whole domain, and it can sit at an endpoint of the domain, where the graph stops rather than turns.
Second derivative test
At a critical point c with f′(c)=0, f′⁢′(c)<0 gives a local maximum and f′⁢′(c)>0 a local minimum. If f′⁢′(c)=0 the test gives no answer, and the first derivative test decides.
Derivative
The instantaneous rate of change of a function: the limit of the average rate of change as the step shrinks to zero, when that limit exists. On a graph it is the slope of the tangent line.

Work through an example

A farmer has 240 m of fencing to enclose a rectangular field along a straight river, with no fence on the river side. What dimensions give the largest area?

Maximize the area of a fenced field →

Minimize the surface area of a can →

Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Graph the area in Graph Check each step in Math See the zero slope in Secant → Tangent Study the 5 key terms Open worked example on a board Optimization candidates in Math Reference

Your existing work stays on this device. Examples open as editable copies.