GO-V.ORG
As seen in

Five-point stencil

In numerical analysis, given a square grid in one or two dimensions, the five-point stencil of a point in the grid is a stencil made up of the point itself together with its four "neighbors".[src] It is used to write finite difference approximations to derivatives at grid points.[src] It is an example of numerical differentiation.[src]

In numerical analysis, given a square grid in one or two dimensions, the five-point stencil of a point in the grid is a stencil made up of the point itself together with its four "neighbors".[src] It is used to write finite difference approximations to derivatives at grid points.[src] It is an example of numerical differentiation.[src] ==In one dimension== In one dimension, if the spacing between points in the grid is h, then the five-point stencil of a point x in the grid is \{x-2h, x-h, x, x+h, x+2h\}.[src] ===1D first derivative=== The first derivative of a function f of a real variable at a point x can be approximated using a five-point stencil as: f'(x) \approx \frac{-f(x+2 h)+8 f(x+h)-8 f(x-h)+f(x-2h)}{12 h} The center point f(x) itself is not involved, only the four neighboring points.[src] ====Derivation==== This formula can be obtained by writing out the four Taylor series of f(x \pm h) and f(x \pm 2h) at the point a , up to terms of h 3 (or up to terms of h 5 to get an error estimation as well), evaluating each series at a = x \mp h and a = x \mp 2h respectively (to get everything in common terms of f^{(k)}(x) ), and solving this system of four equations to get f ′(x).[src] Actually, we have at points x + h and x − h: f(x \pm h) = f(x) \pm h f'(x) + \frac{h^2}{2}f(x) \pm \frac{h^3}{6} f^{(3)}(x) + O_{1\pm}(h^4).[src] \qquad (E_{1\pm}).[src] Evaluating (E_{1+})-(E_{1-}) gives us f(x+h) - f(x-h) = 2hf'(x) + \frac{h^3}{3}f^{(3)}(x) + O_1(h^4).[src] \qquad (E_1).[src] The residual term O 1 (h 4 ) should be of the order of h 5 instead of h 4 because if the terms of h 4 had been written out in (E 1+ ) and (E 1− ), it can be seen that they would have canceled each other out by .[src] But for this calculation, it is left like that since the order of error estimation is not treated here (cf below).[src] Similarly, we have f(x \pm 2h) = f(x) \pm 2h f'(x) + \frac{4h^2}{2!} f(x) \pm \frac{8h^3}{3!} f^{(3)}(x) + O_{2\pm}(h^4).[src] \qquad (E_{2\pm}) and (E_{2+}) - (E_{2-}) gives us f(x+2h) - f(x-2h) = 4hf'(x) + \frac{8h^3}{3}f^{(3)}(x) + O_2(h^5).[src] \qquad (E_2).[src] In order to eliminate the terms of ƒ (3) (x), calculate 8 × (E 1 ) − (E 2 ) 8f(x+h) - 8f(x-h) - f(x+2h) + f(x-2h) = 12h f'(x) + O(h^5) thus giving the formula as above.[src] Note: the coefficients of f in this formula, (8, -8,-1,1), represent a specific example of the more general Savitzky–Golay filter.[src] ====Error estimate==== The error in this approximation is of order h  4 .[src] That can be seen from the expansion \frac{-f(x+2 h)+8 f(x+h)-8 f(x-h)+f(x-2h)}{12 h}=f'(x)-\frac{1}{30} f^{(5)}(x) h^4+O(h^5) which can be obtained by expanding the left-hand side in a Taylor series.[src] Alternatively, apply Richardson extrapolation to the central difference approximation to f'(x) on grids with spacing 2h and h.[src] ===1D higher-order derivatives=== The centered difference formulas for five-point stencils approximating second, third, and fourth derivatives are \begin{align} f(x) &\approx \frac{-f(x+2 h)+16 f(x+h)-30 f(x) + 16 f(x-h) - f(x-2h)}{12 h^2} \\[1ex] f^{(3)}(x) &\approx \frac{f(x+2 h)-2 f(x+h) + 2 f(x-h) - f(x-2h)}{2 h^3} \\[1ex] f^{(4)}(x) &\approx \frac{f(x+2 h)-4 f(x+h)+6 f(x) - 4 f(x-h) + f(x-2h)}{h^4} \end{align} The errors in these approximations are O(h ), O(h ) and O(h ) respectively.[src] ===Relationship to Lagrange interpolating polynomials=== As an alternative to deriving the finite difference weights from the Taylor series, they may be obtained by differentiating the Lagrange polynomials \ell_j(\xi) = \prod_{i=0,\, i\neq j}^{k} \frac{\xi-x_i}{x_j-x_i}, where the interpolation points are x_0 = x-2h,\quad x_1 = x-h,\quad x_2 = x,\quad x_3 = x+h,\quad x_4 = x+2h.[src] Then, the quartic polynomial p_4(x) interpolating at these five points is p_4(x) = \sum_{j=0}^4 f(x_j) \ell_j(x) and its derivative is p_4'(x) = \sum_{j=0}^4 f(x_j) \ell'_j(x).[src] So, the finite difference approximation of at the middle point is f'(x_2) = \ell_0'(x_2) f(x_0) + \ell_1'(x_2) f(x_1) + \ell_2'(x_2) f(x_2) + \ell_3'(x_2) f(x_3) + \ell_4'(x_2) f(x_4) + O(h^4) Evaluating the derivatives of the five Lagrange polynomials at gives the same weights as above.[src] This method can be more flexible as the extension to a non-uniform grid is quite straightforward.[src] ==In two dimensions== In two dimensions, if for example the size of the squares in the grid is h by h, the five point stencil of a point (x, y) in the grid is \{(x-h, y), (x, y), (x+h, y), (x, y-h), (x, y+h)\}, forming a pattern that is also called a quincunx.[src] This stencil is often used to approximate the Laplacian of a function of two variables: \nabla^2 f(x,y) \approx \frac{f(x-h,y) + f(x+h,y) + f(x,y-h) + f(x,y+h) - 4f(x,y)}{h^2}.[src] The error in this approximation is O(h  2 ), which may be explained as follows: From the 3 point stencils for the second derivative of a function with respect to x and y: \begin{align} \frac{\partial ^2 f}{\partial x^2} &= \frac{f\left(x + \Delta x,y\right) + f\left(x - \Delta x,y\right) - 2f(x,y)}{\Delta x^2} - 2\frac{f^{(4)}(x,y)}{4!} \Delta x^2 + \cdots \\[1ex] \frac{\partial ^2 f}{\partial y^2} &= \frac{f\left(x, y + \Delta y\right) + f\left(x, y - \Delta y\right) - 2f(x,y)}{\Delta y^2} - 2\frac{f^{(4)}(x,y)}{4!} \Delta y^2 + \cdots \end{align} If we assume \Delta x = \Delta y = h : \begin{align} \nabla^2 f &= \frac{\partial ^2 f}{\partial x^2} + \frac{\partial ^2 f}{\partial y^2} \\[1ex] &= \frac{f\left(x + h,y\right) + f\left(x - h,y\right) + f\left(x, y + h\right) + f\left(x, y - h\right) - 4f(x,y)}{h^2} - 4 \frac{f^{(4)}(x,y)}{4!}h^2 + \cdots \\[1ex] &= \frac{f\left(x + h,y\right) + f\left(x - h,y\right) + f\left(x, y + h\right) + f\left(x, y - h\right) - 4f(x,y)}{h^2} + O\left(h^2\right)\\ \end{align} ==See also== Nine-point stencil Stencil (numerical analysis) Symmetric difference quotient ==References== .[src] Ninth printing.[src] Table 25.2.[src]

33 sentences · 33 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Five-point stencil." encyclopegia.org, 2026, https://encyclopegia.org/wiki/five-point-stencil. Accessed 03 December 2026.

Chicago

"Five-point stencil." encyclopegia.org. Accessed December 3, 2026. https://encyclopegia.org/wiki/five-point-stencil.

APA

encyclopegia.org. (2026). Five-point stencil. Retrieved December 3, 2026, from https://encyclopegia.org/wiki/five-point-stencil

Accessed December 3, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Five Peaks Challenge

stub · references available

Breezy Point

stub · references available

Center Point

stub · references available

five-card stud

stub · references available

central point

stub · references available

Deception Point

stub · references available

Point Arguello

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1365912241 · 0.5 · snapshot enwiki-001365912241

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.