Use Taylor's expansion to derive sixth order method (i.e $\mathcal{O}(h^6)$) for approximating the second derivative ($f '' (x_0)$ ) for given sufficiently smooth function $f(x)$.
I have this things in my mind:
- I can use this seven points: $x_0 - 3h,x_0 - 2h, x_0 - h, x_0, x_0 + h, x_0 + 2h, x_0 + 3h$
$$ f(x_0 + h) = f(x_0) + (h) f'(x_0) + \frac{(h)^2}{2} f''(x_0) + \frac{(h)^3}{3!} f'''(x_0) + \frac{(h)^4}{4!} f''''(x_0) + \frac{(h)^5}{5!} f'''''(x_0) + \frac{(h)^6}{6!}f''''''(x_0) + \frac{(h)^7}{7!}f'''''''(\xi) $$
$$ f(x_0 + 2h) = f(x_0) + (2h) f'(x_0) + \frac{(2h)^2}{2} f''(x_0) + \frac{(2h)^3}{3!} f'''(x_0) + \frac{(2h)^4}{4!} f''''(x_0) + \frac{(2h)^5}{5!} f'''''(x_0) + \frac{(2h)^6}{6!}f''''''(x_0) + \frac{(2h)^7}{7!}f'''''''(\xi) $$
$$ f(x_0 + 3h) = f(x_0) + (3h) f'(x_0) + \frac{(3h)^2}{2} f''(x_0) + \frac{(3h)^3}{3!} f'''(x_0) + \frac{(3h)^4}{4!} f''''(x_0) + \frac{(3h)^5}{5!} f'''''(x_0) + \frac{(3h)^6}{6!}f''''''(x_0) + \frac{(3h)^7}{7!}f'''''''(\xi) $$
$$ f(x_0 - h) = f(x_0) - (h) f'(x_0) + \frac{(h)^2}{2} f''(x_0) - \frac{(h)^3}{3!} f'''(x_0) + \frac{(h)^4}{4!} f''''(x_0) - \frac{(h)^5}{5!} f'''''(x_0) + \frac{(h)^6}{6!}f''''''(x_0) - \frac{(h)^7}{7!}f'''''''(\xi) $$
$$ f(x_0 - 2h) = f(x_0) - (2h) f'(x_0) + \frac{(2h)^2}{2} f''(x_0) - \frac{(2h)^3}{3!} f'''(x_0) + \frac{(2h)^4}{4!} f''''(x_0) - \frac{(2h)^5}{5!} f'''''(x_0) + \frac{(2h)^6}{6!}f''''''(x_0) - \frac{(2h)^7}{7!}f'''''''(\xi) $$
$$ f(x_0 - 3h) = f(x_0) - (3h) f'(x_0) + \frac{(3h)^2}{2} f''(x_0) - \frac{(3h)^3}{3!} f'''(x_0) + \frac{(3h)^4}{4!} f''''(x_0) - \frac{(3h)^5}{5!} f'''''(x_0) + \frac{(3h)^6}{6!}f''''''(x_0) - \frac{(3h)^7}{7!}f'''''''(\xi) $$
- Is there any shortcut in matlab or julia to find this?