Updated · By Pete Bromfield, former Head of Maths with IB examining experience

IA modelling, step by step · Quadratic

Quadratic model, step by step: three points, completing the square and regression

AA SLAA HLAI SLAI HL

Three ways to fit y = ax² + bx + c to the same data: solve three simultaneous equations through three points, build the vertex form y = a(x − h)² + k from the turning point, and use least-squares regression. Then compare all three with the sum of squared residuals.

Example data, invented for this guide. The context is realistic, but the numbers were made up to show the method. Use your own measured or sourced data in your IA.

When to use it

The shape of the data

  • One turning point (a single peak or trough) and roughly symmetrical sides.
  • The first differences of y change at a steady rate (constant second differences for equally spaced x).

The context

  • Projectiles and anything thrown or sprayed (constant acceleration).
  • Area, cost or profit that rises then falls (optimisation).
  • Shapes with a symmetric curve: arches, bridges, the cross-section of a bowl or dish.

Course fit: Every course. Quadratics and completing the square are core AA; AI uses quadratic models with technology. Solving the 3 × 3 system with matrices is HL (AA or AI), but a GDC equation solver is fine at SL.

The example data

A basketball free throw is filmed side-on; the ball's centre is read from video frames against a scale on the wall.

Example data: height of ball and horizontal distance from release
ix: Horizontal distance from release (m)y: Height of ball (m)
102.12
20.52.66
313.33
41.53.72
523.93
62.54.02
733.87
83.53.6
943.18
Scatter graph of height of ball against horizontal distance from release for the example data
Step 1 of any modelling IA: plot the data and describe the shape before fitting anything.

Method 1: three points and simultaneous equations

A quadratic has three unknowns, so three points fix it exactly. Choose points spread across the data — the first, middle and last here — and solve the 3 × 3 system by elimination, then check it with matrices.

Step 1 · Substitute three points

Using points 1, 5, 9 of the data, spread across the whole range: (0, 2.12), (2, 3.93), (4, 3.18). Each must satisfy y = ax² + bx + c:

  1. 0a + 0b + c = 2.12
  2. 4a + 2b + c = 3.93
  3. 16a + 4b + c = 3.18

Step 2 · Eliminate c

Subtract equation (1) from (2) and from (3):

  1. (2) − (1): 4a + 2b = 1.81
  2. (3) − (1): 16a + 4b = 1.06

Divide (4) by 2 and (5) by 4 (because x₂² − x₁² = (x₂ − x₁)(x₂ + x₁)):

  1. 2a + b = 0.905
  2. 4a + b = 0.265

Step 3 · Solve for a, then b, then c

(7) − (6): 2a = −0.64, so a = −0.3200.

From (6): b = 0.905 − 2 × (−0.3200) = 1.545.

From (1): c = 2.12 − 0 × (−0.3200) − 0 × 1.545 = 2.120.

Carry the unrounded values forward (store them in your calculator); rounded values give slightly different answers.

Step 4 · Check with matrices

The same system as a matrix equation AX = B:

=

X = A⁻¹B on a GDC (or the simultaneous-equation solver) gives the same a = −0.3200, b = 1.545, c = 2.120.

Step 5 · Complete the square to find the turning point

y = −0.3200(x² − 4.828x) + 2.120   (factor a out of the x terms: b/a = −4.828)

y = −0.3200[(x − 2.414)² − 5.828] + 2.120   (half of b/a is −2.414; subtract its square)

y = −0.3200(x − 2.414)² + 3.985

So the turning point is (h, k) = (2.414, 3.985): h = −b/(2a) and k = c − b²/(4a). Since a < 0 this is a maximum.

Step 6 · Residuals and goodness of fit

For each point, the residual is the observed value minus the model's value: e = y − ŷ.

Residuals
ixy (data)ŷ (model)y − ŷ(y − ŷ)²
102.122.1200.000.00
20.52.662.813−0.1520.0233
313.333.345−0.01500.000225
41.53.723.7180.002500.00000625
523.933.9300.000.00
62.54.023.9820.03750.00141
733.873.875−0.005000.0000250
83.53.63.607−0.007500.0000562
943.183.1800.000.00
Σ0.02497
  • Sum of squared residuals: SSR = Σ(y − ŷ)² = 0.02497
  • Total sum of squares about the mean ȳ = 3.381: SST = Σ(y − ȳ)² = 3.265
  • Coefficient of determination: R² = 1 − SSR/SST = 1 − 0.02497/3.265 = 0.9923
  • Root-mean-square error: RMSE = √(SSR/n) = 0.0527 — a typical size of a residual, in the units of y.

