The fundamental lemma of the calculus of variations says that if the integral of a function times a test function over an open region is equal to zero for all test functions that vanish at boundary of the region, then the function itself is zero.
However, what's the appropriate generalization for integrals over closed domains, for example, the surface integral of the surface of a sphere? Here we can't even define a function which vanishes at the boundary, because there is no boundary, right?