# Approximation of first derivative at $x_0$ using Five-point endpoint formula

Find the $$f'(x=0)$$ using Five-point endpoint formula. where $$f$$ is a long vector of length $$n$$, say $$n=11$$.

  x       f
0    0.001
0.1   0.435
0.2   0.765
0.3   0.897
0.4   0.875
0.5   0.786
0.6   0.776
0.7   0.994
0.8   0.564
0.9   0.987
1    0.657


Five-point endpoint formula is

$$f'(x_0)=[−25f(x_0) + 48f(x_0 + ℎ) − 36f(x_0 + 2ℎ) + 16f(x-0 + 3ℎ) − 3(x_0 + 4ℎ)]/12h$$,

and at $$x=0$$

$$f'(0)=[−25f(0) + 48f(0.1) − 36f(0.2) + 16f(0.3) − 3f(0.4)]/1.2$$,

but the answer is not correct. Can someone help me?

In your formula you missed an $$f()$$. It should be $$f'(x_0)=[−25f(x_0) + 48f(x_0 + ℎ) − 36f(x_0 + 2ℎ) + 16f(x_0 + 3ℎ) − 3f(x_0 + 4ℎ)]/12h.$$
With this change you get $$f'(0) = (-25\times 0.001+48\times 0.435 -36\times 0.765 +16\times 0.897 -3\times 0.875)/1.2 = 4.202$$