This site is a work in progress. New lessons are added regularly. Contact us

Quadratic Optimization

Learning goals

  • Locate the best value at the vertex x=b2ax = -\tfrac{b}{2a}
  • Read the sign of aa to tell a maximum from a minimum
  • Separate where the best occurs from how good it is
  • Model a problem as a quadratic, then answer what was asked
  • Apply it to fixed perimeter, revenue and projectile height

Why the vertex is the best value

Take any quadratic quantity written as y=ax2+bx+cy = ax^2 + bx + c. From the parabola lesson you can find its vertex in two moves: the input is

x=b2a,x = -\frac{b}{2a},

and the value there is whatever you get by substituting that xx back into the equation. If the quadratic is already in vertex form y=a(xh)2+ky = a(x - h)^2 + k, it is even quicker, because the vertex is (h,k)(h, k). The value kk at the vertex is then sitting right in front of you.

Which of the two, a maximum or a minimum, you have found is decided entirely by the sign of aa. A positive aa opens the parabola upward into a valley, so the vertex is the lowest point and yy has a minimum there. A negative aa opens it downward into a hill, so the vertex is the highest point and yy has a maximum. There is no separate rule to memorize for word problems. Instead, read the sign of the leading coefficient, and you know whether the vertex is a floor or a ceiling.

Why the vertex holds the largest or smallest value#

Write the quadratic in vertex form by completing the square, y=a(xh)2+ky = a(x - h)^2 + k, where the vertex is (h,k)(h, k). Everything hangs on the squared piece (xh)2(x - h)^2. A square is never negative, so (xh)20(x - h)^2 \ge 0, and it equals 00 at exactly one input, x=hx = h.

Suppose a>0a > 0. Multiplying a nonnegative number by a positive number keeps it nonnegative, so a(xh)20a(x - h)^2 \ge 0, and therefore

y=a(xh)2+kk.y = a(x - h)^2 + k \ge k.

The value yy can never dip below kk, and it actually reaches kk only when the square is 00, that is at x=hx = h. So kk is the smallest value the quadratic ever takes: a minimum, occurring at the vertex.

Now suppose a<0a < 0. Multiplying a nonnegative number by a negative number makes it nonpositive, so a(xh)20a(x - h)^2 \le 0, and therefore yky \le k. This time yy can never rise above kk, and it reaches kk only at x=hx = h, so kk is the largest value: a maximum, again at the vertex.

Either way the extreme value is kk, the height of the vertex, and it is reached at the single input x=h=b2ax = h = -\tfrac{b}{2a}. The sign of aa alone decides which extreme it is. This is why optimizing a quadratic is never a search through many inputs. There is one special point, and the two-step vertex calculation lands on it directly.

This picture is worth holding in your mind for the rest of the lesson. The quantity you want to make as large or as small as possible traces a parabola, and you are simply locating its peak or its valley.

The vertex as the maximum of a quadratic quantityA downward parabola whose vertex is the highest point. Dashed guide lines show the optimizing input on the horizontal axis and the optimal value on the vertical axis.quantityinputvertex = maximumoptimal valueoptimizing input
Optimizing a quadratic quantity means locating the vertex of its parabola. Here the quantity opens downward, so the vertex is the peak, its greatest value. Read the answer off two axes: the input that achieves the best result is directly below the peak, and the best value itself is directly across from it. They are different numbers.

Before any word problems, practice the pure mechanics on a bare quadratic, keeping the input and the value in separate boxes in your head.

Worked example 1 The maximum value of y=2x2+12x7y = -2x^2 + 12x - 7

The leading coefficient is a=2a = -2. Since a<0a < 0 the parabola opens downward, so its vertex is the highest point and the quantity has a maximum. Find the input where that happens with x=b2ax = -\tfrac{b}{2a}, reading a=2a = -2 and b=12b = 12:

x=b2a=122(2)=124=3.x = -\frac{b}{2a} = -\frac{12}{2(-2)} = -\frac{12}{-4} = 3.

The maximum occurs at the input x=3x = 3. To get the maximum value, substitute x=3x = 3 back into the equation:

y=2(3)2+12(3)7=18+367=11.y = -2(3)^2 + 12(3) - 7 = -18 + 36 - 7 = 11.

So the maximum value of yy is 1111, and it happens at x=3x = 3. Notice how different those two numbers are. If a question asks for the maximum value, the answer is 1111; the number 33 is only where it occurs. Answering 33 to “what is the maximum” is the classic slip this lesson is built to prevent.

