First Derivative The slope at the sample points

75 Views Asked by At

I am trying to implement an interpolation function in C# and one of the parameter is an array of 4 elements, which should contains first derivative of the slope at the sample 4 points. I am not a math expert and I have been google for a while without success. These are the arrays. Thank you for any help.

Points Values
1.0    3.2
2.0    3.4
3.0    3.6
4.0    3.8
2

There are 2 best solutions below

3
On BEST ANSWER

If your table is the slope and this varies linearly, the function will be quadratic. Since $$y'=3+0.2 x$$ then $$y=a + 3x+0.1 x^2$$

3
On

If I properly understand, the values correspond to the second derivative of the function and it is clearly linear; so, the function is a cubic, say $$y=a +b x+c x^2+d x^3$$ $$y'=b+2c x+3dx^2$$ $$y''=2c+3dx$$ From the table, or plotting the values, you have $c=\frac32$, $d=\frac{2}{30}$. Now, the problem is : which $a,b$ to be used ?