the five-point Laplacian
Many of the most important PDEs — steady heat, electric potential, the shape of a stretched drumhead — are built around one operator, the Laplacian, which in two dimensions is the sum of the second derivatives in x and in y: u_xx + u_yy. Intuitively it measures how much a point's value differs from the average of its surroundings: a point sitting in a dip has a positive Laplacian, a point on a bump has a negative one. To compute with it on a grid, you need a stencil for this 'difference from the neighbourhood', and the standard one is the five-point Laplacian.
It is built by adding the one-dimensional second-derivative stencil in x to the one in y. On a uniform grid with the same spacing h in both directions, the formula at node (i, j) is (u_{i-1,j} + u_{i+1,j} + u_{i,j-1} + u_{i,j+1} - 4 u_{i,j}) / h^2. The picture is a plus sign: the centre node, weighted -4, and its four immediate neighbours (north, south, east, west), each weighted +1, all over h^2. Read the numerator as 'sum of the four neighbours minus four times the centre' — that is four times (average of neighbours minus centre), so the stencil literally measures how far the centre lags below its neighbourhood average. Its truncation error is O(h^2).
This little plus is the workhorse of grid-based PDE solving. Discretizing Poisson's equation u_xx + u_yy = f on an N-by-N grid with the five-point stencil produces a large sparse linear system A u = b, where each row of A has just five nonzero entries (the stencil weights) — exactly the kind of sparse system that iterative solvers, multigrid, or fast Poisson solvers attack. Wider, higher-order versions exist (a nine-point stencil reaching O(h^4)), and the diagonal neighbours are deliberately left out of the basic five-point form, which is why it captures u_xx + u_yy cleanly but is only second-order accurate.
On a grid where a node sits at value 1 surrounded by neighbours 0, 0, 0, 0, the five-point Laplacian gives (0+0+0+0 - 4*1)/h^2 = -4/h^2 — strongly negative, signalling a sharp bump that diffusion will flatten. A flat region where centre and neighbours all equal 5 gives (20 - 20)/h^2 = 0, the Laplacian of a constant.
A plus-shaped stencil: four neighbours weighted +1, centre weighted -4.
On a UNIFORM square grid the basic five-point Laplacian leaves the diagonal neighbours out — that is correct for u_xx + u_yy but means it is only second-order and is not rotationally symmetric, so it can introduce a slight directional bias. If the x and y spacings differ, you must weight the two one-dimensional parts separately; the symmetric form above assumes equal spacing.