Quadratic Optimization

Watch the video explainer

Learning goals

  • Locate the vertex input x=−b2ax = -\tfrac{b}{2a} where the best value occurs
  • 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 a quadratic quantity y=ax2+bx+cy=ax^2+bx+c with a≠0a\ne0. From the parabola lesson you can find its vertex in two moves: the input is

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

and substituting this input gives the value there. In vertex form y=a(x−h)2+ky=a(x-h)^2+k, read both coordinates directly: the input is hh and the value is kk.

If a>0a>0, the parabola opens upward and the vertex gives a minimum. If a<0a<0, it opens downward and the vertex gives a maximum. For now, allow every real input. We will check restrictions in the word problems.

Why the vertex holds the largest or smallest value#

Start with y=−2(x−3)2+11y=-2(x-3)^2+11. The square is never negative, so subtracting twice that square cannot give more than 1111. At x=3x=3, the square is zero and y=11y=11: the maximum is reached. For y=2(x−3)2+11y=2(x-3)^2+11, adding twice the square gives at least 1111, reached at the same input.

The same reasoning works for any vertex form y=a(x−h)2+ky=a(x-h)^2+k. If a>0a>0, then a(x−h)2≥0a(x-h)^2\ge0, so y≥ky\ge k. The minimum kk is reached when x=hx=h. If a<0a<0, then a(x−h)2≤0a(x-h)^2\le0, so y≤ky\le k. The maximum kk is reached when x=hx=h.

In both cases, equality requires (x−h)2=0(x-h)^2=0, which happens only at x=hx=h. Completing the square gives h=−b2ah=-\tfrac{b}{2a}, so the vertex formula locates that input.

The two vertex coordinates answer different questions: where is the peak or valley, and how high or low is it?

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 parabola opens downward, so the vertex is the peak, where the quantity is greatest. The input that gives the best result is on the horizontal axis directly below the peak, and the best value itself is on the vertical axis directly across from it.

First practice separating the input from the value in a quadratic with no physical restrictions.

Worked example 1 The maximum value of y=−2x2+12x−7y = -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)=−12−4=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+36−7=11.\begin{aligned} y &= -2(3)^2 + 12(3) - 7 \\ &= -18 + 36 - 7 = 11. \end{aligned}

The maximum value is 1111, reached at x=3x=3. The question asks for the value, so the answer is 1111, not the input 33.

Check your understanding

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

Answer choices

A method for optimization problems

A word problem requires a model before you can use the vertex.

  1. Name the variable and allowed inputs. Choose a width, price, time or other input. Record restrictions such as positive lengths, whole-number counts or a stated time interval.
  2. Build the quadratic. Write the area, revenue, height, product or cost in terms of that input.
  3. Find the vertex and check it. Use x=−b2ax=-\tfrac{b}{2a}. A downward parabola gives a maximum; an upward parabola gives a minimum. Is that input allowed?
  4. Answer with units. Substitute back if the question asks for the best value. If it asks for a dimension or price instead, convert the input to that quantity.

Why does the allowed-input check matter? For y=14−(x−3.5)2y=14-(x-3.5)^2 and whole-number inputs from 00 to 66, the vertex input 3.53.5 is unavailable. Inputs 33 and 44 are equally close to it and both give 14−0.25=13.7514-0.25=13.75. Both are best; rounding to just one would miss a tie.

For a downward quadratic’s maximum, or an upward quadratic’s minimum, use the allowed input closest to the vertex, if such an input exists. This follows because the square (x−h)2(x-h)^2 measures squared distance from hh.

On a closed interval, a vertex outside the interval makes the nearer endpoint best for that extreme. For example, y=10−(x−5)2y=10-(x-5)^2 on 0≤x≤30\le x\le3 is greatest at x=3x=3, where y=6y=6. To find the minimum of this downward quadratic on that interval, compare the endpoints: the minimum is y=−15y=-15 at x=0x=0. More generally, the endpoint farthest from the vertex gives a downward quadratic’s minimum or an upward quadratic’s maximum on a closed interval.

An excluded endpoint cannot supply a reached maximum or minimum. For instance, a pen with side lengths xx and 20−x20-x requires 0<x<200<x<20; neither x=0x=0 nor x=20x=20 describes a pen.

“What price maximizes revenue?” asks for an input. “What is the greatest revenue?” asks for its value.

Greatest area for a fixed amount of fence

Area is a product of two lengths. When a fixed perimeter ties those two lengths together, their product becomes a quadratic. A fixed supply of fence is the usual setup.

Worked example 2 Largest rectangular pen from 40 meters of fence

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

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

A=x(20−x)=20x−x2.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 1010 is allowed. The length is 20−x=1020-x=10 meters, so the best pen is a 1010 by 1010 square. Its area is the value at the vertex:

A=10(20−10)=10⋅10=100.A = 10(20 - 10) = 10 \cdot 10 = 100.

The greatest area is 100100 square meters. The square result works for any fixed perimeter P>0P>0: the other side is P/2−xP/2-x, so A=−x2+(P/2)xA=-x^2+(P/2)x has its maximum at x=P/4x=P/4. Both sides are then P/4P/4.

