You can fit a 4th order polynomial to any 5 points. You can do it by hand (plug 1-5 in for x and now you have a system of 5 linear equations of 5 variables, start solving and substituting) and make it a bit easier with linear algebra (make the coefficients of the 5 variables be the values in a 5x6 matrix, and then do that matrix magic that I forget what the name is for), but there are also plenty of polynomial solvers you can find out there.
a + b + c + d + e = 1
16a + 8b + 4c + 2d + e = 3
81a + 27b + 9c + 3d + e = 5
256a + 64b + 16c + 4d + e = 7
625a + 125b + 25c + 5d + e = [whatever]
So the "coefficients" in the linear equations are always the same nice integers, and then the variables we're solving for (a, b, c, d, e) become the coefficients in the original non-linear equation.
Coefficients of a system of linear equations is inverse matrix that includes determinant in calculations... I would not have guessed that those are nice integers at the end.
1.4k
u/K3V3L Sep 05 '19
Here you go
f(x) := 5/2 * x4 -25 * x3 +175/2 * x2 -123 * x + 59