The three chosen points have residual 0 (up to rounding). The fit to the other points shows how much the choice of points matters.

Graph of the data with the fitted quadratic through three points (through points 1, 5 and 9)
Three points and simultaneous equations: the fitted curve over the example data.

Method 2: vertex form by completing the square

If you can see (or know from the context) where the turning point is, the vertex form y = a(x − h)² + k needs just one more point. Here the highest data point is used as the vertex.

Step 1 · Turning point

The highest data point, point 6, is taken as the turning (vertex) point: (h, k) = (2.5, 4.02). In vertex (completed-square) form:

y = a(x − 2.5)² + 4.02

A data point is only an estimate of the true turning point; the real maximum or minimum may lie between readings. Say so, and consider refining it (step 5).

Step 2 · Find a from one more point

Substitute point 1, (0, 2.12), far from the vertex:

2.12 = a(0 − 2.5)² + 4.02

a = (2.12 − 4.02) / (−2.5)² = −1.9 / 6.25 = −0.3040

Step 3 · The model in vertex form

y = −0.3040(x − 2.5)² + 4.02

a < 0, so the parabola opens downwards (∩) with a maximum at (2.5, 4.02); the axis of symmetry is x = 2.5.

Step 4 · Convert to y = ax² + bx + c

Expand: a(x − h)² + k = ax² − 2ah·x + (ah² + k), so

b = −2ah = −2 × (−0.3040) × 2.5 = 1.520,   c = ah² + k = 2.120

y = −0.3040x² + 1.520x + 2.120

Step 5 · Residuals and goodness of fit

For each point, the residual is the observed value minus the model's value: e = y − ŷ.

Residuals
ixy (data)ŷ (model)y − ŷ(y − ŷ)²
102.122.1200.000.00
20.52.662.804−0.1440.0207
313.333.336−0.006000.0000360
41.53.723.7160.004000.0000160
523.933.944−0.01400.000196
62.54.024.0200.000.00
733.873.944−0.07400.00548
83.53.63.716−0.1160.0135
943.183.336−0.1560.0243
Σ0.06425
  • Sum of squared residuals: SSR = Σ(y − ŷ)² = 0.06425
  • Total sum of squares about the mean ȳ = 3.381: SST = Σ(y − ȳ)² = 3.265
  • Coefficient of determination: R² = 1 − SSR/SST = 1 − 0.06425/3.265 = 0.9803
  • Root-mean-square error: RMSE = √(SSR/n) = 0.0845 — a typical size of a residual, in the units of y.

Only two points were used, so this model depends heavily on them. Changing the second point, or nudging the vertex to reduce SSR, is a good piece of reflection (Criterion D).

Graph of the data with the fitted quadratic from its turning point (vertex form)
Vertex form by completing the square: the fitted curve over the example data.

Method 3: quadratic regression (least squares)

Regression uses all nine points: it chooses a, b and c to minimise the sum of squared residuals. The sums and the three normal equations are shown so you can see what the calculator solves.

Step 1 · Tabulate the sums

Sums for quadratic least squares
ixyx²x³x⁴xyx²y
102.1200000
20.52.660.250.1250.06251.330.665
313.331113.333.33
41.53.722.253.3755.06255.588.37
523.9348167.8615.72
62.54.026.2515.62539.062510.0525.125
733.879278111.6134.83
83.53.612.2542.875150.062512.644.1
943.18166425612.7250.88
Σ1830.4351162548.2565.08183.02

n = 9.

Step 2 · The normal equations

Least squares chooses a, b, c to make SSR = Σ(y − ax² − bx − c)² as small as possible. Setting the partial derivatives of SSR to zero gives three linear equations:

  1. 548.25a + 162b + 51c = 183.02   (Σx⁴, Σx³, Σx², Σx²y)
  2. 162a + 51b + 18c = 65.08   (Σx³, Σx², Σx, Σxy)
  3. 51a + 18b + 9c = 30.43   (Σx², Σx, n, Σy)

HL students can derive these by differentiating SSR with respect to each parameter; at SL it is enough to say the calculator minimises SSR.

Step 3 · Solve (matrix or GDC)

Solving the 3 × 3 system (with a matrix inverse, the simultaneous-equation solver, or directly with quadratic regression):

a = −0.3271,   b = 1.590,   c = 2.055

y = −0.3271x² + 1.590x + 2.055