Check your understanding

Find the minimum value of y=x26x+1y = x^2 - 6x + 1.

Answer choices

A method for optimization problems

Real problems arrive as sentences, not as y=ax2+bx+cy = ax^2 + bx + c. Turning the words into a quadratic reuses the same modeling discipline you built for quadratic applications. There is one change at the end: instead of setting the quantity equal to a target and solving, you find its vertex.

  1. Name the variable. Pick a letter for the quantity you get to choose (a width, a price, a time), and write every other quantity in the problem in terms of it.
  2. Build the quadratic. Express the thing you want to make biggest or smallest (an area AA, a revenue RR, a height hh, a product PP) as a quadratic in your variable.
  3. Find the vertex. Compute the optimizing input with x=b2ax = -\tfrac{b}{2a}, and read the sign of aa to confirm you have a maximum (a<0a < 0) or a minimum (a>0a > 0).
  4. Answer the exact question, with units. Decide whether the problem wants the optimizing input, the optimal value, or both, then substitute back as needed and state the result in a sentence. Check that the answer is physically sensible (a length is positive, a count is a whole number).

Step 4 is where the input-versus-value distinction earns its keep. “What price maximizes revenue” wants the input; “what is the greatest revenue” wants the value. A question that says “find the dimensions of the largest pen” wants the inputs, and the area they produce is a separate follow-up. Read the final sentence of the problem carefully and give back precisely what it asks.

Greatest area for a fixed amount of fence

Area problems are the heart of this topic, because area is a product of two lengths. When a fixed perimeter ties those two lengths together, the product of the two becomes a quadratic. A fixed supply of fence is the usual setup.

Worked example 2 Largest rectangular pen from 40 metres of fence

A farmer has 4040 metres of fencing to enclose a rectangular pen. What dimensions enclose the greatest area, and what is that area?

Name the width xx (in metres). The four sides are two widths and two lengths, and they use all 4040 metres, so 2x+2(length)=402x + 2(\text{length}) = 40, which gives a length of 20x20 - x. Area is length times width:

A=x(20x)=20xx2.A = x(20 - x) = 20x - x^2.

This is a quadratic in xx with a=1a = -1 and b=20b = 20. Since a<0a < 0 the parabola opens downward, so its vertex is a maximum. The optimizing width is

x=b2a=202(1)=10.x = -\frac{b}{2a} = -\frac{20}{2(-1)} = 10.

The width is 1010 metres, and the length is 20x=1020 - x = 10 metres, so the best pen is a 1010 by 1010 square. Its area is the value at the vertex:

A=10(2010)=1010=100.A = 10(20 - 10) = 10 \cdot 10 = 100.

The greatest area is 100100 square metres. For a fixed perimeter, the maximum-area rectangle always turns out to be a square, which the algebra has just confirmed.

That last claim is worth catching in the act rather than taking on trust, because it rests on many different rectangles sharing a single perimeter. The figure below reports both quantities for whatever rectangle you build, so you can pin one of them and watch the other.

Hold the perimeter at 2020 by keeping the width and the height adding to 1010. Now walk along that family: 11 by 99, then 22 by 88, 33 by 77, 44 by 66, and finally 55 by 55. The perimeter readout never leaves 2020, while the area climbs 99, 1616, 2121, 2424, 2525. The square is the peak. Keep going past it to 66 by 44 and 77 by 33. The areas then run back down through 2424 and 2121, mirroring the values on the way up. That mirror is the axis of symmetry of A=x(10x)A = x(10 - x), and the top of the climb is its vertex, which x=b2ax = -\tfrac{b}{2a} locates without any of this walking. One more setting is worth visiting for contrast: build 99 by 11, then 33 by 33. The first reports perimeter 2020 and area 99, the second perimeter 1212 and area 99. Equal areas, and nothing like equal perimeters. So one perimeter can go with many areas, and one area with several perimeters. That is exactly why an optimization problem has to say which of the two it is holding fixed before “the best rectangle” means anything at all.

Rectangle explorer

A rectangle 3 units wide and 7 units tall. Perimeter 20 units. Area 21 square units. A rectangle drawn on a grid of unit squares, inside a dashed boundary showing how large it can grow. Use the controls below the figure to change either dimension and watch the perimeter and the area separately. 3 7
Width Height

A rectangle 3 units wide and 7 units tall. Perimeter 20 units. Area 21 square units.

