When there is no formula, build a grid
By now you have a toolbox full of exact solutions: d'Alembert's formula, separation of variables, the heat kernel, Green's functions. They are beautiful, and they are also rare. Change the domain to an awkward shape, let a coefficient vary with position, or add a mild nonlinearity, and the clean formulas dry up. The honest situation for most real PDEs is that no closed expression for the answer exists — and yet we still need numbers. The numerical methods rung is about producing those numbers reliably, and finite differences are the oldest and most transparent way in.
The idea is disarmingly simple. Instead of seeking the smooth function u(x,t) everywhere, lay down a regular grid: positions x_j = j h spaced a distance h apart, and times t_n = n k spaced a step k apart. We will only ever ask for the value of u at these crossing points, and we write that grid value as U_j^n, an approximation to the true u(x_j, t_n). A continuous unknown defined on a whole region has become a finite table of numbers — something a computer can actually hold. The art is in the rule that fills the table, and that rule comes from replacing each derivative in the PDE with a finite-difference approximation.
A derivative is a slope; a difference is a chord
Start from the very definition you learned in single-variable calculus: the derivative u_x at a point is the limit of a slope, (u(x + h) - u(x)) / h as h shrinks to zero. The finite-difference trick is to refuse the limit and just stop at a small but real h. That gives the forward difference (U_{j+1} - U_j) / h, an honest estimate of u_x using the value at j and its right neighbour. Geometrically, the true derivative is the slope of the tangent line at x_j, while the forward difference is the slope of the chord joining two nearby points on the curve — close, but not the same.
By the same move there is a backward difference (U_j - U_{j-1}) / h, leaning on the left neighbour, and a centred difference (U_{j+1} - U_{j-1}) / (2h), which averages both sides. For the second derivative u_xx — the one that runs the heat equation — the natural choice combines three points in a row: (U_{j+1} - 2 U_j + U_{j-1}) / h^2. Read it as the value to the right plus the value to the left minus twice the middle, all scaled by h^2; it is large and positive exactly when the middle point sits in a dip below its neighbours, which is just the cupped-upward picture of u_xx you already trust. Each such recipe is a little stencil: a fixed pattern of grid points that the formula reaches out to touch.
forward u_x ~ ( U_{j+1} - U_j ) / h
backward u_x ~ ( U_j - U_{j-1} ) / h
centred u_x ~ ( U_{j+1} - U_{j-1} ) / (2h)
second u_xx ~ ( U_{j+1} - 2 U_j + U_{j-1} ) / h^2
stencil for u_xx: o ---- o ---- o
j-1 j j+1Taylor's theorem is the honest accountant
How wrong is a chord compared to a tangent? Taylor's theorem answers exactly, and this is the heart of the whole subject. Expand the true solution about x_j: u(x_j + h) = u + h u_x + (h^2 / 2) u_xx + (h^3 / 6) u_xxx + ... where every derivative is evaluated at x_j. Plug this into the forward difference and the leading u and the first h u_x term reproduce u_x exactly; everything left over is the error. What remains is (h / 2) u_xx plus smaller pieces — the truncation error, the gap between the difference formula and the derivative it imitates.
The size of that leading leftover is the order of accuracy. The forward difference errs by roughly (h/2) u_xx, a term proportional to h, so it is first-order accurate: halve h and the error roughly halves. Now do the same accounting for the centred difference, and a small miracle occurs — the symmetric expansions of u(x_j + h) and u(x_j - h) make the u_xx terms cancel, and the surviving error is proportional to h^2. The centred difference is second-order: halve h and the error drops by a factor of four. Same number of points reached, but a far better bargain, purely because the symmetry kills the leading error term.
From a single derivative to a whole scheme
Now assemble the pieces into a method for an actual PDE. Take the heat equation u_t = k u_xx. Replace the time derivative by a forward difference in t and the space derivative by the centred second difference in x, and you get the classic FTCS scheme — Forward Time, Centred Space. Solving for the only unknown at the new time level gives an explicit update: U_j^{n+1} = U_j^n + (k_diff k / h^2) (U_{j+1}^n - 2 U_j^n + U_{j-1}^n). Read it aloud: the new temperature at a point is the old one nudged toward the average of its neighbours, exactly the 'heat floods into dips' intuition, now turned into arithmetic a computer marches forward step by step.
- Lay down the grid: choose space step h and time step k, and set U_j^0 from the initial data, U_j^0 = f(x_j).
- Pick a stencil for each derivative: forward in time for u_t, the three-point centred second difference for u_xx.
- Substitute into u_t = k u_xx and solve algebraically for the single new-time value U_j^{n+1}.
- Sweep across all interior j to fill row n+1 from row n; impose the boundary values at the two ends.
- Repeat, marching n forward until you reach the final time you care about.
This pattern — discretise space first to turn the PDE into a big coupled system of ordinary differential equations in time, then step that forward — is so useful it has a name, the method of lines. Each grid point traces a 'line' through time, and the spatial stencil tells neighbours how to talk to one another. It is worth pausing to see what we have done: a partial differential equation, the thing that began this whole subject, has been reduced to an ODE system you already know how to integrate, and then to pure arithmetic on a table of numbers.
Small truncation error is necessary, not sufficient
A scheme whose truncation error vanishes as h and k shrink is called consistent — it really is approximating the right PDE and not some neighbour. Consistency is the property truncation error certifies, and you might hope it is the whole story. It is not, and this is the single most important honesty of the rung. A scheme can have a beautifully small truncation error at every point and still produce total garbage, because tiny per-step errors can amplify and feed on themselves as the marching repeats. FTCS for the heat equation is the textbook cautionary tale: take a time step k that is too large relative to h^2 and the computed solution erupts into wild oscillations that double every step, even though each individual difference is a faithful O(h^2) approximation.
The missing ingredient is stability — a guarantee that errors stay bounded rather than blowing up as the steps pile on. Consistency plus stability together give convergence, the genuine prize: that U_j^n actually tends to the true u(x_j, t_n) as the grid refines, recovering the classical solution in the limit. That three-way relationship is the celebrated equivalence theorem of this subject, and the next guide is devoted entirely to it; for now the lesson is that truncation error is exactly one of two pillars. It tells you the scheme is aimed at the right target — but says nothing about whether the marching keeps the answer from exploding.
There is one more subtlety worth naming, because it haunts the rest of the rung. The error a scheme actually commits often looks as if it came from a slightly different PDE — the so-called modified equation. A first-order upwind scheme for advection, for instance, behaves as though it were solving an advection equation with a small extra diffusion term bolted on, producing artificial smearing called numerical diffusion. The truncation-error expansion is exactly what reveals this: the leading leftover term, the same h u_xx we computed above, is literally a diffusion that the true equation never had. Truncation error is therefore not just a number to bound — read properly, it tells you the character of the mistake your grid is making.