In 2D I apply the calculus of variations to get an equation of the following form on a domain $\Omega\subset\mathbb{R}^2$, and I want to extract the Euler-Lagrange equations:
$$\int_{\Omega} f(p)\delta(p)\,dA + \int_{\partial \Omega} g(p)\delta(p)\,ds + \int_{\partial \Omega} h(p)\nabla \delta(p)\cdot \hat{n}\,ds = 0,$$ for $\delta(p)$ an arbitrary variation. Oftentimes it is given that $\delta$ or its derivative vanishes on the domain boundary, so that one of the boundary terms vanishes, but here $\delta$ is completely free.
Can I conclude that $f(p) = g(p) = h(p)=0$?
Clearly I can choose a bump function $\delta(p)$ at any interior point whose value and derivative vanishes on the boundary, so that $f(p)=0$. I'm less clear on whether I can independently also force $g(p)=0$ and $h(p)=0$. Intuitively, I ought to be able to take $\delta(p)$ to be a test function whose normal derivative is $1$ at a boundary point $p$, but whose normal derivative and value vanishes outside an arbitrarily small neighborhood?
Start with the case in which a portion of $\Omega$ is flat, say, it lies on the line $y=0$. Then the normal on that segment is $(0,1)$. Then you can take $\delta (x,y)=\int_0^y k(x,s)\,ds$ in that portion. In this case $\nabla \delta(x,y)\cdot (0,1)=k(x,y)$ and $\delta (x,0)=0$. Since $k$ is arbitrary in that portion you get that $h=0$ on the flat portion. If the boundary is not flat, assuming, it is at least of class $C^1$, you can write a portion of the boundary as $y=q(x)$ (or $x=r(y)$). In the first case, you can flatten the domain in that portion by considering the change of variables $(x,y)\mapsto (x,y-q(x)$ and then apply the previous step in the new flat portion. I am skipping the details but this is the basic idea when treating the boundary.