The Galerkin method is a general framework for approximating equations in function spaces by equations in finite-dimensional spaces. An approximate solution is expressed as a combination of selected trial functions, and its residual—the discrepancy remaining when it is substituted into the equation—is required to vanish when tested against selected functions. In the standard Galerkin formulation, the trial and test spaces are the same. The resulting conditions determine a finite set of unknown coefficients.
Galerkin methods are fundamental to numerical analysis, particularly the numerical solution of partial differential equations. They provide the mathematical foundation for much of the finite element method, as well as many spectral approximations, reduced-order models, and constructive proofs that differential equations possess solutions. Their importance comes from combining a practical discretization procedure with a framework for analyzing stability, conservation, and approximation error.
Named after Boris Galerkin, who published an influential formulation in 1915, the method connects residual orthogonality, variational principles, and projection in function spaces. Its behavior depends not only on the equation being solved but also on the choice of spaces, boundary conditions, integration rules, and algebraic solvers.
Historical development and relation to variational methods
The Galerkin method developed from nineteenth- and early twentieth-century attempts to approximate continuous mechanical systems by finitely many parameters. In vibration and elasticity problems, an unknown displacement field could be replaced by a finite expansion, turning an equation involving functions into equations for coefficients. The central difficulty was to select those coefficients systematically while preserving the governing physical principles.
A major precursor was the Rayleigh–Ritz approach. Walther Ritz’s 1909 work developed a general procedure for approximating solutions by minimizing an energy functional over a finite-dimensional space. If a functional has the form
where is a symmetric bilinear form and is linear, stationarity over a space gives
This is precisely a Galerkin equation. The two approaches therefore coincide for an important class of symmetric problems, although their starting points differ: Ritz begins with a functional, whereas Galerkin begins with equations tested against functions.
Ivan Bubnov used closely related ideas in structural mechanics before Galerkin’s 1915 publication. This historical connection accounts for the name Bubnov–Galerkin method, especially when trial and test spaces coincide. Galerkin’s formulation made clear that approximation need not depend on the existence of an energy-minimization principle. Equations with nonsymmetric operators can also be tested against an approximation space, even when no corresponding scalar energy functional is available.
The later development of functional analysis supplied a rigorous setting for these procedures. Hilbert spaces, weak derivatives, and variational formulations allowed approximation methods to be studied independently of particular coordinate systems or mechanical interpretations. Galerkin approximations also became tools in existence proofs: finite-dimensional problems could be solved first, followed by a limiting argument to obtain an infinite-dimensional solution.
The rise of digital computation and finite elements in the mid-twentieth century greatly expanded practical use. Local polynomial spaces made it possible to handle irregular geometries and spatially varying materials. Jean Céa’s 1964 error estimate established a particularly influential connection between Galerkin error and best approximation. Subsequent developments extended the framework to mixed systems, discontinuous spaces, stabilized formulations, and high-order methods. Thus, “Galerkin” identifies a testing and projection principle rather than one particular mesh, basis, or computer algorithm.
Residual orthogonality and finite-dimensional projection
Consider an operator equation
Choose a finite-dimensional trial space
and seek an approximation
The coefficients are unknown. Unless the exact solution already lies in the trial space, substituting into the equation leaves a nonzero residual . A Galerkin method does not ordinarily require this residual to vanish at every point. Instead, it requires its action on every function in a chosen test space to vanish.
When the residual belongs to an appropriate inner-product space, the standard condition is
Here denotes an inner product. More generally, the residual belongs to a dual space, and testing is expressed through a duality pairing rather than an ordinary inner product. This distinction matters for differential equations, whose residuals may involve distributions rather than square-integrable functions.
For a linear equation with a variational representation, the conditions become
Testing with the basis functions gives a system of linear equations
The row index identifies the test function and the column index the trial function. This convention is especially important for nonsymmetric forms.
For example, approximate the solution of
using only . Writing , the Galerkin equation gives
and hence
The exact solution is , so the one-function approximation is not exact. Nevertheless, its residual is orthogonal to the selected test function.
The term projection needs qualification. If is symmetric and positive definite, the approximation is an orthogonal projection in the inner product defined by . For nonsymmetric forms, the projection is generally oblique. Moreover, Galerkin orthogonality does not normally imply that the strong residual has the smallest possible norm; residual minimization is a distinct principle unless additional structure makes the two equivalent.
Weak formulations and boundary conditions
Differential operators often demand more smoothness than an approximation space can conveniently provide. A second-order equation written pointwise involves second derivatives, but continuous piecewise linear functions do not possess ordinary second derivatives across element boundaries. A weak formulation transfers derivatives onto test functions and allows the equation to be interpreted with less regularity.
Consider a diffusion–reaction problem on a bounded domain :
Suppose the boundary is divided into a Dirichlet part , where , and a Neumann part , where
Multiplying by a test function and applying integration by parts gives
provided vanishes on . The differential equation has become an integral identity involving only first derivatives.
The natural setting is a Sobolev space. For homogeneous Dirichlet data on the entire boundary, a typical choice is , consisting of functions with square-integrable weak first derivatives and zero boundary trace. The associated weak solution satisfies the integral identity for every . A conforming Galerkin approximation then restricts both the solution and testing to a finite-dimensional subspace .
Nonzero Dirichlet data require care because the admissible solutions form an affine space, not a vector space. One can introduce a lifting with the required boundary values and write , where has homogeneous boundary data. The discrete equation becomes
Thus, the statement that trial and test spaces are identical usually refers to the homogeneous space of admissible variations, not literally to the affine set containing the full solution.
Dirichlet conditions imposed through the approximation space are called essential conditions. Neumann conditions arising in the boundary integral are called natural conditions. These labels depend on the formulation: changing the primary unknowns or integrating by parts differently can change how a physical boundary condition enters the mathematics.
Weak formulations also clarify solvability. For a pure Neumann diffusion problem, constants lie in the operator’s null space. The data must satisfy a compatibility condition, and the solution is determined only up to an additive constant. A Galerkin discretization inherits this structure; it does not remove the need for compatibility or a normalization such as zero mean.
Stability, best approximation, and convergence
The central error theory begins with a Hilbert space , a bilinear form , and a bounded linear functional . Suppose
and
These properties are continuity and coercivity. Under them, the Lax–Milgram theorem gives a unique solution of the continuous variational problem. Every conforming finite-dimensional Galerkin problem is also uniquely solvable, with stability controlled by the same coercivity constant.
Subtracting the discrete equation from the continuous equation yields Galerkin orthogonality:
This identity is the main link between the exact and discrete solutions. For any , coercivity, orthogonality, and continuity imply
Consequently, Céa’s lemma states that
The method is therefore quasi-optimal: its error is bounded by a fixed multiple of the smallest error achievable in the chosen space.
If is symmetric as well as coercive, it defines the energy norm
In this norm the Galerkin approximation is exactly optimal:
It also satisfies a Pythagorean identity. This is stronger than merely asserting that the coefficients solve a stable algebraic system: it identifies the approximation as the closest available function in a problem-dependent norm.
Convergence then follows from approximation properties. If increasingly rich spaces approximate every member of and the stability constants remain uniform, the Galerkin solutions converge. For degree- conforming finite elements on suitable shape-regular meshes, a sufficiently smooth solution typically satisfies
Here measures element size, and the constant is independent of . Corners, interfaces, or singular data may reduce regularity and lower the observed rate.
An additional power of in the error can often be obtained by solving an adjoint problem, a technique known as the Aubin–Nitsche argument. That improvement depends on regularity of the adjoint solution and is not automatic. For noncoercive problems, Céa’s argument must be replaced by other stability estimates; increasing the number of trial functions alone does not guarantee convergence.
Finite element realization and local assembly
A finite element Galerkin method constructs its approximation space from a mesh of simple cells, such as intervals, triangles, quadrilaterals, tetrahedra, or hexahedra. On each cell, the solution is represented by polynomials or other prescribed local functions. Compatibility conditions between cells determine the global function space. For a scalar second-order problem in an formulation, the usual conforming choice is continuity across element interfaces.
Piecewise linear elements on a triangular mesh provide a basic example. Each vertex has an associated nodal basis function that equals one at that vertex and zero at the others. Its support consists only of the triangles meeting the vertex. The unknown coefficients are therefore nodal values, and basis functions attached to distant vertices do not interact directly in a local differential operator.
This locality makes the Galerkin matrix a sparse matrix. Assembly proceeds element by element:
Each cell contributes a small local matrix, which is added to the appropriate entries of the global matrix through a local-to-global numbering map. For diffusion, a typical local contribution is
Shared global coefficients enforce continuity without requiring a separate continuity equation for every interface.
Calculations are commonly performed on a reference element. A geometric map transfers basis functions, derivatives, and integration weights to each physical cell. Its Jacobian matrix accounts for stretching and orientation. For curved geometries, isoparametric elements use related interpolation functions for both the geometry and the solution. Geometric approximation then becomes part of the discretization error rather than a purely visual representation of the domain.
The one-dimensional diffusion equation illustrates the connection with other methods. On a uniform mesh of spacing , continuous piecewise linear elements for produce the interior stiffness pattern
After appropriate scaling, this resembles the familiar three-point finite difference method. The load vector, however, is defined by integrals against basis functions, not necessarily by pointwise samples of .
Refinement may reduce element size, increase polynomial degree, or combine both strategies. These are called -, -, and -refinement. Approximation quality depends on mesh shape as well as size: highly distorted cells can degrade interpolation constants and matrix conditioning. Finite elements thus supply a local, geometry-aware realization of Galerkin projection, while the projection principle itself remains independent of any particular mesh construction.
Spectral Galerkin methods and basis selection
Galerkin approximation does not require locally supported functions. Spectral Galerkin methods use global families such as trigonometric functions, orthogonal polynomials, or eigenfunctions of an auxiliary operator. Their main advantage is that smooth solutions can be represented very efficiently. Their main limitation is that nonsmoothness or complicated geometry can undermine this efficiency.
For a periodic problem, a truncated Fourier series is a natural trial space. On , write
For the periodic equation
orthogonality of Fourier modes gives
The discrete operator is diagonal because differentiation preserves each Fourier mode and the coefficients are constant. Variable coefficients generally couple modes, so diagonal structure is a property of the equation–basis combination, not of Galerkin methods in general.
On nonperiodic intervals, Legendre or Chebyshev polynomials are common choices. Boundary conditions can be incorporated by taking suitable combinations of polynomials, restricting the approximation space, or introducing additional equations. The relevant inner product may include a weight. Basis normalization and the way derivatives are represented can substantially affect conditioning even when the underlying approximation spaces are identical.
For functions with only finitely many derivatives, spectral coefficients generally decay algebraically. For analytic functions with suitable analytic continuation, coefficient decay can be geometric, leading to exponential-type convergence as the number of modes increases. The often-used phrase spectral accuracy therefore depends on regularity; it does not mean that every problem converges exponentially. Discontinuities cause slow global convergence and oscillations associated with the Gibbs phenomenon.
Spectral Galerkin methods must also be distinguished from collocation methods. Galerkin methods impose integral testing conditions, whereas collocation imposes the equation at selected points. A pseudospectral implementation may evaluate nonlinear products on a grid and transform them using the fast Fourier transform. This is computationally efficient, but insufficient sampling can alias unresolved frequencies into resolved modes. Dealiasing or sufficiently accurate integration is needed to recover the intended projected nonlinear term.
Basis selection is thus both an approximation decision and an algebraic decision. Eigenfunction bases may simplify operators, local bases accommodate complex geometries, and problem-adapted global bases can capture dominant solution features with few coefficients. None is universally optimal. A basis that approximates a particular solution well can still produce an ill-conditioned system or fail to resolve localized behavior outside the regime for which it was designed.
Petrov–Galerkin, mixed, and discontinuous formulations
The broader Galerkin family includes methods in which trial and test spaces differ. A Petrov–Galerkin method seeks such that
The distinction between and provides additional freedom to obtain stability or incorporate directional information. It is especially useful when the equation is not coercive in a natural norm.
For advection-dominated transport,
the solution may contain thin layers when diffusion is small. A conventional continuous Galerkin discretization can produce nonphysical oscillations if the mesh does not resolve those layers. In one dimension, a representative element Péclet number is
Large values indicate that transport dominates diffusion on the element scale. Streamline-upwind/Petrov–Galerkin stabilization adds appropriately weighted residual terms involving derivatives of test functions along the flow direction. Its purpose is directional stabilization, not simply uniform artificial smoothing.
Mixed finite element methods introduce multiple unknown fields, such as velocity and pressure or flux and potential. In incompressible flow, pressure enforces the velocity divergence constraint. The resulting algebraic system has a saddle-point structure:
Stability depends on compatibility between the discrete spaces. The discrete inf–sup condition requires a bound of the form
with independent of refinement. Arbitrary velocity–pressure combinations need not satisfy this condition and can produce spurious pressure modes. Taylor–Hood pairs, using continuous quadratic velocity and continuous linear pressure on suitable meshes, are a standard stable construction.
Discontinuous Galerkin methods permit jumps between neighboring elements. Elementwise integration by parts introduces interface terms, and numerical fluxes specify how neighboring cells exchange information. Upwind fluxes are natural for transport, while interior-penalty formulations are widely used for diffusion. Penalty parameters and flux choices affect stability, consistency, and conditioning.
These variants alter different aspects of the framework. Petrov–Galerkin changes the testing space; mixed methods change the collection of unknown fields and their constraints; discontinuous methods change interelement continuity and introduce numerical interface coupling. They can also be combined. For example, a transport system can use a mixed representation with discontinuous approximation spaces and upwind numerical fluxes. The shared requirement is a carefully defined variational problem whose discrete stability can be established.
Time-dependent equations, nonlinear systems, and existence proofs
For an evolution equation, Galerkin approximation is often applied first in space. Consider the heat equation
Writing
and testing against the spatial basis gives
where
The mass matrix represents the time-derivative term, and represents diffusion. This spatially discrete system remains continuous in time and is therefore called semidiscrete.
Time integration introduces a separate approximation. Explicit methods generally face a diffusion-related step restriction proportional to on quasi-uniform meshes. Implicit methods can avoid that particular stability restriction but require algebraic solves at each step. For wave equations, spatial Galerkin approximation instead yields a second-order system,
The interaction between spatial and temporal discretizations determines dispersion, damping, and long-time energy behavior.
Energy estimates often survive projection. For homogeneous boundary conditions and zero forcing, testing the semidiscrete heat equation with gives
This identity expresses decay of the discrete solution’s squared norm. A fully discrete scheme may preserve, approximate, or destroy this behavior depending on its time integrator. Spatial stability alone does not establish stability of the complete algorithm.
For a nonlinear equation, the Galerkin conditions produce nonlinear algebraic equations
Newton’s method solves a sequence of linearized systems involving derivatives of the residual. Fixed-point iteration is another possibility. Nonlinear convergence depends on the initial iterate, equation structure, and solver strategy; existence of the Galerkin solution does not imply that every nonlinear iteration will find it.
Galerkin approximations also serve a theoretical role in proving existence of solutions. One solves a sequence of finite-dimensional evolution systems, derives estimates independent of dimension, extracts weakly convergent subsequences, and passes to a limit. For nonlinear equations, weak convergence alone may not suffice to pass through products, so compactness or additional monotonicity arguments are needed. This approach is central in the analysis of equations including the Navier–Stokes equations. In that setting, the finite-dimensional approximations are not merely numerical substitutes: their uniform bounds form part of the proof that an infinite-dimensional weak solution exists.
Numerical integration, algebraic solution, and adaptive error control
An implemented Galerkin method contains several approximation layers beyond the choice of trial space. Integrals may be evaluated numerically, curved boundaries may be approximated, material coefficients may be interpolated, and linear or nonlinear systems may be solved only to a tolerance. These effects must be distinguished from the error of the ideal Galerkin projection.
Numerical quadrature replaces exact integrals by weighted sums. If the integrand is polynomial, a sufficiently accurate rule reproduces the exact element matrix. Nonpolynomial coefficients, curved maps, and nonlinear terms generally prevent exact evaluation by a fixed finite rule. Underintegration can reduce computational cost, but it may introduce spurious zero-energy modes or destroy coercivity. Conversely, some carefully designed quadrature choices deliberately yield useful structures such as diagonal mass matrices.
Such changes are often analyzed as variational crimes: departures from the exact continuous form or exact conforming space that nevertheless may admit controlled error estimates. Strang’s lemmas extend best-approximation reasoning by adding consistency terms that measure discrepancies between continuous and discrete forms. Small quadrature error is therefore not judged solely by the accuracy of individual integral values; it must be small in norms relevant to the variational problem.
Algebraic conditioning is another separate issue. For standard elliptic finite elements on quasi-uniform meshes, the condition number of the unpreconditioned stiffness matrix commonly grows like , subject to basis and boundary assumptions. A convergent discretization can consequently become harder to solve as it is refined. Preconditioning changes the algebraic system to improve iterative convergence without changing its exact solution. Multigrid, domain decomposition, and block methods exploit different aspects of the underlying problem structure.
Adaptive refinement uses estimates computed from the discrete solution to identify where additional resolution is valuable. For piecewise polynomial diffusion approximations, a typical residual indicator has the structure
with suitable treatment of boundary faces. The first term measures imbalance inside a cell; the second measures jumps in normal flux across interfaces.
An a posteriori error estimate is reliable if it bounds the true error from above, and efficient if it does not substantially overestimate local error, apart from specified data terms. Goal-oriented estimates instead weight residuals using an adjoint solution to target a particular output, such as drag or average temperature. Solver tolerances, quadrature accuracy, and mesh refinement can then be coordinated so that one error source is not reduced far below the others at unnecessary cost.
Applications beyond standard mesh-based simulation
Galerkin projection applies whenever an equation can be tested against an approximation space, not only when physical space is divided into finite elements. In structural mechanics it produces displacement, vibration, and buckling approximations. In electromagnetism, basis functions must respect the relevant continuity of tangential or normal field components. In quantum mechanics, expansion in a finite basis turns suitable wave equations or eigenvalue problems into matrix equations. The appropriate space is determined by the operator and physical constraints, rather than by a universal choice of smooth functions.
For a symmetric generalized eigenvalue problem,
Galerkin approximation gives
The coefficients approximate eigenvalues, while the coefficient vectors represent approximate eigenfunctions. In conforming self-adjoint elliptic settings satisfying the usual compactness assumptions, variational principles give upper bounds for ordered eigenvalues, and nested enrichment improves those bounds. Such conclusions do not transfer automatically to non-self-adjoint or indefinite spectral problems, where spectral pollution and other difficulties can occur.
In reduced-order modeling, the trial space is deliberately small and tailored to a family of solutions. It may be formed from simulation snapshots, often compressed through singular value decomposition. If a high-dimensional system is and the columns of span the reduced space, standard Galerkin projection gives
This can accelerate repeated simulations, parameter studies, and optimization. For nonlinear models, evaluating the reduced residual may still require operations in the original large dimension; additional approximation, often called hyper-reduction, is needed to remove that expense.
Stochastic Galerkin methods project with respect to uncertain parameters. An unknown random field is expanded as
where the functions are orthogonal under the probability measure of the random input . Testing includes integration over the parameter distribution, so the method produces coupled deterministic equations for the coefficient fields . This differs from sampling methods, which solve separate realizations and estimate statistics afterward.
Each additional parameter can enlarge the approximation space substantially. Tensor-product constructions therefore encounter the curse of dimensionality, motivating sparse index sets, adaptive polynomial enrichment, and low-rank representations. Similar space-selection problems occur in reduced models: accurate training snapshots do not guarantee stability for all future parameters. Across these applications, the decisive questions remain whether the selected functions represent the relevant solutions and whether the projected equations retain the stability and structural properties of the original problem.