Try the fixed-perimeter comparison in the figure. It reports perimeter and area separately.

Hold the perimeter at 2020 by keeping the width and the height adding to 1010. Build 11 by 99, then 55 by 55, then 99 by 11. All three share the perimeter 2020, but their areas are 99, 2525, and 99: the two lopsided rectangles tie, and the square between them has the greatest area. Its width is the vertex input x=−b2ax = -\tfrac{b}{2a} of A=x(10−x)A = x(10 - x). A question about “the best rectangle” only makes sense once you know which quantity is held fixed.

Same perimeter, different areas

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. Hold the perimeter fixed and change the shape to watch the area rise toward the square, then fall away, matching the vertex at x equals negative b over 2a.

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 is the same.

Worked example 3 Largest pen against a wall with 60 meters 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 meters 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 60−2x60 - 2x. Positive side lengths require 0<x<300<x<30. The area is

A=x(60−2x)=60x−2x2.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)=−60−4=15.x = -\frac{b}{2a} = -\frac{60}{2(-2)} = -\frac{60}{-4} = 15.

The input 1515 is allowed. Each side out from the wall is 1515 meters, and the side parallel to the wall is 60−2(15)=3060 - 2(15) = 30 meters. The greatest area is

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

So the largest garden is 450450 square meters, from a 1515 by 3030 rectangle. Notice the shape is no longer a square. With the wall as one side, 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 meters 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

Revenue is price times quantity sold. When the model says quantity decreases linearly as price rises, this product is a downward quadratic. The best price depends on that model.

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 200−10x200 - 10x. For whole-dollar increases, xx is a whole number with 0≤x≤200\le x\le20; the upper bound prevents a negative ticket count. Revenue is price times quantity:

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

Expand so you can see the coefficients:

R=2000−100x+200x−10x2=−10x2+100x+2000.\begin{aligned} R &= 2000 - 100x + 200x - 10x^2 \\ &= -10x^2 + 100x + 2000. \end{aligned}

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)=−100−20=5.x = -\frac{b}{2a} = -\frac{100}{2(-10)} = -\frac{100}{-20} = 5.

Five is an allowed number of increases. The best price is 10+5=1510 + 5 = 15 dollars, at which the theater sells 200−10(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 another vertex problem: the leading coefficient is negative, the graph of height against time is a downward parabola, and its vertex is the top of the flight.

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. Ignoring air resistance, use the model h=−16t2+80t+6h=-16t^2+80t+6 for its height in feet after tt seconds, from launch until it reaches the ground. 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)=−80−32=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 vertex time is positive, and completing the square gives h=−16(t−2.5)2+106h=-16(t-2.5)^2+106. From t=0t=0 to t=2.5t=2.5, the square decreases, so the height rises from 66 to 106106 feet and stays above ground. The peak therefore occurs during the flight: 106106 feet at 2.52.5 seconds.

For an object launched upward near Earth’s surface, neglecting air resistance, the model is

h=−16t2+v0 t+h0,h = -16t^2 + v_0\,t + h_0,

with height in feet and time in seconds. Here h0h_0 is the starting height and v0v_0 the initial upward speed, exactly the 66 and the 8080 from the ball above. 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.

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

For a quadratic cost with a positive leading coefficient, the vertex gives the least cost. Check the permitted production levels just as you checked lengths and prices.

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=2x2−40x+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.

Ten is an allowed nonnegative whole-number count, so making 1010 units minimizes the cost. The minimum cost is the value there:

C=2(10)2−40(10)+500=200−400+500=300.\begin{aligned} C &= 2(10)^2 - 40(10) + 500 \\ &= 200 - 400 + 500 = 300. \end{aligned}

So the workshop should make 1010 units, and the least possible daily cost is 300300 dollars. The cost drops as production rises toward 1010 units, bottoms out there, and climbs again beyond it.

Area, revenue, height, product and cost use the same vertex calculation. Whether the vertex answers the practical question depends on the model and on which inputs the model allows.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

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

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems 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)

How could someone find the best of infinitely many possibilities without trying them all? The French lawyer Pierre de Fermat had written a method for maxima and minima before 1636. It could replace separate arguments for many different problems.

Picture a smooth hilltop: the ground is nearly level, so a short step changes the height very little. Fermat compared an expression at one input with the expression a step away. His recipe canceled common terms, divided by the step and then removed terms still containing the step. He called the comparison adequality. It was not simply an ordinary equation between two equal values. The Garden of Archimedes mathematics museum describes the original procedure and how it differs from a modern limiting argument.

Applied to y=ax2+bx+cy=ax^2+bx+c, his recipe gives 2ax+b=02ax+b=0, hence x=−b2ax=-\tfrac{b}{2a}: the same vertex input used for the fences, tickets and ball in this lesson. This is a historical sketch of a broader method. Our proof here needs only the simpler fact that a square cannot be negative.

Your progress

See all your progress →