Motivation
Finite differences begin with pointwise derivatives and replace them by nearby samples. A variational method begins with an integral identity. This change is useful when a solution has too few classical derivatives for a pointwise equation, when coefficients jump between materials, or when a mesh must follow geometry. Integrating by parts moves one derivative from the unknown to a test function, lowering the regularity required of the solution.
The central approximation principle is equally valuable: choose a finite-dimensional space of admissible functions and enforce the same integral identity against every function in that space. If the bilinear form is an inner product, the numerical solution is an orthogonal projection of the exact weak solution. The resulting error is the smallest energy error available in the chosen space. Finite elements and spectral methods then differ chiefly in which functions span that space.
We develop a complete one-dimensional theory, prove a basic convergence estimate and assemble a two-dimensional triangle explicitly. This supplies a foundation, not a full account of mesh generation, higher-order elements or multidimensional regularity.
Definitions
Definition 5.1.1
(Weak derivative and the space )
A function has weak derivative if for every smooth test function with compact support in . The space consists of the square-integrable functions with a square-integrable weak derivative, and consists of the functions in whose endpoint traces vanish.
In one dimension each function in has an absolutely continuous representative, so endpoint values, and hence the traces in the definition of , are meaningful.
Definition 5.1.2
(Bilinear form, load and weak solution)
Let the coefficients be bounded measurable functions satisfying and almost everywhere, and let . Define
A weak solution of with zero Dirichlet data is a function satisfying for every .
If a classical solution exists, integration by parts gives this identity. Conversely the identity gives the differential equation in the distributional sense; stronger pointwise conclusions need extra regularity.
Definition 5.1.3
(Energy norm and conforming Galerkin space)
The energy norm is . A conforming Galerkin space is a finite-dimensional subspace of . The Galerkin solution is with for every .
Conforming means that the approximation functions really obey the required regularity and homogeneous boundary traces. For nonzero Dirichlet data, subtract a suitable lift first; an arbitrary basis with the wrong traces is not a conforming space for this problem.
Theorem/proposition
Theorem 5.1.4
(Weak solvability and Galerkin best approximation)
Under the coefficient and load hypotheses above, there is a unique weak solution , and each finite-dimensional conforming space has a unique Galerkin solution . They satisfy
Both solutions minimize over their respective spaces. In a general continuous coercive, possibly nonsymmetric form, the corresponding Céa bound is , where is the continuity constant and the coercivity constant. Exact energy projection uses the present symmetry.
Theorem 5.1.5
(Piecewise-linear error for the interval Poisson equation)
Let , , and let the exact weak solution also belong to . On any interval partition of largest length , use continuous piecewise-linear functions vanishing at the endpoints, with exact integrals in the Galerkin equations. Then
The second estimate uses an additional dual problem on the interval. It does not follow merely by applying an interpolation bound to .
Proof sketch or proof idea
Proof
(Proof of weak solvability and best approximation)
For , , so Cauchy–Schwarz gives . This Poincaré inequality makes an equivalent Hilbert norm on . The coefficient bounds imply
Thus the energy inner product is complete, and is continuous. The Hilbert-space representation theorem applied to this inner product gives a unique representing . The same argument in the finite-dimensional subspace gives . Equivalently its stiffness matrix is positive definite, since a nonzero coefficient vector represents a nonzero basis combination with positive energy.
Subtract the exact and discrete equations to obtain Galerkin orthogonality. For any , the decomposition is energy-orthogonal. Therefore
Taking the minimum proves best approximation. Also by the weak equation, proving minimization. For a nonsymmetric form, orthogonality and coercivity instead give ; division proves the stated Céa inequality whenever .
Proof
(Proof of the piecewise-linear error bounds)
To prove the interpolation estimate, let match the exact nodal values. On a cell of length , is the average of there. The fundamental theorem and Cauchy–Schwarz bound the deviation of from this average, giving
For completeness, write the deviation as , apply Jensen's inequality, then use , and integrate in . Summing cells and using best approximation proves the derivative error bound.
For the estimate, put and solve , . Integrating twice explicitly gives a solution in with . Integration by parts and Galerkin orthogonality yield
Cancel unless it is zero, then apply the first estimate. This duality argument explains the extra power of and also shows why an analogous higher-dimensional result depends on regularity of an auxiliary PDE.
Proof X-ray
Where each hypothesis is spent in the two proofs
The lower bounds and are used exactly once, for the lower energy bound . Combined with the Poincaré inequality, this makes the energy inner product a complete norm on , which is what the representation theorem requires. The upper bounds only make continuous. Conformity and exact integration are spent on Galerkin orthogonality: the discrete equation is the exact equation tested against fewer functions, so subtracting the two is legitimate. Symmetry is spent on the Pythagorean identity; without it only the factor of Céa's bound survives.
The non-obvious move is in the estimate. Applying the interpolation bound to directly yields only one power of . Instead the error itself becomes the load of the dual problem . Orthogonality allows to be subtracted inside , and a second interpolation estimate, now applied to , supplies the second power of . The argument closes because returns the quantity being estimated, which is then canceled. Quadrature that changes , or a nonconforming space, breaks the orthogonality step, so neither case is covered without additional consistency terms.
Worked examples
Worked example 5.1.6
(Assembling linear interval elements)
On a cell of length , the two local basis functions are and . For , , their derivative products integrate to
For constant , its additional local matrix is . Constant forcing contributes . Assembly adds contributions sharing a global node; it does not average them. Boundary degrees of freedom are then fixed or eliminated.
For with zero endpoints, take nodes . There is one interior hat , with stiffness and load . Thus . The exact solution is , whose midpoint value is also , but whose graph is curved rather than piecewise linear. Exact nodal values do not mean an exact function. Here the derivative error squared is , obtained by integrating on the first half and its reflected counterpart on the second.
Concept lensStructural
For the interval Poisson problem, projection equals interpolation
When and , the piecewise-linear Galerkin solution is exactly the nodal interpolant , on every partition. A hat function has constant derivative on each cell , and because and agree at the ends of . Hence for every hat : satisfies Galerkin orthogonality, and uniqueness gives . This explains the exact nodal values above; a nonzero or a variable generally destroys it.
Worked example 5.1.7
(A concrete triangular element)
On the triangle with vertices , choose , , . They sum to one and take the nodal values required of linear interpolation. Their gradients are constant, and the area is . For the local stiffness is
when is constant. The row sums are zero, because a constant function has zero gradient. This local matrix is semidefinite; global Dirichlet conditions and connectivity remove the constant mode. Demanding each element matrix be positive definite would confuse local gradient energy with the fully constrained boundary-value problem. On a general triangle the gradients and area must be recomputed from its geometry.
Worked example 5.1.8
(Sine functions form a different Galerkin space)
For the interval Poisson equation, choose . Orthogonality diagonalizes the stiffness matrix. If , then
Take . The exact solution is . With , the omitted mode gives and . With the method is exact in exact arithmetic and exact integration. The basis is global, so a single coefficient changes the function throughout the interval.
What a spectral rate actually requires
If the exact sine coefficients are , Parseval's identity gives energy tail . For , it follows that
Exponential convergence needs stronger coefficient decay, for example an explicit bound . Smoothness on the closed interval alone does not ensure that its odd periodic extension is analytic. For , the analytic polynomial solution has sine coefficients for odd and zero for even . Boundary compatibility of the chosen extension limits the rate. “Spectral” names a choice of approximation space, rather than a universal promise of exponential accuracy.
Flux continuity is encoded in the weak identity
Consider with , , where on the first half and on the second. The flux must be a constant . The endpoint difference therefore satisfies , giving . The exact function has slope on the left and on the right, and its midpoint value is . The derivative jumps, but the flux does not. This function belongs to and satisfies the weak equation after subtracting a boundary lift, although it is not globally .
A piecewise-linear space whose mesh includes the interface contains this exact solution. With exact coefficient integration, Galerkin best approximation therefore gives zero energy error. If a cell straddles the interface, its single slope cannot represent the kink. The method can still converge, but the earlier global estimate cannot be invoked for this solution. This example shows why aligning a mesh with known coefficient changes can matter more than formally increasing a smooth-problem order.
There is also a distinction between variational stability and conditioning in a coordinate basis. Coercivity bounds functions in an energy norm. A stiffness matrix uses nodal coefficients, whose Euclidean norm changes with the number and shape of elements. Its condition number can grow as the mesh is refined even when the continuous coercivity constant is unchanged. This does not contradict stability of the Galerkin approximation; it signals that the linear system may need scaling or preconditioning for efficient accurate solution. No particular iterative solver is analyzed here.
In two dimensions a conforming triangular space uses functions continuous across shared edges, with a separate affine formula on each triangle. The local gradients need not agree across an edge. Continuity of the function is sufficient for membership in ; requiring continuous gradients would unnecessarily exclude ordinary linear elements. The weak formulation couples adjacent elements through shared degrees of freedom and the assembled integral equation.
For nonzero Dirichlet data, assembly first produces equations involving both interior and prescribed boundary coefficients. Partitioning gives . The minus sign follows from moving a known block to the right; it is not chosen from intuition about the source. Eliminating the boundary degrees of freedom leaves a positive definite interior matrix under the theorem's hypotheses. Forcing the entire original matrix to be invertible before applying any boundary conditions would miss the constant nullspace of pure gradient energy.
Integration in practice must also be kept distinct. If the coefficients and load are low-degree polynomials, a quadrature rule that integrates that degree exactly still produces the same matrices as here. With quadrature of insufficient accuracy, the computed solution belongs to a different, perturbed problem, and the integration error must be controlled separately. Orthogonality of a spectral basis also depends on the inner product used; a sampled inner product can alias and is not the same as continuous orthogonal integration. This is why the examples that "contain the exact solution" all state that integration and arithmetic are exact, rather than attributing the idealized property unconditionally to any implementation.
When reading an assembled table, first check symmetry, then the constant vector and the boundary elimination, and only then solve numerically. Each check corresponds to a different property of the integral form, and together they locate the source of an error better than asking whether the answer looks close to what was expected; they do not replace the complete error argument given earlier.
Common mistakes
Common mistake
(Treating the weak form as free of boundary conditions)
Weak derivatives do not permit ignoring boundary conditions. Dirichlet traces define the trial space, so a basis with the wrong traces does not give a conforming method. Neumann terms arise on the right side when integrating by parts and must carry the correct outward normal.
Common mistake
(Quoting the estimate across an unresolved interface)
Coefficients with jumps fit the weak formulation even when the flux derivative is not a classical function. In the two-material example the exact solution has a kink at and is not globally in , so the piecewise-linear error theorem cannot be invoked when a cell straddles the interface. The weak formulation remains valid; only the regularity hypothesis of the estimate has failed.
Counterexample mode
Coercivity cannot be dropped from the solvability theorem
Claim: with and bounded of either sign, the weak problem has a unique solution. Take , , and . For every , integration by parts gives
Thus and every multiple of are weak solutions, and although . The repair is a coercivity hypothesis. The condition is sufficient; for any with constant also works, because on gives .
Summary
A weak formulation lowers derivative requirements and provides an energy space. Conforming Galerkin methods inherit solvability and, for symmetric coercive forms, best approximation in the energy norm. Piecewise-linear finite elements give sparse assembled systems; sine spectral functions give a global basis that diagonalizes this particular constant-coefficient problem. Accuracy follows from approximation properties and regularity, with every integration and boundary assumption visible.
Exercises
Quick check
(Assemble the two-interior-node stiffness matrix for on nodes with zero endpoint values, and solve for the nodal coefficients.)
Each interior load is the area under one hat function.
Solution · Answer
Assembly gives and . Symmetry makes the coefficients equal, so and . These equal the exact nodal values of , while the finite-element graph remains piecewise linear.
Quick check
(Show directly that the local triangle matrix of the triangular-element example has null vector and nonnegative energy for every coefficient vector.)
Express its quadratic form as two squares.
Solution · Answer
All row sums vanish, proving the null-vector claim. For coefficients the energy is . It vanishes exactly when all three coefficients agree. Local constants are allowed; globally homogeneous Dirichlet conditions eliminate a nonzero connected constant function.
Quick check
(For with zero endpoints, find the sine Galerkin solutions for and , and their errors.)
Orthogonality identifies which loads vanish.
Solution · Answer
The exact solution is . For its load against is zero, so and the error norm is . For the exact solution belongs to the space, so best approximation gives and zero error under exact integration.
Quick check
(Prove the Céa inequality from coercivity, continuity and Galerkin orthogonality, carefully stating which difference belongs to .)
Subtract from , not from the exact solution alone.
Solution · Answer
Let and choose any . Since , orthogonality gives , so . Coercivity and continuity yield . If the claim is immediate; otherwise divide and take the infimum. Symmetry was not used in this inequality, though it is needed for the energy-inner-product projection identity above.