The weak form
Finite Elements
The finite element method does not solve a PDE in the form you usually meet it. It rewrites the PDE first, in a way that looks weaker — the equation is asked to hold only "on average" against arbitrary test functions, instead of pointwise — and that weaker form is what gets discretized. The first surprise is that the weaker form is exactly equivalent to the original PDE for smooth solutions; the second is that it has nicer structure for computation. This chapter is about that rewriting.
The strong form
Take 1D Poisson's equation as our running example:
This is the strong form. It demands that be twice differentiable everywhere on and that the equation hold at every single point. That's a stiff demand — and one we'll relax in a moment.
Multiply by a test function and integrate
Pick any function that vanishes at the boundary, — call it a test function. Multiply the strong form by and integrate over the domain:
This is just an integral identity, valid for any classical solution . Now integrate the left-hand side by parts once. The boundary term vanishes because is zero at both endpoints, leaving:
This is the weak form. Read what changed. On the left, the second derivative of is gone — we now have only first derivatives, paired symmetrically between and . On the right, the source is averaged against a test function instead of being matched pointwise. The original PDE was a constraint at every point; the weak form is a constraint for every choice of .
Why the trade is good
Three things changed for the better:
- Lower regularity required. The weak form only needs to be square-integrable, not . That's a much larger function space — and it includes piecewise-linear functions that are non-differentiable at the seams. Those are the basis functions FEM is going to use.
- Symmetric in and . The bilinear form treats both arguments the same way. Discretizing with the same basis for trial and test functions (Galerkin's method) gives a symmetric system matrix — Poisson is self-adjoint, and the weak form preserves that.
- Boundary conditions split cleanly. Dirichlet conditions (specified ) get baked into the function space — we just refuse to consider any that doesn't satisfy them. Neumann conditions (specified at the boundary) appear naturally from the boundary term we threw away in integration by parts; with a non-zero at the boundary they would contribute. We say Dirichlet is essential and Neumann is natural — and the labels reflect how each one enters the formulation.
From the weak form to a linear system
The weak form is still infinite-dimensional — ranges over an entire function space. To discretize, we restrict both and to a finite-dimensional subspace with basis . Write the discrete solution as a linear combination:
Plug into the weak form, take for each , and the integral collapses into something finite:
That's a linear system with
Solve for the coefficient vector and you have your discrete solution . The matrix is called the stiffness matrix and the vector is the load vector — both names are vestiges of FEM's origin in structural mechanics.
What this leaves us to design: the basis functions . The whole personality of an FEM implementation lives in that choice. Hat functions on a one-dimensional mesh — what the next chapter builds — are the simplest non-trivial choice, and they make sparse, symmetric, positive-definite, and tridiagonal. Hard to ask for a friendlier matrix.
Where this is going
Chapter 2 builds a 1D mesh and the corresponding hat-function basis, with a visualizer that lets you refine the mesh and see the basis adapt. Chapter 3 picks up where this one left off — it computes the integrals and in closed form per element, assembles them into the global and , solves the system, and overlays on the analytic so you can watch the FEM solution converge as the mesh refines.