A good job for the computer: Hook Mathematica to .NET>>Then Sample: ------------------------- In[5]:= sampleDataPoints = Table[Prime[x], {x, 4}] Out[5]= {2, 3, 5, 7} In[8]:= Fit[sampleDataPoints, Table[x^i, {i, 0, 4}], x] Out[8]= 2.31685- 0.910095 x + 0.503733 x^2 + 0.117981 x^3 - 0.0284648 x^4 In[9]:= Plot[%, {x, 0, 10}] Out[9]:= Graphic Object ------------------------- Obtainig zero derivative now depends upon how we interpret the data, for some, dummy duplicate values will work, in which {2, 3, 5, 7} will become {2, 2, 3, 3, 5, 5, 7, 7}, for some, adding samll displacement will work, the list {2, 3, 5, 7} will then become {1.5, 2., 2.5, 3., 3.5, 4.5, 5., 5.5, 6.5, 7., 7.5} Here .5 displacement may be less or more it depends upon the problem. Don't reinvent the wheel, just realign it. --Anthony J. D'Angelo