the mass matrix
When you discretize a time-dependent PDE like heat flow or a vibrating drum, two matrices appear side by side. One measures how the spatial operator (the Laplacian) couples nodes — that is the stiffness matrix. The other measures simply how much each shape function overlaps each other — how much 'stuff' (mass, heat capacity, inertia) sits on the connections between nodes. That second one is the mass matrix.
Its entries are M_ij = integral of (phi_i phi_j) over the domain: the inner product of two shape functions, with no derivatives at all. Like the stiffness matrix it is sparse, symmetric, and positive definite, and it is assembled element by element. The mass matrix is what multiplies the time-derivative term: a method-of-lines discretization of the heat equation u_t = u_xx becomes the system of ODEs M c'(t) + K c(t) = F, where M weights the rate of change of the nodal values and K the spatial coupling. In a vibration problem M c'' + K c = 0, the eigenvalue problem K v = omega^2 M v gives the natural frequencies — M genuinely encodes inertia.
Here is a practical honesty. The 'consistent' mass matrix above is not diagonal, so each implicit or explicit time step requires solving a linear system with M, which is extra work. A common trick is mass LUMPING: replace M by a diagonal matrix whose entries are the row sums of M, as if all the mass were collapsed onto the nodes. Lumping makes explicit time-stepping trivially cheap (dividing by a diagonal) and can improve stability, at the cost of some accuracy. Whether to lump is a real engineering decision — consistent mass is more accurate for the lowest vibration modes, lumped mass is faster and often more robust for wave propagation and explicit dynamics.
For linear elements on spacing h, the element mass matrix has rows (h/6)(2, 1) and (h/6)(1, 2), assembling to the tridiagonal M = (h/6) * tridiag(1, 4, 1). Lumping it (summing each row onto the diagonal) gives the diagonal h * diag(1,...,1) — far cheaper to invert in an explicit scheme.
M weights the time-derivative term; lumping trades a little accuracy for a diagonal, trivially invertible matrix.
The consistent mass matrix is not diagonal, so explicit time-stepping still needs a solve with M unless you lump it. Lumping is convenient and stabilizing for wave problems but is an approximation — it is not 'free' accuracy.