the stiffness matrix
When the finite element method reduces a PDE to a linear system K c = f, the matrix K has a name borrowed from its structural-engineering origins: the stiffness matrix. The name comes from elasticity, where K really did encode how stiffly a structure resists deformation, but the matrix appears for every elliptic PDE. It is the discrete avatar of the differential operator — the operator's action, recorded in a finite grid of numbers.
Its entries are concrete integrals. The (i, j) entry is K_ij = integral over the domain of (grad phi_i) dot (grad phi_j), where phi_i and phi_j are the basis functions sitting at nodes i and j. Because each basis function (a hat) is nonzero only on the few elements touching its node, the integral is zero unless nodes i and j are neighbours — so the vast majority of entries are zero and K is SPARSE, which is what makes solving K c = f tractable for millions of unknowns. K is also symmetric and positive definite whenever the underlying weak form is symmetric and coercive, which guarantees a unique solution and lets you use efficient solvers like Cholesky or conjugate gradients. The companion matrix M_ij = integral of phi_i phi_j (no gradients) is the mass matrix, which appears in time-dependent and eigenvalue problems.
In practice K is never written down as one big integral; it is ASSEMBLED element by element. You compute a small local stiffness matrix for each element (a 3x3 for a linear triangle) and add its entries into the global K at the rows and columns matching that element's nodes. This local-to-global assembly is the computational heart of every FEM code, and its sparsity is everything: a dense matrix of a million unknowns would need 8 terabytes, while the sparse stiffness matrix needs only a few gigabytes and is solved in minutes.
For piecewise-linear elements on a uniform 1D mesh of spacing h, the global stiffness matrix for -u_xx is (1/h) times the tridiagonal matrix with 2 on the diagonal and -1 off it — assembled by stacking each element's local matrix (1/h)[1, -1; -1, 1] onto the two nodes it connects.
Sparse, symmetric, positive definite — and built up element by element.
K is singular (not invertible) until boundary conditions are imposed — the pure Neumann problem leaves a constant undetermined, mirroring the PDE's own compatibility condition. You must pin the solution somewhere before solving.