Turning point: x = −b/(2a) = 2.430, y = 3.987.

Step 4 · Residuals and goodness of fit

For each point, the residual is the observed value minus the model's value: e = y − ŷ.

Residuals
ixy (data)ŷ (model)y − ŷ(y − ŷ)²
102.122.0550.06480.00420
20.52.662.768−0.1080.0117
313.333.3180.01220.000148
41.53.723.7040.01620.000261
523.933.9260.003720.0000139
62.54.023.9850.03480.00121
733.873.881−0.01050.000110
83.53.63.612−0.01230.000151
943.183.181−0.0005450.000000298
Σ0.01783
  • Sum of squared residuals: SSR = Σ(y − ŷ)² = 0.01783
  • Total sum of squares about the mean ȳ = 3.381: SST = Σ(y − ȳ)² = 3.265
  • Coefficient of determination: R² = 1 − SSR/SST = 1 − 0.01783/3.265 = 0.9945
  • Root-mean-square error: RMSE = √(SSR/n) = 0.0445 — a typical size of a residual, in the units of y.

For a quadratic, quote R² (not r, which measures linear correlation only).

Graph of the data with the fitted quadratic regression (quadratic regression)
Quadratic regression (least squares): the fitted curve over the example data.
Residual plot for the quadratic regression fitted to the example data
Residuals against x. Look for a pattern: random scatter about 0 means the model has captured the shape; a curve or a trend means it has not.

Comparing the methods

The same data, different methods
MethodParametersSSRR²RMSE
three points and simultaneous equations30.024970.99230.0527
vertex form by completing the square30.064250.98030.0845
quadratic regression (least squares)30.017830.99450.0445
All the fitted models drawn over the example data on one graph
The models side by side. Where do they differ most — between the points, or beyond them?

Least squares gives the smallest SSR of any curve of its type, because that is what it minimises. A model through chosen points depends on which points you choose; test that by choosing others. For a fair comparison between different types, also compare the number of parameters and the shape beyond the data — see choosing and comparing models.

What the model tells you

  • a = −0.327 < 0: the path is ∩-shaped, as gravity predicts. With constant horizontal speed, a depends on g and the launch speed, which a physics-minded student could use as a check.
  • The turning point (2.43, 3.99) is the ball's highest point: it peaks about 2.4 m from release at a height of about 3.99 m.
  • Domain: 0 m ≤ x ≤ 4 m (from release to where the ball was last seen). Outside it, the model is not the ball's path.

The same on a GDC

Enter and plot the data first, then fit. The key sequences are for current operating systems; menus differ slightly between versions.

TI-84 Plus CE

  1. Data: [stat] → 1: Edit… Type the x values in L1 and the y values in L2. To plot: [2nd] [y=] (STAT PLOT) → Plot1: On, Type: scatter, Xlist: L1, Ylist: L2, then [zoom] → 9: ZoomStat.
  2. Three-point system: APPS → PlySmlt2 → SIMULT EQN SOLVER, 3 equations, 3 unknowns; type the coefficients of a, b, c and the right-hand sides, then SOLVE.
  3. Or with matrices: [2nd] [x⁻¹] (MATRIX) → EDIT → [A] 3×3 (the x², x, 1 columns) and [B] 3×1 (the y values), then on the home screen [A]⁻¹[B].
  4. Quadratic regression: [stat] → CALC → 5: QuadReg, Xlist L1, Ylist L2, Store RegEQ Y1. It shows a, b, c and R².

TI-Nspire CX

  1. Data: Add a Lists & Spreadsheet page; name column A xs and column B ys and type the data. Add a Data & Statistics page (or a Graphs page with menu → Graph Entry/Edit → Scatter Plot) and choose xs and ys.
  2. Three-point system: Calculator page → menu → Algebra → Solve System of Equations → Solve System of Linear Equations: 3 equations, variables a, b, c.
  3. Or matrices: type [x1² x1 1; x2² x2 1; x3² x3 1]⁻¹·[y1; y2; y3].
  4. Regression: menu → Statistics → Stat Calculations → Quadratic Regression, X List xs, Y List ys, save to f1.

