Wednesday, November 5, 2025

The Role Of Functionals in Fitting A Curve To A Polynomial

 In numerical analysis the functional - in the form:

F(a,b,c) =  å 4 =1  (axi  2 +  bxi    c   -  yi 2 

Often plays a key role in fitting a curve to a polynomial of the form:

f(x) = ax 2 +  bx   c 

Generally starting with being given a table, e.g.

We are then tasked with fitting a polynomial of form x 2 +  bx  + c  to the set of points,   (x1 , y1 ,  x2 , y2  , x3 , y3   ,  x4 , y4 )say as displayed in the  table:

To proceed we  must choose a, b, c to   minimize the functional, such that:

F(a,b,c) =  å 4 =1  (axi  2 +  bxi    c   -  yi 2 

This can be done by solving the linear system of equations:

  f/a = 0,        f/b = 0,  f/c = 0                                                                                                          

 Computation based on the respective values for  (xi,  yi) are shown below:


[1] ¶f/a =  2 (axi  2 +  bxi    c   -yi)xi 2  = 0

Then:

(-2,1): 32a -  16b + 8c - 8 = 0

(-1, 1): 2a    - 2b   +2c + 2 = 0

(0, 2):   0

(1, 1): 2a  + 2b + 2c - 2  = 0

            ------------------------

Summing: 36a - 16b +12c - 8 = 0


[2] ¶f/b  2 (axi  2 +  bxi    c   -yi)xi   = 0

(-2,1 ): - 16a + 8b - 4c + 4 = 0

(-1, -1):  -2a  - 2b - 2c -2  = 0

(0, 2):      0

(1, 1):     2a  + 2b  + 2c  - 2 = 0

---------------------------------

     Sum:   16a + 12b  - 4c = 0


[3] f/c =  2 (axi  2 +  bxi    c   -yi)   = 0

(-2, 1):  8a - 4b + 2c - 2 = 0

(-1, -1): 2a - 2b + 2c + 2 = 0

(0, 2): 2c - 4 = 0

(1, 1): 2a -4b + 8c - 6 = 0

 -----------------------------

Sum:  12a - 4b + 8c - 6 = 0

From the 3 sums we arrive at a 3 x 3 system given by:

36a - 16b +12c - 8 = 0

16a + 12b  - 4c = 0

12a - 4b + 8c - 6 = 0

Written in matrix form:


The values for a, b, c can then either be found using Gaussian elimination with pivotal condensation or matrix inversion. We choose the latter as it is more straightforward and amenable to a good computing program.  Using Mathcad, for example, we obtain:


Thus: a = 0.25, b = 0.55, c = 0.65

The unknowns a, b and c can also be computed using the Gaussian elimination calculator below. 


Simply insert the original array values for M and the values for v - and see all the steps that would normally be needed and the solutions for a, b and c.

The calculator will also perform a check of the Mathcad result.

Suggested Problem:

 Fit a second degree polynomial  to the ordered pairs in the table below:


Hence, find a, b and c for the polynomial: axi 2 +  bxi    c 


No comments: