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:


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.