Fitting a quadratic to data
You have measured something three times, and it rises and then falls. Which parabola passes through all three measurements, and what does it predict in between and beyond?
Where you are 12 in Quadratics
When you reach for it
Earlier lessons on quadratics in context handed you the formula, a ball’s height h(t) = -16t^2 + 96t + 6 say, and the work was to read its vertex or its roots. Real problems seldom arrive that way. What you have is a table: a height at three moments, the takings at three prices, a stopping distance at three speeds. The formula is what is missing.
This lesson runs the other way, from points to equation. A quadratic y = ax^2 + bx + c is fixed by three numbers, a, b and c, and each point on its graph gives one equation those numbers must satisfy. Three unknowns need three equations, so three points are the right amount. Two are too few: through any two points runs a whole family of parabolas, some opening up, some down, some narrow, some wide.
A third point, with an x different from the other two and not on the line through them, keeps exactly one member of that family:
Reach for this move when a situation is known to be quadratic, or behaves like one (it rises and then falls, or grows with the square of something), and you have measurements at three different inputs.
The procedure
Find the parabola through (1, 2), (2, 7) and (4, 23).
Write the general quadratic, and treat a, b and c as the unknowns. Every upright parabola is y = ax^2 + bx + c with a \ne 0. Here the points supply x and y, and the coefficients are what is unknown.
Substitute each point to get one equation. The point (2, 7) is on the graph exactly when 7 = a(2)^2 + b(2) + c. Once x is a known number, so is x^2, and the equation is linear in a, b and c. The three points give
That is a system of three linear equations in three unknowns.
Remove c first, by subtracting. The coefficient of c is 1 in every equation, because c is c \cdot x^0. So subtracting any two equations removes it at once, with no multiplying first. Take the second minus the first, and the third minus the second:
Solve the two-variable system. Halve the second equation to get 6a + b = 8, and subtract 3a + b = 5 from it: 3a = 3, so a = 1. Then b = 5 - 3a = 2.
Go back for c. Any original equation will do. From the first, c = 2 - a - b = -1, so
Check all three points. 1 + 2 - 1 = 2, then 4 + 4 - 1 = 7, then 16 + 8 - 1 = 23. A slip in one equation can leave the other two satisfied, so one check is not enough.
Why there is exactly one answer. The subtracting step has a meaning. Subtract the equations for (x_1, y_1) and (x_2, y_2) and divide by x_2 - x_1, which is allowed because the inputs differ. Since x_2^2 - x_1^2 = (x_2 - x_1)(x_2 + x_1), what is left is
The right side is m_{12}, the slope of the straight line joining the two points. The second and third points give a(x_2 + x_3) + b = m_{23} in the same way, and subtracting removes b:
In the procedure the two slopes are \tfrac{7 - 2}{2 - 1} = 5 and \tfrac{23 - 7}{4 - 2} = 8, so a = \tfrac{8 - 5}{4 - 1} = 1, as found. So a measures how fast the slope changes, which is what makes a parabola bend. Every division needed only different inputs, and no step lost an equation, so three points with different inputs always give exactly one a, then one b, then one c. When a comes out as 0, that one answer is a line rather than a parabola.
Use the form the data makes cheap. If two points are roots, x = r and x = s, factored form y = a(x - r)(x - s) already passes through both. If the vertex (h, k) is known, vertex form y = a(x - h)^2 + k builds it in. Either way one more point gives a. And a point with x = 0 hands you c directly.
Worked examples
A point on the y-axis
Find the parabola through (0, 3), (1, 6) and (2, 13).
SolutionAt x = 0 the equation says 3 = a(0) + b(0) + c, so c = 3 straight away. The other two points then give two equations in a and b:
These are a + b = 3 and 2a + b = 5 after halving the second. Subtracting, a = 2, and then b = 1. The parabola is y = 2x^2 + x + 3.
Check. 2 + 1 + 3 = 6 and 8 + 2 + 3 = 13.
Three general points
Find the parabola through (-1, 8), (1, 2) and (3, 4).
SolutionAt x = -1 the square is +1 and the b term is -b, so the three points give
The first two have a and c in the same places, so subtracting the first from the second removes both at once: 2b = -6, so b = -3. Put that into the second and third equations:
Subtracting, 8a = 8, so a = 1 and c = 4. The parabola is y = x^2 - 3x + 4.
Check. 1 + 3 + 4 = 8, then 1 - 3 + 4 = 2, then 9 - 9 + 4 = 4.
A model from measured heights
A ball is thrown upward, and its height is measured at three moments: 21 meters after 1 second, 30 meters after 2 seconds and 29 meters after 3 seconds. Find a quadratic model for its height h after t seconds. From what height was it thrown, and how high does it go?
SolutionWrite h = at^2 + bt + c and substitute the three measurements:
Subtracting neighbors removes c: 3a + b = 9 and 5a + b = -1. Subtracting those, 2a = -10, so a = -5. Then b = 9 - 3a = 24, and c = 21 - a - b = 2. The model is
Each coefficient now means something. The ball was thrown from the height at t = 0, which is c = 2 meters. And a = -5 is negative, so the graph opens downward and its vertex is the top of the flight:
The ball reaches 30.8 meters, 2.4 seconds after it is thrown.
The greatest height was not one of the measurements. The data only said the ball was higher at 2 seconds than at 3; the model says when it turned and how high it got.
Two roots and one more point
A parabola crosses the x-axis at x = -1 and x = 5, and passes through (2, 18). Find its equation.
SolutionThe two roots are two of the three points, (-1, 0) and (5, 0). Factored form builds them in: any y = a(x + 1)(x - 5) is zero at both, whatever a is. The third point fixes a:
so a = -2, and
Check. At x = 2: -8 + 16 + 10 = 18. One equation in one unknown did the work of three.
An arch from its span and its height
A parabolic arch stands on level ground. Its feet are 16 meters apart and its highest point is 8 meters above the ground. How high is the arch 4 meters in from one foot? Could a load 4 meters wide and 7 meters tall pass under it, kept to the middle?
SolutionPut the origin at the left foot, with x measured along the ground in meters. By symmetry the top is halfway between the feet, so the vertex is (8, 8) and the feet are (0, 0) and (16, 0). Vertex form uses the vertex at once:
The foot (0, 0) gives 0 = 64a + 8, so a = -\tfrac{1}{8}.
Four meters in from the left foot is x = 4:
The arch is 6 meters high there. A load 4 meters wide in the middle reaches from x = 6 to x = 10. The arch is lowest over the load at its two edges, where
So the arch is at least 7.5 meters high over the whole load, and a 7-meter load passes with half a meter to spare.
Stopping distances, and a fourth point as a test
A car’s stopping distance d, in meters, is measured at three speeds v, in kilometers per hour: 6.4 m at 20 km/h, 17.6 m at 40 km/h and 33.6 m at 60 km/h. Fit a quadratic, then use it to predict the stopping distance at 100 km/h. A fourth test, at 80 km/h, measured 54.4 m. What does that say about the model?
SolutionWrite d = av^2 + bv + c. The squares of the speeds are 400, 1600 and 3600:
Subtracting neighbors removes c: 1200a + 20b = 11.2 and 2000a + 20b = 16. Subtracting again, 800a = 4.8, so a = 0.006. Then 20b = 11.2 - 7.2 = 4, so b = 0.2, and c = 6.4 - 2.4 - 4 = 0. The model is
That c = 0 is a good sign: a car at 0 km/h needs no distance to stop, and nobody told the system that. At 100 km/h the model predicts
meters, far more than at 60 km/h, because the squared term takes over at speed.
Now the fourth test. The model predicts 0.006(6400) + 0.2(80) = 38.4 + 16 = 54.4 meters at 80 km/h, exactly what was measured. Three points with different inputs always fit some y = ax^2 + bx + c, so the fit itself proved nothing. A fourth point that the model predicted before it was used is the real test, and this one passes.
Boundaries
The three inputs must differ. Two points with the same x and different y cannot both be on the graph of any function, and the method fails at the division by x_2 - x_1. Two copies of the same point are only two points, and leave a whole family.
Three points on a line give a line. If the three points are collinear, the two joining slopes are equal, so a = \tfrac{m_{23} - m_{12}}{x_3 - x_1} = 0. The system still solves, but the answer is y = bx + c, a line, and no parabola passes through all three.
A perfect fit is not evidence. Any three points with different inputs fit exactly one y = ax^2 + bx + c, whatever made the data. Whether a quadratic is the right model is a separate question, tested by further points, as in Example 6, and by whether the coefficients make sense.
Real data is noisy. More than three measurements, each with a little error, usually fit no single parabola. Then the aim is the parabola that misses least, usually in the sense of least squares, which is what a calculator’s quadratic regression finds.
A model holds only where it was built. The ball model gives negative heights after about 4.9 seconds, when the ball is on the ground. A prediction inside the measured range is interpolation and usually safe; one outside it, like the stopping distance at 100 km/h, trusts the pattern to continue.
Only upright parabolas. y = ax^2 + bx + c has a vertical axis. A parabola on its side is not the graph of a function of x.
Where this goes next
With equally spaced inputs there is a shortcut: a quadratic’s second differences are constant, equal to 2a when the spacing is 1. In Example 3 the heights 21, 30, 29 have first differences 9 and -1, and second difference -10 = 2(-5).
The count works for every degree: n + 1 points with different inputs fix a polynomial of degree at most n, the start of modeling with polynomials. One equation per data point also builds an exponential model from two points, and the three-by-three system is what matrices are built to solve. With many noisy points, fitting becomes regression, and choosing a shape becomes comparing models of the same data.
Exercises
Find the parabola through three points
- (0, 1), (1, 4) and (2, 11)
- (-1, -6), (0, -2) and (1, 0)
- (1, 6), (2, 11) and (3, 18)
- (-1, 10), (1, 2) and (2, 4)
- (1, -1), (3, 3) and (4, 8)
- (0, 0), (2, 1) and (4, 4)
- (-2, 5), (0, 1) and (2, -3)
Choose the form that makes it quick
- The parabola crosses the x-axis at x = -3 and x = 1, and passes through (0, 6).
- The vertex is (2, -3), and the parabola passes through (4, 5).
- The parabola passes through (1, 7), (3, 3) and (5, 7). Use the two equal outputs to find the vertex first.
- The parabola crosses the x-axis at x = 0 and x = 8, and its highest point is 12 units above the axis.
Models from data
- A stone is thrown upward. Its height is 1 meter at t = 0, 16 meters at t = 1 second and 16 meters at t = 3 seconds. Find a model h = at^2 + bt + c, and the stone’s greatest height.
- A shop’s weekly takings R, in dollars, when an item is priced at p dollars, were 1600 at p = 10, 2400 at p = 20 and 2400 at p = 30. Fit a quadratic, and find the price that gives the most takings, and what they are.
- Fit a parabola to (1, 3), (2, 8) and (3, 15). A fourth measurement is (4, 25). Does it lie on the same parabola?
- A parabolic arch meets the ground at two points 20 meters apart and is 8 meters high at its center. How high is it 3 meters in from one foot?
- A polygon with n sides has 2 diagonals when n = 4, 5 when n = 5 and 9 when n = 6. Fit a quadratic d = an^2 + bn + c, and use it to predict the number of diagonals of a 10-sided polygon.
Reasoning
- Give two different parabolas through (0, 0) and (2, 4), and explain why two points can never fix a parabola.
- Explain why subtracting two of the equations always removes c, whatever the points are.
- Show that if three points lie on one line, the method gives a = 0.
- Explain why no parabola y = ax^2 + bx + c passes through (1, 2), (1, 5) and (3, 0).
- A student fits a parabola to three measurements and says the perfect fit proves the situation is quadratic. Explain what is wrong with the argument, and what would count as evidence.
Answers
- y = 2x^2 + x + 1. c = 1 from (0, 1); then a + b = 3 and 4a + 2b = 10, so a = 2, b = 1.
- y = -x^2 + 3x - 2. c = -2; then a - b = -4 and a + b = 2, so a = -1, b = 3.
- y = x^2 + 2x + 3. Subtracting gives 3a + b = 5 and 5a + b = 7, so a = 1, b = 2, c = 6 - 1 - 2 = 3.
- y = 2x^2 - 4x + 4. The first two equations give 2b = -8, so b = -4 and a + c = 6; the third gives 4a + c = 12, so a = 2, c = 4.
- y = x^2 - 2x. Subtracting gives 4a + b = 2 and 7a + b = 5, so a = 1, b = -2, c = 0.
- \displaystyle y = \frac{1}{4}x^2. c = 0; then 4a + 2b = 1 and 16a + 4b = 4, so \displaystyle a = \frac{1}{4}, b = 0.
- No parabola: the method gives a = 0, and the points lie on the line y = -2x + 1. Both joining slopes are -2.
- y = -2x^2 - 4x + 6. Write y = a(x + 3)(x - 1). The point (0, 6) gives 6 = -3a, so a = -2.
- y = 2x^2 - 8x + 5. Write y = a(x - 2)^2 - 3; then 5 = 4a - 3, so a = 2.
- y = x^2 - 6x + 12. The equal outputs at x = 1 and x = 5 put the axis at x = 3, so the vertex is (3, 3). Then 7 = a(1 - 3)^2 + 3 gives a = 1.
- \displaystyle y = -\frac{3}{4}x^2 + 6x. The vertex is (4, 12). Write y = ax(x - 8); then 12 = a(4)(-4), so \displaystyle a = -\frac{3}{4}.
- h = -5t^2 + 20t + 1, with greatest height 21 meters at t = 2. c = 1; then a + b = 15 and 9a + 3b = 15, so a = -5, b = 20. The vertex is at \displaystyle t = -\frac{20}{2(-5)} = 2.
- R = -4p^2 + 200p; the most takings are 2500 dollars, at a price of 25 dollars. Subtracting gives 300a + 10b = 800 and 500a + 10b = 0, so a = -4, b = 200, c = 0. The vertex is at \displaystyle p = -\frac{200}{2(-4)} = 25.
- No. The parabola is y = x^2 + 2x, which gives 16 + 8 = 24 at x = 4, not 25. So no one parabola passes through all four points.
- 4.08 meters. With the origin at one foot, y = a(x - 10)^2 + 8 and 0 = 100a + 8, so \displaystyle a = -\frac{2}{25}. At x = 3: \displaystyle -\frac{2}{25}(49) + 8 = \frac{102}{25} = 4.08.
- \displaystyle d = \frac{1}{2}n^2 - \frac{3}{2}n, and a 10-sided polygon has 35 diagonals. Subtracting gives 9a + b = 3 and 11a + b = 4, so \displaystyle a = \frac{1}{2}, \displaystyle b = -\frac{3}{2}, c = 0. The model is \displaystyle d = \frac{n(n - 3)}{2}, which is exact: each of n corners joins to n - 3 others by a diagonal, and each diagonal is counted twice.
- For example y = x^2 and y = -x^2 + 4x; both give 0 at x = 0 and 4 at x = 2. Two equations in three unknowns leave one free: every y = 2x + k\,x(x - 2) with k \ne 0 passes through both.
- Every equation is y_i = ax_i^2 + bx_i + c, and c appears in each with coefficient 1, because it is multiplied by x^0 = 1 whatever x_i is. Subtracting two equations subtracts c from c.
- Subtracting and dividing by the difference of inputs gives a(x_1 + x_2) + b = m_{12} and a(x_2 + x_3) + b = m_{23}. On one line the two slopes are equal, so subtracting leaves a(x_3 - x_1) = 0, and since x_3 \ne x_1, a = 0.
- The first two points have the same input and different outputs. A graph y = ax^2 + bx + c has one output for each input, so it cannot pass through both; the equations a + b + c = 2 and a + b + c = 5 contradict each other.
- Any three points with different inputs fit exactly one y = ax^2 + bx + c, whatever produced them, so a perfect fit always happens and proves nothing. Evidence is a further measurement the model predicts correctly, or coefficients that make sense, like c = 0 for stopping at zero speed.