Good morning.
I need to approximate the second derivative for a discrete function with only few points. My first intuition was to use the traditionnal formula: approximation of the second derivative
Unfortunately my available points are not at symmetrical distance from to the other. In consequence I have clearly doubtful results, with positivesecond derivative while my function is concave.
My question is, do have I to modify the coefficients in my formula to take into account the asymmetry between my two points ? And if I have to do so, which weights to use ? If my intuition is false, what would you recommend to me to do to take into account the assymetry ?
Thank you very much
Disclaimer: we are dealing with approximations here; answers are neither unique nor exact, but consistent.
Let us say you want to approximate $$f'(9) \approx \dfrac{f(13) -f(5)}{13-5} \text{ as in }f'(x_0) \approx \dfrac{f(x_0+h) -f(x_0-h)}{2h} \text{ where }x_0=9, h=4.$$ Then, approximate $f'(10)$ either by $$f'(10) \approx \dfrac{f(10) -f(5)}{10-5} \text{ as in } f'(x_0) \approx \dfrac{f(x_0) -f(x_0-h)}{h} \text{ where } x_0=10, h=5;$$ or by $$f'(10) \approx \dfrac{f(13) -f(10)}{13-10} \text{ as in } f'(x_0) \approx \dfrac{f(x_0+h) -f(x_0)}{h} \text{ where } x_0=10, h=3.$$ So then you can approximate $$f''(10) \approx \dfrac{f'(10) -f'(9)}{10-9} \text{ as in } g'(x_0) \approx \dfrac{g(x_0) -g(x_0-h)}{h} \text{ where } x_0=10, h=1, g=f'.$$