A rectangle sized in unit squares, reporting its perimeter and its area as two separate readings. Rectangles can share a perimeter while differing in area, and share an area while differing in perimeter, so a family that holds one of the two fixed can be walked through and compared on the other.

Change the setup so the pen backs onto a wall, and only three sides need fencing. The wall gives one side for free, so the fence is split differently, but the method does not budge.

Worked example 3 Largest pen against a wall with 60 metres of fence

A rectangular garden is built against a long straight wall, so the wall forms one side and fencing is needed only for the other three. With 6060 metres of fence, what is the largest area?

Let xx be the length of each side that runs out from the wall (there are two of these). The remaining fence forms the side parallel to the wall, so that side is 602x60 - 2x. The area is

A=x(602x)=60x2x2.A = x(60 - 2x) = 60x - 2x^2.

Here a=2a = -2 and b=60b = 60, and a<0a < 0 signals a maximum. The optimizing input is

x=b2a=602(2)=604=15.x = -\frac{b}{2a} = -\frac{60}{2(-2)} = -\frac{60}{-4} = 15.

Each side out from the wall is 1515 metres, and the side parallel to the wall is 602(15)=3060 - 2(15) = 30 metres. The greatest area is

A=15(30)=450.A = 15(30) = 450.

So the largest garden is 450450 square metres, from a 1515 by 3030 rectangle. Notice the shape is no longer a square: freeing up one side with the wall changes the balance. In this setup the side parallel to the wall comes out twice as long as each of the other two.

A rectangular pen against a wall, fenced on three sidesA wall along the top, with a rectangle beneath it fenced on the two vertical sides of length x and the bottom side of length 60 minus 2x.WALLxx60 - 2xA = x(60 - 2x)
The three-sided pen of Worked Example 3. The wall supplies the fourth side, so the 60 metres of fence covers two sides of length x running out from the wall and one side of length 60 minus 2x parallel to it. The area A = x(60 minus 2x) is a downward parabola, largest at the vertex x = 15, which gives a 15 by 30 garden.

The same product structure runs through pure number problems. Two numbers with a fixed sum have a product that is a quadratic. With the sum held fixed, that product is largest when the two numbers are equal, which is the number version of the square being the best rectangle.

Check your understanding

Two positive numbers add up to 1616. What is the greatest possible value of their product?

Answer choices

Greatest revenue

Money problems create a quadratic whenever raising the price drives down the number sold. Revenue is price times quantity, and if the quantity falls off in a straight line as the price climbs, that product is again a quadratic with a peak.

Worked example 4 The ticket price that maximizes revenue

A theater sells 200200 tickets per show at 1010 dollars each. A survey predicts that every 11 dollar increase in the ticket price will sell 1010 fewer tickets. What price brings in the greatest revenue?

Let xx be the number of 11 dollar increases. Then the price is 10+x10 + x dollars, and the number of tickets sold is 20010x200 - 10x. Revenue is price times quantity:

R=(10+x)(20010x).R = (10 + x)(200 - 10x).

Expand so you can see the coefficients:

R=2000100x+200x10x2=10x2+100x+2000.R = 2000 - 100x + 200x - 10x^2 = -10x^2 + 100x + 2000.

Here a=10a = -10 and b=100b = 100, and a<0a < 0 means the vertex is a maximum. The optimizing number of increases is

x=b2a=1002(10)=10020=5.x = -\frac{b}{2a} = -\frac{100}{2(-10)} = -\frac{100}{-20} = 5.

Five increases means the best price is 10+5=1510 + 5 = 15 dollars, at which the theater sells 20010(5)=150200 - 10(5) = 150 tickets. The greatest revenue is the value at the vertex:

R=(15)(150)=2250.R = (15)(150) = 2250.

So a ticket price of 1515 dollars maximizes revenue, bringing in 22502250 dollars. The question asked for the price, so 1515 dollars is the headline answer; the revenue of 22502250 dollars is a separate figure. The raw vertex input x=5x = 5 (the number of increases) is neither of those, just a step along the way.

A projectile’s highest point

The falling-object model from the applications chapter is a quadratic in time, so its highest point is a vertex. Near the surface of the Earth an object thrown into the air has height

h=16t2+v0t+h0(height in feet, time t in seconds),h = -16t^2 + v_0\,t + h_0 \qquad (\text{height in feet, time } t \text{ in seconds}),

