In order for the action to be invariant under a transformation, the Lagrangian can change by a total derivative. However, for internal symmetries (where the fields transform but not the coordinates), is this total derivative term always zero, meaning that the Lagrangian is invariant? In all the examples I can find such as gauge theories, this is the case, but I can't think of any intrinsic reason why it has to be.
2 Answers
It depends on the Lagrangian chosen. For example, in terms of $F^{\mu\nu}:=\partial^\mu A^\nu-\partial^\nu A^\mu$, which is invariant under $\delta A_\nu=\partial_\nu\chi$, the choices $-\frac14F_{\mu\nu}F^{\mu\nu},\,\frac12A_\nu\partial_\mu F^{\mu\nu}$ of electromagnetic Lagrangian density give the same action, but only the former has the desired invariance.
No. Counterexample: The Maxwell Lagrangian density $${\cal L}~=~-\frac{1}{4}F_{\mu\nu}F^{\mu\nu} + j^{\mu}A_{\mu}$$ (where we assume that the background source $j^{\mu}$ satisfies a continuity equation $d_{\mu}j^{\mu}=0$) is only gauge-invariant up to a total spacetime derivative. Correspondingly, the Lagrangian $$L~=~\int \! d^3x~ {\cal L}$$ is only gauge-invariant up to a total time derivative.