# Why the variation of a surface term is zero?

My original question is like:

Why are the Euler-Lagrange equations invariant if we add a surface term to the action?

And there is an answer by Javier:

I have some questions about Javier's answer, but as a new user I can not comment it so I have to ask this question.

Suppose you have a lagrangian $L_0$ and add a divergence to get $L=L_0+∂_μJ^μ$. Recall that the action is (in your favorite number of dimensions): $$S=∫dx L=S_0+∫dx ∂_μJ^μ=S0+∫dS n_μJ^μ$$ Here $S_0$ is the integral of $L_0$, and $n_μ$ the normal vector to your boundary. The equations of motion are the condition that $δS=0$ to first order whenever we make a variation in $L$. So: $$δS=δS_0+∫dS n_μδ(J^μ)$$ But $J_μ$ is constructed out of the fields for which you want the equations of motion. Since by hypothesis the variation of the fields at the boundary is zero, so is the variation of $J_μ$. The last term vanishes, and we get $δS=δS_0$.

But $$\delta J^{\mu }=\frac{\partial J^{\mu }}{\partial \phi }\delta \phi +\frac{\partial J^{\mu }}{\partial(\partial_{\nu}\phi)}\delta (\partial_{\nu}\phi)$$ and we only have $\delta \phi=0$ in the boundary, and generally we don't have $\delta (\partial_{\nu}\phi)=0$, so why the variation of $J_μ$ is zero?

When I found the answer of my original question, I found in some book the author writes $J^{\mu }$ as $J^{\mu }=J^{\mu }(\phi(x),x)$ , that is $J^{\mu }$ is only a function of $\phi(x)$ and $x$ but not of $\partial_{\nu}\phi$. When we write $J^{\mu }$ in this way we have: $$\delta J^{\mu }=\frac{\partial J^{\mu }}{\partial \phi }\delta \phi$$ and the variation of $J_μ$ is zero due to $\delta \phi=0$ in the boundary. And we can also prove that: $$\left(\frac{\partial }{\partial \phi }-\partial _{\nu }\frac{\partial }{\partial(\partial_{\nu}\phi)}\right)(∂_\mu J^\mu)=0$$ so we have: $$\frac{\partial L}{\partial \phi }-\partial _{\mu }\frac{\partial L}{\partial(\partial_{\mu}\phi)}=\frac{\partial L_0}{\partial \phi }-\partial _{\mu }\frac{\partial L_0}{\partial(\partial_{\mu}\phi)}$$ so the equation of motion is invariant.

But in some books the author dose not mention the condition $J^{\mu }=J^{\mu }(\phi(x),x)$, so is this condition a necessary condition that the variation of a surface term is zero?

• I don't have a full answer, but I wanted to point out that the variation of a surface term isn't necessarily zero. For a simple example where it isn't (and where this non-vanishing encodes useful physical information), see the problem of the elastic bar as described in Chapter 2.15 of Lanczos's The Variational Principles of Mechanics. – Michael Seifert Aug 16 '17 at 15:28
• If $J^{\mu}$ contains derivatives of the fields, that means that the original action contained second derivatives of the fields. If these are not of the form $(\partial^{2}\phi)(\partial^{2}\phi)$, you should integrate these out before taking the variation. – Jerry Schirmer Aug 16 '17 at 17:00

Why the variation of a surface term is zero?

Answer: Assume that the action is schematically of the form $$S=S_1+B_2,\tag{1}$$ where $S_1$ is a bulk term and $B_2$ is a boundary term (BT). (E.g. in GR $S_1$ is the EH action and $B_2$ is the GHY BT.) Then the variation of the bulk term is of the form $$\delta S_1~=~(\text{bulk term}) + \delta B_1,\tag{2}$$ where $\delta B_1$ is a BT.

The variations of the BTs $\delta B_1$ and $\delta B_2$ do generally not have to vanish. The condition $$\delta B_1+\delta B_2~=~0\tag{3}$$ is not automatic but has to be imposed via appropriate choice of boundary conditions (BCs) in order to guarantee the existence of a variational/functional derivative for $S$.

• Thanks for you answer. Now I know the boundary term not have to vanish. But I still can not figure out why this no vanish term does not change the Euler-Lagrange equations. I have read your answer. You said the functional derivative of the boundary component of action($B_2=∫dx ∂_μJ^μ$) is zero: $\frac{\delta B_2}{\delta \phi}=0$, because " variational/functional derivative is an object living in the bulk (rather than on the boundary), can never be other than identically zero in the bulk". – Hallow_Juan Aug 17 '17 at 4:43