Unit 5 · Topic 5.10 Beta

Introduction to Optimization

4 min read · freeNot practiced

Businesses want the most profit, engineers the least material, farmers the most land from a roll of fence. Each of these is a search for an absolute maximum or minimum, which you already know how to find. What is new in optimization is the first step: turning a paragraph of words into a function you can differentiate.

The objective function

The objective function is the quantity you want to make as large or as small as possible, written as a function of one variable. Writing it takes three moves:

  1. Name the quantity. What does the question want largest or smallest? Area, revenue, cost, distance.
  2. Write a formula for it. Often it starts with two variables, like A=xyA = xy.
  3. Use the given facts to reduce it to one variable. A fixed amount of fence, a fixed product, a price rule: solve it for one variable and substitute.

Then find the domain: the values of the variable that make physical sense. Lengths, prices and amounts are not negative.

Left: a rectangular pen against a river, split by a middle fence; the three fences perpendicular to the river have length x, the far side has length y, and 3x + y = 600 feet. Right: the graph of A(x) = x(600 - 3x) for 0 ≤ x ≤ 200, zero at both ends, highest at (100, 30000).
Figure 1. The fence fixes 3x+y=6003x + y = 600. Substituting y=600−3xy = 600 - 3x turns the area into a function of xx alone, on [0,200][0, 200]. LevlPrep original diagram.

Worked example 1. A farmer has 600 feet of fence for a rectangular pen against a straight river, split in two by a middle fence parallel to the ends. No fence goes along the river. Find the largest area.

Quantity: area, A=xyA = xy, with xx the length of each end (and of the divider) and yy the side opposite the river.

Reduce: the fence is 3x+y=6003x + y = 600, so y=600−3xy = 600 - 3x and A(x)A(x)=x(600−3x)= x(600 - 3x)=600x−3x2= 600x - 3x^2.

Domain: x≥0x \ge 0 and y=600−3x≥0y = 600 - 3x \ge 0, so 0≤x≤2000 \le x \le 200.

Critical point: A′(x)=600−6x=0A'(x) = 600 - 6x = 0 at x=100x = 100.

Justify: candidates A(0)=0A(0) = 0, A(100)=30,000A(100) = 30{,}000, A(200)=0A(200) = 0. The largest is A(100)A(100).

Answer in context: ends of 100 feet and a long side of 300 feet give the largest area, 30,000 square feet.

Justifying the answer

Setting A′(x)=0A'(x) = 0 finds a candidate, not an answer. You must show it is the absolute extremum you want. Two ways work:

SituationArgument
Closed domain [a,b][a, b]Candidates Test: compare ff at the endpoints and the critical points.
Any interval, one critical pointThe only critical point is a relative maximum (or minimum), by the First or Second Derivative Test, so it is the absolute one.

Watch for the critical point being the wrong kind. For a shipping cost C(x)=x+16xC(x) = x + \frac{16}{x} on [1,8][1, 8], the critical point x=4x = 4 gives the smallest cost, 8. If the question asks for the largest cost, the answer is at an endpoint: C(1)=17C(1) = 17.

Revenue, a second model

Worked example 2. At a price of pp dollars, a theater sells 1200−40p1200 - 40p tickets, 0≤p≤300 \le p \le 30. What price maximizes revenue?

Objective: revenue = price times tickets, R(p)R(p)=p(1200−40p)= p(1200 - 40p)=1200p−40p2= 1200p - 40p^2.

R′(p)=1200−80p=0R'(p) = 1200 - 80p = 0 at p=15p = 15. Candidates: R(0)=0R(0) = 0, R(15)=9000R(15) = 9000, R(30)=0R(30) = 0.

A price of 15 dollars gives the most revenue, 9000 dollars.

The derivative also has a meaning on its own. R′(10)=400R'(10) = 400 dollars per dollar: at a price of 10 dollars, raising the price by 1 dollar raises revenue by about 400 dollars. A positive R′R' says the best price is higher still.

Numbers and distances

Pure-number problems use the same steps. If two positive numbers add to 20, their product is P(x)=x(20−x)P(x) = x(20 - x); it is largest at x=10x = 10, giving 100. For a distance, minimize the squared distance instead: it is smallest at the same point and has no square root to differentiate. For the point of y=xy = \sqrt{x} nearest (3,0)(3, 0), minimize D(x)=(x−3)2+xD(x) = (x - 3)^2 + x: D′(x)=2x−5=0D'(x) = 2x - 5 = 0 at x=52x = \frac{5}{2}, and the distance is D(52)=112\sqrt{D\left(\frac{5}{2}\right)} = \frac{\sqrt{11}}{2}. Remember to take the square root at the end.

Answer the question asked

The final line should answer in the problem's words and units: "100 feet by 300 feet, for 30,000 square feet," not "x=100x = 100." If the question asks for dimensions, give all of them; if it asks for the maximum value, give the value, not where it happens.

Spot a mistake on this page?