a finite-difference approximation
A computer cannot take a true derivative — it has no notion of an infinitely small step. So the very first move in solving any PDE numerically is to replace each derivative by something the machine can actually compute: a difference of nearby values divided by the small distance between them. Lay down a grid of points spaced a distance h apart, store the unknown u only at those points, and approximate the slope u_x at a point by how much u changes from one grid point to the next.
Concretely there are three natural choices. The forward difference uses the point to the right: u_x(x) is approximately (u(x+h) - u(x)) / h. The backward difference uses the point to the left: (u(x) - u(x-h)) / h. The central difference straddles the point: (u(x+h) - u(x-h)) / (2h). For a second derivative the standard central formula is u_xx(x) approximately (u(x+h) - 2 u(x) + u(x-h)) / h^2 — three neighbouring values, weighted 1, -2, 1, divided by h^2. Time derivatives are handled the same way, using a time step usually written k or dt. You substitute these formulas into the PDE and what was a differential equation becomes a system of plain algebraic equations linking the grid values.
These approximations are not equal to the derivative — they differ from it by a small error that shrinks as h shrinks. The forward and backward formulas are first-order accurate (error proportional to h), while the central formulas are second-order accurate (error proportional to h^2), which is why central differences are preferred when they apply. The exact size and behaviour of that gap is the truncation error, and controlling it is the entire game: a finite-difference scheme is only trustworthy if its error genuinely vanishes as the grid is refined.
For u(x) = x^2 at x = 1 with h = 0.1, the true derivative is 2. The forward difference gives (1.21 - 1)/0.1 = 2.1; the central difference gives (1.21 - 0.81)/0.2 = 2.0 exactly. The central formula already nails it here because x^2 has no error term beyond second order.
The central difference is one order more accurate than the one-sided forward difference.
Smaller h reduces truncation error but, on a real computer, eventually amplifies rounding error — dividing tiny, nearly-equal differences by a tiny h is numerically dangerous, so there is a best h, not an infinitely small one.