What functions do the weights for the central difference stencils approximate

finite differencesnumerical methods

The central difference formula for the three-point stencil approximating the second derivative is given by
$$ f'' = \frac{f(x+h)-2f(x)+f(x-h)}{h^2}.$$

Similarly, for the five-point stencil, we have
$$ f'' = \frac{-f(x+2h)+16f(x+h)-30f(x)+16(x-h)-f(x-2h)}{12h^2}.$$

We can continue with the seven-point stencil, and so on. Here is a plot of the weights for the three-, five-, and seven-point stencils:enter image description here

It seems that these weights are approximating some wave function(s).

  1. Is there a closed-form expression to generate the weights? What about the weights for the stencils of $f'$ or $f^{(n)})$?
  2. Do these weights converge to some continuous function as the number of points $k$ tends to infinity?

Best Answer

We can approach the problem by using the sinc interpolation formula, thinking of the infinite-order finite-difference method as a spectral method. A band-limited function $y(x)$ can be written as a series based on its values at sample points $y(n h)$ , as $$ y(x) = \sum_{n=-\infty}^{\infty} y(n h)\ \text{sinc} ((x - n h)/h) $$ where the normalized sinc function is defined as $ \text{sinc(u)}=\frac{\sin \pi u}{\pi u} $.

Then we can evaluate $y'(0)$ or $y''(0)$ by differentiating the series, for example for the first derivative, then evaluating it at $x=0$, obtaining $$y'(0) = \sum_{n=-\infty}^{\infty} y(n h) \left[ \frac{ \sin (\pi n)-\pi n \cos (\pi n)}{\pi h n^2} \right]. $$

Then, we see that the coefficients of the expansion of $ y'(0)$ are $-\cos(n \pi) / (h n) = (-1)^{n+1}/(n h)$, since $\sin(n \pi) = 0$, as the $n$ are integers. ($n=0$ is treated separately, by taking the limit as $n\rightarrow 0$, which shows that the coefficient for $n=0$ is 0.) The same argument works for the 2nd derivative.

EDIT:

For completeness, I'll add the result for the 2nd derivative. We have $$y''(x) = \sum_{n=-\infty}^{\infty} y(n h) \left[ -\frac{\left(h^2 \left(\pi ^2 n^2-2\right)-2 \pi ^2 h n x+\pi ^2 x^2\right) \sin \left(\pi \left(n-\frac{x}{h}\right)\right)+2 \pi h (h n-x) \cos \left(\pi \left(n-\frac{x}{h}\right)\right)}{\pi h (h n-x)^3}\right]. $$ Taking $x=0$, assuming $n \ne 0$ and an integer, gives the finite-difference coefficients $-\frac{2 (-1)^n}{h^2 n^2}$. For $n=0$ we take the limit of the coefficient expression at $x=0$ as $n\rightarrow 0$, which gives $ -\frac{\pi^2}{3 h^2} $. These coefficients are just those given in the second Fornberg paper I referenced in the comments, http://colorado.edu/amath/sites/default/files/attached-files/paper.pdf .