optimal way to approximate second derivative Suppose there is a function $f: \mathbb R\to \mathbb R$ and that we only know $f(0),f(h),f'(h),f(2h)$ for some $h>0$. and we can't know the value of $f$ with $100$% accuracy at any other point.
What is the optimal way of approximating $f''(0)$ with the given data?
I'd say that $f''(0)=\frac{f'(h)-f'(0)}{h}+O(h)$ and $f'(0)=\frac{f(h)-f(0)}{h}+O(h)$, therefor we get
$$f''(0)=\frac{f'(h)-\frac{f(h)-f(0)}{h}}{h}+O(h)$$
But that can't be the optimal way since we know $f(2h)$ and i didn't use it at all.
Could someone shed some light?

I believe the answer is something along the lines of:
$$f''(x) \approx \frac{f(x+2h)-2f(x+h)+f(x)}{h^2}$$
For $x=0$, this becomes:
$$f''(0) \approx \frac{f(2h)-2f(h)+f(0)}{h^2}$$
Source: Wikipedia finite Difference.
