Finite element method Created 2026-09-28 Updated 2026-10-14
The finite element method replaces an infinite-dimensional weak formulation by finitely many unknowns attached to a finite element mesh. Simple local functions, often piecewise polynomial functions, join to form a global approximation. The attraction is that each finite element can be integrated separately, while the assembled equations enforce a global balance. A piecewise-linear hat function only meets its immediate neighbors, so a large problem can have a sparse matrix rather than a dense one. Gilbert Strang's MIT lecture develops this connection from the one-dimensional weak formulation through local hats to the stiffness matrix and load integrals.[ref]
For the conforming Galerkin method, let be a real Hilbert space, a bounded coercive bilinear form, and a bounded linear functional. Given a conforming finite element space , the continuous and discrete problems are
Writing in a basis of gives the linear system
Here is the stiffness matrix and is the vector of loads tested against the basis functions. The Galerkin method uses the same trial and test space in this construction. Finite element methods also use the Petrov-Galerkin method, with different trial and test spaces; testing against the trial space is therefore a property of this construction, rather than a definition of every finite element method.
The finite element solution of the one-dimensional Poisson equation below gives every entry explicitly. Refining the finite element mesh then improves the approximation by adding local degrees of freedom. For a symmetric coercive bilinear form, Galerkin orthogonality makes the discrete solution the best approximation in the energy norm; the geometry of orthogonal projection explains why this local construction yields a globally meaningful answer.
Consider the Poisson equation on an interval with homogeneous Dirichlet boundary conditions:
Two integrations and the endpoint conditions give the exact solution . To approximate it, multiply by a test function that vanishes at both endpoints. Integration by parts gives
The boundary term is zero. Thus the weak formulation is to find such that
The zero-trace Sobolev space consists of square-integrable functions with square-integrable weak derivatives and zero endpoint values in their continuous representatives; it does not require a classical second derivative. This is why continuous piecewise linear functions are admissible despite corners. The Poincaré inequality makes a coercive bilinear form on . Strang derives this one-dimensional weak formulation, the piecewise-linear hat functions, and their load and derivative-product integrals in the cited lecture; its endpoint example uses a free left endpoint, while both endpoints here are fixed.[ref]
Take the uniform finite element mesh , , with . The continuous trial space is
Here means polynomials of degree at most one on each interval. This is a conforming finite element space in , with interior piecewise-linear hat functions as a basis. Their endpoint values enforce the Dirichlet boundary conditions automatically. Set and test the weak formulation against each :
Each interior hat has two slopes and , each over a length . Its squared derivative therefore integrates to . Adjacent hats have opposite slopes on their one shared interval, giving . All other derivative products vanish. The stiffness matrix is the tridiagonal matrix
The load is the area of a triangle of base and height one, including hats next to the boundary. Boundary hats are omitted because the boundary values are prescribed. The piecewise-linear hat function article explains how the same entries arise by adding local two-node contributions.
With four mesh intervals, , there are three unknowns:
For example, the first row gives and the middle gives . The coefficients are the nodal values . At , linear interpolation gives , whereas : exactness at the nodes still leaves a visible error between them.
In this model the Galerkin method solution equals the nodal approximation obtained by linear interpolation on any finite element mesh. Indeed, on each interval , is the average of and is constant. Therefore . Summing proves Galerkin orthogonality for , and uniqueness gives . This argument relies on the constant diffusion coefficient, conformity and exact integration; nodal exactness is not a general promise for finite element methods with other operators or integration rules.
On a uniform mesh, direct subtraction of the chord from the parabola gives, on every element of length ,
The largest value error is at an element midpoint. Its size and the energy norm error are exactly
Thus gives and . With eight elements, , these become and . Halving the mesh spacing quarters the maximum value error but only halves the energy norm error: values and slopes converge at different rates. The figure shows the small value error at its own scale, where the four-to-one reduction becomes clear.
Figure 1.
Exact Poisson parabola and continuous piecewise-linear finite element solutions on four and eight intervals, with midpoint errors shown separately
. Details.
Multigrid method Created 2026-10-06 Updated 2026-10-14
A multigrid method solves a linear system by combining local relaxation with coarse-grid correction on a hierarchy of meshes. The key is to divide the work by scale: a suitable relaxation removes rapidly oscillating approximation error, while coarse-grid correction addresses slowly varying approximation error that relaxation barely changes. A broad error hump occupies many fine-grid points but fewer coarse-grid points; it becomes easier to resolve by relaxation after enough coarsening. This complementary action is why multigrid methods are useful for large finite difference method and finite element method systems.
For a concrete model, take the one-dimensional Poisson equation with homogeneous Dirichlet boundary conditions:
Use interior points , , and the centered finite difference system
Thus is a symmetric matrix and a positive-definite matrix. The minus sign in fixes this positive convention; changing both and to their negatives leaves the relaxation update unchanged. For , the linear system has the exact discrete solution , since the centered finite difference is exact on this quadratic polynomial. In general, the exact discrete solution need not equal the sampled continuous solution: solving the linear system removes algebraic approximation error, not the global discretization error.
Let solve , let be the current approximation, and define the signed approximation error . The linear-system residual is , so . In particular, a linear-system residual is available without knowing ; it supplies the right-hand side for a correction equation. With , a weighted Jacobi method sweep is
The sine eigenvectors shared by and the iteration matrix are , . Their eigenvalues are
For , one weighted Jacobi method sweep with multiplies the lowest Fourier frequency mode by about , but the highest Fourier frequency mode by about . Four sweeps retain about of the first amplitude and of the second. The sign reversal of the second amplitude is harmless when its magnitude shrinks. However, the plain Jacobi method, , has factor : at it is about . A nearly alternating mode near the grid's Nyquist limit therefore persists almost as strongly as the smoothest mode. Plain Jacobi method convergence on a fixed Dirichlet boundary condition grid does not imply effective smoothing.[ref] The high-frequency smoothing factor of weighted Jacobi is uniformly at most for and ; the exact finite-grid high-frequency Jacobi smoothing optimum distinguishes this convenient uniform choice from the finite-grid optimum.[ref]
Figure 1.
Analytic Poisson error modes: weighted Jacobi damps short wavelengths while plain Jacobi struggles near the Nyquist limit
. Details.
One two-grid cycle applies a few weighted Jacobi method sweeps, computes the linear-system residual, performs coarse-grid correction, and applies a few more sweeps. The first relaxation makes the remaining approximation error easier to represent on a coarse mesh; the last relaxation damps oscillatory components left after the transferred correction. In a geometric multigrid V-cycle, replace the expensive exact coarse solve by one recursive cycle on the coarse correction equation, starting its correction from zero. Repeat until a tiny coarsest linear system can be solved directly, then return through the levels by adding each interpolated correction and post-smoothing. The descent and return give the cycle its V shape.[ref]
For this one-dimensional model, fixed sweep counts and bounded local finite difference and transfer work give a geometric multigrid V-cycle cost proportional to , hence in Big O notation. A fixed error reduction also needs a contraction factor bounded below one independently of ; per-cycle work alone does not establish that. Starting from arbitrary approximation error and demanding a relative reduction generally adds a factor proportional to in the cycle count. Full multigrid uses coarse solutions as initial guesses on successively finer meshes to target the global discretization error efficiently. The two-grid Poisson factor with weighted Jacobi illustrates favorable convergence for this model. Other partial differential equations, strong anisotropy, or poorly chosen coarse spaces and relaxation can defeat these choices; a linear-work guarantee for arbitrary linear systems does not follow.
A historical example of the multilevel viewpoint is Achi Brandt's April 1977 paper, which analyzes adaptive meshes and reports numerical experiments on linear and nonlinear boundary value problems. This is a documented development of the approach, not a claim that the paper was its first invention.[ref] The figure above is generated from the displayed eigenvalues, with lines joining discrete nodes; it contains no experimental measurements.
Let and , the closure of smooth compactly supported functions in the Sobolev space . Its elements have zero boundary trace. Set
The form is symmetric and continuous by Cauchy-Schwarz. For a smooth function with zero boundary values, gives after integration. Density extends this Poincaré inequality to . Therefore the gradient norm makes complete and equivalent to its usual norm, with
All the hypotheses of part (a) hold. Green's identity identifies the weak solution of the Dirichlet problem as
For smooth this is with zero boundary values; in general it defines the unique weak solution without requiring pointwise second derivatives.
For the Ritz method, choose a finite-dimensional conforming space with basis and put . Minimize in the coefficients. Its derivative in each basis direction gives the finite element method equations
The stiffness matrix is symmetric positive definite: for a nonzero coefficient vector , the corresponding basis combination is nonzero and . Hence the Ritz system has a unique solution.
For example, triangulate the square and use continuous piecewise-affine nodal basis functions at the interior vertices, with boundary vertex values fixed to zero. On a triangle of area , let be its barycentric basis functions. If its counterclockwise vertices are , define and cyclically. Then , giving the directly assemblable element matrices and loads
If is constant on , ; otherwise integrate or quadrature the load. Assemble by adding element contributions with the same global vertex labels and eliminate prescribed boundary coefficients. Only overlapping basis supports interact, making sparse. This gives the Ritz-Galerkin equivalence for a symmetric coercive form in a practical finite element form.
The eigenvalue stability analysis of a finite difference method reduces a linear evolution discretization to its modal behavior, but it must retain the norm and the dependence on the mesh. For a homogeneous system obtained by the method of lines, , the solution is . A one-step time discretization gives ; for a Runge-Kutta method, where its stage matrices are invertible, . With a multistep method one instead uses an amplification matrix on the augmented vector of several time levels.
The relevant finite-time stability estimate is
with independent of the refining spatial mesh and allowed time steps. Similarly, semidiscrete stability requires for . The norm should represent the continuum problem, such as the discrete L2 norm in one dimension. A fixed finite matrix having decaying solutions as is not by itself a mesh-uniform result for the partial differential equation.
If , then
Thus eigenvalues of modulus at most one give a uniform bound when the diagonalizing bases have uniformly bounded condition numbers. For a normal matrix in the chosen inner product, the spectral theorem for normal operators supplies an orthonormal basis, so the condition number is one and the norm of is exactly . For a self-adjoint or skew-adjoint spatial matrix, applying a scalar stability function preserves this favorable modal structure. This is the setting where eigenvalue calculations provide especially clean, reliable step restrictions.
A precise fixed-matrix statement is also useful: a matrix is power bounded for all nonnegative integers if and only if all its eigenvalues lie in the closed unit disk and every Jordan block at a unit-modulus eigenvalue has size one. Indeed, powers of an interior Jordan block contain a polynomial in times a decaying geometric factor and are bounded; a larger block on the unit circle produces unbounded polynomial growth. For a family of matrices, the resulting bounds must still be uniform. Moreover, finite-time stability versus power boundedness distinguishes this all-time condition from the physical-time estimate above. For example , , has , bounded for despite a nontrivial Jordan block at one. Even the scalar update is stable on fixed intervals, since , although it represents a growing equation rather than a contraction.
For a constant-coefficient periodic difference operator, Fourier modes diagonalize the spatial matrix. The discrete Fourier transform is a unitary operator, so Parseval's identity identifies its modal maximum with the operator norm. The eigenvalue stability analysis of a finite difference method then becomes von Neumann stability analysis. For the Dirichlet discrete Laplacian, a discrete sine transform plays the same role. These facts explain its advantages: a large matrix calculation becomes a scalar symbol or a known spectral interval, and the extremal eigenvalue directly determines a safe time step.
As a first example, centered space discretization of the heat equation has eigenvalues
Forward Euler method gives with . Requiring all factors in yields for all periodic meshes. In two dimensions the corresponding uniform bound is . Because these are normal matrices, these scalar bounds prove contraction rather than merely suggest it.
Backward Euler method has , so the centered discretization of the heat equation is contractive for every . The Crank-Nicolson method has and is likewise contractive for these negative real modes. However, its factor tends to for very stiff modes, leaving high-frequency oscillations weakly damped; Backward Euler method tends to zero. The eigenvalues therefore expose the presence of stiff differential equations and damping as well as binary stability. Unconditional stability does not remove accuracy requirements.
For an advection equation example, the upwind finite difference scheme for , , has factor , with . Since
it is a contraction in the periodic discrete L2 norm exactly for . In contrast, Forward Euler method with centered advection has factor . Its modulus exceeds one at nonzero active frequencies, and repeated amplification makes it unstable under fixed nonzero Courant refinement. A much smaller scaling can bound its finite-time growth, demonstrating again that exact contraction and the most general stability estimate are different claims.
The major limitation is the possible presence of a nonnormal matrix. For example,
Both eigenvalues are negative, yet at the second unit vector is amplified by at least . This proves that negative spectra do not imply uniform semidiscrete stability. Ill-conditioned eigenvectors, Jordan normal form and transient amplification can invalidate a spectral-only argument. Direct energy estimates or estimates for the resolvent can supply the missing norm control.
Boundary conditions are another limitation. A periodic symbol proves a periodic or whole-line result, not an arbitrary initial-boundary-value problem. Boundary closure of a difference scheme can introduce growing modes or mesh-dependent amplification. A spatial operator with variable coefficients can still be studied through its assembled matrix, but then whether it is a normal matrix, its condition number and the physical inner product must be checked rather than borrowed from a Fourier stability analysis. For the finite element method the natural mass matrix inner product often turns a generalized eigenvalue problem into a self-adjoint one.
For time-dependent or split updates, separate spectra are insufficient to control products. For instance, and each have only zero eigenvalues, while has eigenvalue . For , alternating the two is unstable. A common contractive norm would control the products, but their individual eigenvalues do not.
Finally, stability and consistency of a numerical method have different roles. The Lax equivalence theorem states that, for a well-posed linear initial-value problem and a consistent finite difference method on compatible grid spaces, stability on every fixed time interval is equivalent to convergence of a numerical method as the admissible meshes refine. Bounded grid representation and the correct initial and boundary setup are part of that framework. An eigenvalue estimate can establish its stability hypothesis in the favorable settings described above; it neither proves consistency of a numerical method nor bypasses its uniformity requirements. The method is therefore a powerful modal tool, provided its spectral calculation is connected to a genuine norm estimate.
The finite element method replaces an infinite-dimensional variational problem by a finite-dimensional one, usually using functions that are polynomial on small mesh elements. Ritz method and Galerkin method describe how the discrete equations are selected; neither intrinsically requires piecewise polynomials, though those spaces make assembly local and sparse.
For a concrete realization of the two-point problem, choose homogeneous Dirichlet boundary conditions at both endpoints of . The differential expression alone is not a complete boundary value problem, so this boundary choice is an explicit assumption. Let with , with , and . Use the zero-boundary Sobolev space with norm . By the Poincaré inequality this is equivalent to its full first-order Sobolev norm. Multiplying by a test function and applying integration by parts gives
The endpoint terms vanish by the essential boundary condition. The form is a symmetric bilinear form, bounded by
and it is a coercive bilinear form:
The load is a bounded linear functional. The Lax-Milgram theorem gives a unique weak solution and a bound . Under the stated coefficient regularity it solves the differential equation in the usual weak sense.
The Ritz method minimizes the energy
over , or over a conforming finite-dimensional subspace . Its first variation is ; symmetry and coercivity make the functional strictly convex. In fact, if is the weak solution,
Thus the energy minimizer is exactly the weak solution. The Galerkin method instead directly asks for with for all . For this symmetric coercive problem, Ritz-Galerkin equivalence for a symmetric coercive form shows that the discrete minimizer and Galerkin solution coincide. For a nonsymmetric problem, a Galerkin formulation can still apply but the same quadratic minimization generally cannot represent its full bilinear form; appropriate coercivity or inf-sup conditions must then justify the chosen spaces.
Subtract the continuous and discrete weak equations to obtain Galerkin orthogonality . Since defines the energy norm , the Pythagorean identity gives
In a general reference norm, the Céa lemma yields
The proof uses together with coercivity and continuity. Dense approximation spaces therefore imply convergence; the estimate reduces a numerical error problem to an approximation problem.
For implementation, partition the interval by nodes . Choose continuous piecewise-linear functions and the interior piecewise-linear hat functions as a basis, with the two boundary coefficients prescribed. Write . The coefficients satisfy
The stiffness matrix is symmetric positive definite: for nonzero interior coefficients. The local supports make it tridiagonal in this one-dimensional linear-element case.
On an element of length , for constant element coefficients , the two-node matrix and constant-load vector are
For variable coefficients, integrate against the same shape functions rather than silently replacing them by constants. Element contributions are added at shared nodes, and boundary values are eliminated or lifted into the right side. A sparse direct solve or a suitable iterative method gives the nodal coefficients. Numerical quadrature should preserve the required accuracy and, with positive coefficients and weights, the positive energy structure.
A finite element interpolation estimate gives for these elements, where is the largest element size and the solution has the stated regularity. The Céa lemma then gives first-order energy error. If the dual elliptic problem has regularity, the Aubin–Nitsche duality argument gives second-order error: for , solve , then use to gain one further factor of . Higher-order elements improve rates when the solution is sufficiently smooth.
Nonzero Dirichlet data are handled by a boundary lifting and an affine trial space. Neumann boundary conditions enter naturally through the integrated boundary term; Robin terms modify both the form and the load. With pure Neumann conditions and , constants lie in the kernel: existence needs the load/flux compatibility condition, uniqueness needs a mean constraint, and the preceding Dirichlet coercivity argument cannot simply be reused. Conforming approximation, boundary conditions and coercivity are the ingredients connecting the finite-element construction to a justified Ritz or Galerkin solution.
The starting point of a conforming finite element method is a weak formulation in a Hilbert space . For example, a homogeneous Dirichlet boundary condition on a bounded Lipschitz domain gives . One seeks
where is a bounded bilinear form, , and is a bounded linear functional. A conforming finite element space is finite dimensional and is typically built from functions that are polynomial on each element of a finite element mesh. With a basis , the Galerkin method imposes the same identity only for , giving
The stiffness matrix is sparse when basis supports overlap only locally. Local element integrals assemble its entries; the mass matrix represents an term. This separates the choice of trial functions from the variational principle determining their coefficients.
The fundamental well-posedness theorem is the Lax-Milgram theorem: if for some , there is a unique solution for each , with . The same theorem on gives a unique discrete solution. The constants must be independent of the mesh for uniform stability of a numerical method. Boundary conditions are built into the trial space when they are essential constraints; flux conditions arise through boundary terms in integration by parts and are natural constraints in the weak formulation.
When is symmetric and a coercive bilinear form, the Ritz method minimizes
over . Its first variation is exactly the Galerkin method, so Ritz minimization and Galerkin testing coincide for symmetric coercive problems. The energy norm turns the approximation into an orthogonal projection. Indeed, subtracting the exact and discrete weak equations gives Galerkin orthogonality, . For every the Pythagorean identity becomes
so
This exact best-approximation property is the central advantage of the Ritz method.
Symmetry is unnecessary for the Galerkin method. For any bounded, coercive form, the Céa lemma gives
To prove it, put . Galerkin orthogonality yields , so coercivity and boundedness give . Divide when and take the infimum. Thus approximation capability plus uniform coercivity gives convergence. In contrast, minimizing for a nonsymmetric form differentiates its symmetric part and generally does not solve the original weak equation.
A concrete symmetric example is the one-dimensional reaction-diffusion problem from Question 5. Continuous piecewise-linear hat functions give the diffusion stiffness matrix with diagonal and neighbouring entries , and the mass matrix with diagonal and neighbouring entries . Therefore and . Its positive-definite matrix is the coordinate form of the continuous energy. The exact smooth solution makes this an explicit test of the method, not just an abstract existence result.
For a nonsymmetric example, take positive , constant real , and
Its form is . Since , it has coercivity constant in the full norm, although it is not symmetric when . The Galerkin method remains well posed. On the uniform hat basis, , where , and . The skew-symmetric matrix cancels from , proving nonsingularity. A Ritz energy would omit precisely this advection contribution. Small may nevertheless make the approximation constant large and produce poorly resolved layers; algebraic solvability is not an accuracy guarantee.
Quantitative convergence uses a finite element interpolation estimate. On a shape-regular mesh, for piecewise-linear conforming elements and in the usual low-dimensional setting,
The Céa lemma therefore gives an energy error. The Aubin–Nitsche duality argument improves the L2 norm error when the dual elliptic problem has regularity: solve and use
Consequently
with constants depending on the solution and regularity bounds. The second estimate is conditional on dual regularity; corners or insufficient data regularity can reduce the rate.
The same Galerkin method handles evolution equations. For the homogeneous heat equation, the semidiscrete finite element heat equation is . Because is a positive-definite matrix and is a positive semidefinite matrix,
The decreasing quadratic form is exactly the L2 norm squared of the finite-element function. This separates spatial stability of a numerical method from the subsequent time integrator, just as in the Schrödinger equation example. Conformity, coercivity and approximation estimates together explain convergence.