with h0h_0 the starting height and v0v_0 the initial upward speed. In metric units the same model reads h=4.9t2+v0t+h0h = -4.9t^2 + v_0\,t + h_0 with the height in metres. The leading coefficient is negative in both, so the graph of height against time is a downward parabola, and its vertex is the top of the flight. The input at the vertex is the time the object peaks; the value there is the maximum height. Keep those two apart exactly as before.

Worked example 5 Maximum height of a launched ball

A ball is launched upward from a 66 foot platform with an initial speed of 8080 feet per second. So its height in feet after tt seconds is h=16t2+80t+6h = -16t^2 + 80t + 6. Find the maximum height and the time it occurs.

The coefficients are a=16a = -16, b=80b = 80, and c=6c = 6. Because a<0a < 0, the vertex is the highest point. The time at the peak is

t=b2a=802(16)=8032=2.5.t = -\frac{b}{2a} = -\frac{80}{2(-16)} = -\frac{80}{-32} = 2.5.

The ball peaks at t=2.5t = 2.5 seconds. That is the time, not the height. Substitute t=2.5t = 2.5 back to get the maximum height:

h=16(2.5)2+80(2.5)+6=16(6.25)+200+6=100+200+6=106.\begin{aligned} h &= -16(2.5)^2 + 80(2.5) + 6 \\ &= -16(6.25) + 200 + 6 = -100 + 200 + 6 = 106. \end{aligned}

The maximum height is 106106 feet, reached at t=2.5t = 2.5 seconds. A question that asks “how high” wants 106106 feet; a question that asks “when” wants 2.52.5 seconds. The model hands you both, one as the vertex input and one as the vertex value.

Check your understanding

A stone thrown upward has height h=16t2+64t+5h = -16t^2 + 64t + 5 feet after tt seconds. At what time does it reach its maximum height?

Answer choices

Least cost and other minimums

When the leading coefficient is positive the parabola opens upward, and the vertex becomes a lowest point rather than a highest one. Everything about the method is identical; only the sign of aa has flipped, and with it the word “maximum” becomes “minimum”. Costs that fall and then rise are a natural home for these.

Worked example 6 The production level that minimizes cost

A workshop finds that its daily cost in dollars to make xx units of a product is C=2x240x+500C = 2x^2 - 40x + 500. How many units should it make to minimize the cost, and what is that minimum cost?

The coefficient a=2a = 2 is positive, so the parabola opens upward and the vertex is the lowest point, a minimum. The optimizing number of units is

x=b2a=402(2)=404=10.x = -\frac{b}{2a} = -\frac{-40}{2(2)} = \frac{40}{4} = 10.

Making 1010 units minimizes the cost. The minimum cost is the value there:

C=2(10)240(10)+500=200400+500=300.C = 2(10)^2 - 40(10) + 500 = 200 - 400 + 500 = 300.

So the workshop should make 1010 units, and the least possible daily cost is 300300 dollars. The positive leading coefficient is the whole reason this is a minimum. The cost drops as production rises toward 1010 units, bottoms out there, and climbs again beyond it.

Everything in this lesson comes back to one image. Whatever the quantity, area, revenue, height, product, or cost, if it is a quadratic then its graph is a parabola. The answer you want is the peak or the valley of that parabola. Find the vertex, check the sign of aa to know which one it is, and then read off precisely the input or the value the question asks for.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)
A bit of history (Optional)

Before there was a formula, how would you find the best of infinitely many possibilities? You cannot try them all. For centuries a problem of that kind got its own ingenious argument. Each argument was built from scratch, and each was useless on the next problem.

Around 1636 a French lawyer named Pierre de Fermat wrote down one method that handled them all. He did his mathematics in the hours his day job left him.

The idea begins with something you can see for yourself. At the summit of a hill the ground is nearly level, so two points a short step apart stand at nearly the same height. Fermat took that seriously. He wrote the quantity at an input, then wrote it again a tiny step away. He treated the two as equal, cleared away whatever cancelled, and let the step shrink to nothing. What survived was the position of the peak.

Run his method on y=ax2+bx+cy = ax^2 + bx + c and watch. Comparing an input with its neighbour leaves 2ax+b=02ax + b = 0, once the step is divided out and then dropped. Solve for the input and you have x=b2ax = -\tfrac{b}{2a}.

That is the vertex, from a method that never mentions parabolas. Fermat’s reasoning reaches much further, which is why it is remembered. Turned on a quadratic, it hands back the recipe you used on every fence, ticket price and thrown ball above.