Skip to main content

Quadratic least squares fit

Short answer

Normal equations give a=1.0357, b=−0.1929, c=0.2429. Best-fit quadratic: y=1.0357−0.1929x+0.2429x².

Find the best fit curve in the form of y = a + bx + cx² using least square approximation from the following discrete data.

x1.01.52.02.53.03.54.0
y1.11.31.62.02.73.44.1

For y = a + bx + cx² the least-squares normal equations are

Σy    = n·a + bΣx + cΣx²
Σxy   = aΣx + bΣx² + cΣx³
Σx²y  = aΣx² + bΣx³ + cΣx⁴
xyx²x³x⁴xyx²y
11.11.00001.00001.00001.10001.1000
1.51.32.25003.37505.06251.95002.9250
21.64.00008.000016.00003.20006.4000
2.526.250015.625039.06255.000012.5000
32.79.000027.000081.00008.100024.3000
3.53.412.250042.8750150.062511.900041.6500
44.116.000064.0000256.000016.400065.6000
Σx = 17.516.250.75161.875548.187547.650154.475

With n = 7:

7a + 17.50b + 50.75c = 16.20
17.50a + 50.75b + 161.875c = 47.650
50.75a + 161.875b + 548.1875c = 154.475

Solving by Gauss elimination:

a = 1.0357,  b = -0.1929,  c = 0.2429

Answer: y = 1.0357 − 0.1929x + 0.2429x² (check: x = 4 gives 4.15 against 4.1).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 4 questions →