Casio fx-CG50

  1. Data: [MENU] → Statistics. Type the x values in List 1 and the y values in List 2. To plot: [F1] (GRAPH) → [F6] (SET): Graph Type Scatter, XList List1, YList List2; [EXIT], then [F1] (GRAPH1).
  2. Three-point system: [MENU] → Equation → [F1] (Simultaneous) → [F2] (3 unknowns); type the coefficients; [F1] (SOLVE).
  3. Or [MENU] → Run-Matrix → [F1] (►MAT) to enter Mat A (3×3) and Mat B (3×1), then Mat A⁻¹ × Mat B.
  4. Regression: Statistics → [F2] (CALC) → [F3] (REG) → [F3] (X²). It shows a, b, c and R².

In Desmos

Free at desmos.com/calculator. In a regression, ~ means “fit this model”; subscripts are typed with an underscore (x_1 shows as x₁).

  1. Data in a table with columns x₁, y₁.
  2. Regression: y_1 ~ a x_1^2 + b x_1 + c.
  3. Vertex form with a known turning point: y_1 ~ a (x_1 - 2.5)^2 + 4.02 — only a is fitted.
  4. Through three points: type the three equations with sliders, or solve them by hand and type the result to check it passes through the points.

Data already in Desmos? Copy the table cells into Model my data for the step-by-step method with your numbers, then copy the regression and the fitted equation back. More on technology in the IA: using Desmos, GeoGebra and Excel.

How to write it up in your IA

  • Explain why a quadratic suits the context (for a projectile, constant acceleration) before fitting.
  • Show the three-point elimination in full once — it is easy to follow and shows algebra — and say why those three points were chosen.
  • Show completing the square step by step, and interpret the turning point in context.
  • State which points each method uses: three, two, or all of them. That is the heart of the comparison.
  • Compare the three models with SSR in one table and explain why regression gives the smallest SSR (it is designed to).
  • Reflect: how sensitive are the three-point and vertex models to the points chosen? Try another set and report the change.

These are the points to cover, not sentences to copy. Write every explanation in your own words, about your own data.

Common mistakes

  • Choosing three points bunched together: tiny measurement errors then swing the curve wildly.
  • Using rounded a and b to find c (carry full values or store them in the calculator).
  • Sign slips in completing the square: (x − h)² has the turning point at x = +h.
  • Treating the highest data point as the exact vertex without comment.
  • Quoting r for a quadratic: use R² (or SSR).

Is this good enough for Criterion E?

  • The shape and the context both justify a quadratic.
  • At least one method is shown by hand (elimination or completing the square), with technology stated for the rest.
  • The turning point is found and interpreted in context.
  • Models from different methods are compared with SSR (or R²), and the choice is explained.
  • The domain is stated and extrapolation is discussed.
  • HL: the normal equations are derived by minimising SSR (partial derivatives), or the 3 × 3 system is solved with matrices and its conditioning discussed.

SL or HL? Criterion E asks for mathematics that fits your course. At SL, fitting with technology is fine when you explain the method and justify every choice. At HL, show more of the mathematics yourself — the last item in the list is an example. See Criterion E and Criterion D.

Evaluate this model

Questions to answer in your own words, about your own data. They are prompts, not sentences to copy.

  • Does the context explain exactly one turning point, and is the model's turning point in a sensible place?
  • Beyond the data the parabola turns back. Would the real quantity do that?

Then work through the general questions on evaluating a model (extrapolation, the parameters, residuals, comparing models, outliers, assumptions and improvements) and the notes on accuracy and rounding. In the free Grapher, fit the model with ~ and open “What this model means” for the same prompts with your own numbers.

IA ideas that use a quadratic model

Explorations from our idea list whose mathematics includes this model. Each research question is a starting point to make your own.

How this earns marks

A quadratic model can earn marks under every criterion: the fit and its explanation under Criterion E, your judgement of it (residuals, the domain, what the parameters mean) under Criterion D, and the reasons you chose it under Criterion C. What examiners look for, criterion by criterion and the mistakes that cost marks are on the modelling guide.

Get feedback on your write-up Self-check your draft Model my data

Frequently asked questions

Which three points should I use to fit a quadratic?

Points spread across the whole data set — typically the first, one near the middle (ideally near the turning point) and the last. Then say how the model changes if you choose different points: that is good reflection.

Is completing the square enough maths for an IA?

On its own it is standard SL content. It becomes strong Criterion E work when it is used for a reason (finding and interpreting the turning point), done correctly and compared with other methods such as regression.

Next steps

Related models: Straight line y = mx + c · Cubic and polynomials (and overfitting) · Choosing and comparing models. Or model your own data, and see what the IA package adds.

Free: the IA checklist, criterion by criterion

Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it to you, and for three weeks your weekly email carries one IA tip, timed to your deadline if you give it. Free — no account, no payment.