What Is the 9-Point Finite-Difference Stencil for the Laplacian?
At a glance
- 1. Set the grid spacing
Assume a uniform square grid with spacing h in both coordinate directions.
- 2. Place the neighbors
Use the center point, its four horizontal and vertical neighbors, and its four diagonal neighbors.
- 3. Apply the weights
Weight the center by minus twenty, axial neighbors by four, and diagonal neighbors by one; divide by six h squared.
- 4. Check the accuracy
The formula is second-order accurate and has a rotationally symmetric leading error term.
For a smooth function sampled on a uniform square grid of spacing , the standard 9-point stencil approximates the two-dimensional Laplacian, . It uses the grid point itself, four neighbors sharing an edge with it, and four diagonal neighbors.
The formula is useful when you want a compact discrete Laplacian with a more directionally balanced error than the familiar 5-point stencil. It is still a second-order approximation, not a fourth-order one.
The 9-point formula
Write , where neighboring grid points are separated by in each coordinate. Then
The corresponding weights are arranged as
The center coefficient is negative because the Laplacian measures curvature: for a function with a local minimum, the discrete value is typically positive. If your equation uses the negative Laplacian, , reverse all the signs.
Why these coefficients work
Taylor-expand the values at the neighboring points around . The sum of the four axial values contributes to the first relevant terms; the sum of the four diagonal values contributes . Therefore, multiplying the axial sum by 4 and adding the diagonal sum gives at leading order. Subtracting cancels the constant term, and division by leaves the Laplacian.
Keeping the next nonzero Taylor terms gives
for a sufficiently smooth function. Here . The leading error is thus rotationally symmetric: it involves the same combination of fourth derivatives as applying the Laplacian twice. This is the main accuracy advantage over the standard 5-point stencil, whose leading error depends separately on and .
The formula is second-order accurate because its leading error is proportional to . The symmetry does not make it fourth-order accurate.
Worked example
Take and evaluate the stencil at the origin. The exact Laplacian is . At the origin the center value is 0, every axial neighbor has value , and every diagonal neighbor has value . Substitution gives
So the stencil reproduces the exact Laplacian for this quadratic function. This check also confirms the denominator and the distinction between the axial and diagonal weights.
Relation to the 5-point stencil
The common 5-point formula uses only the center and four axial neighbors:
Both formulas are second-order accurate. The 9-point formula incorporates diagonal information and has a more isotropic leading truncation error, which can be helpful when the solution or geometry has no preferred grid direction. The best choice still depends on the equation, boundary treatment, and desired discrete properties.
Common mistakes
- Using the 5-point denominator: the 9-point weights shown here require division by , not .
- Giving diagonal and axial neighbors the same weight: axial neighbors have coefficient 4; diagonals have coefficient 1.
- Calling it fourth-order accurate: the displayed approximation has an error. Some higher-order Poisson schemes use wider or modified stencils, or combine a discrete Laplacian with a correspondingly weighted right-hand side; those are different formulas.
- Applying square-grid weights to unequal spacings: this expression assumes the same spacing in both directions. A rectangular grid needs adjusted coefficients or a separately derived stencil.
- Forgetting boundary values: near a domain boundary, some neighbors may lie outside the domain. Their values must be supplied or handled through an appropriate boundary-condition or ghost-point treatment; the interior stencil alone does not specify that treatment.
References
- Randall J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations
- John C. Strikwerda, Finite Difference Schemes and Partial Differential Equations
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.