Example of a classical action changing by a nonzero boundary term under a continuous transformation Is there an example of a continuous transformation in classical field theory under which the classical action changes by a nonzero boundary term? I'd prefer an example from field theory in flat spacetime.
 A: OP is asking for examples of a quasisymmetry of the action that is not a strict symmetry:

*

*Gaugesymmetries are often quasisymmetries.


*A global additive shift of the free Schroedinger field, cf. e.g. this Phys.SE post.


*A Galilean boost of the non-relativistic free particle, cf. e.g. this Phys.SE post.


*The quasisymmetry behind the conservation of Laplace-Runge-Lenz vector, cf. e.g. this Phys.SE post.


*Examples 1, 2 & 3 in the Wikipedia article for Noether's theorem.
A: A (Lorentz-noninvariant) Lagrange density in electromagnetism proportional to $\vec{A}\cdot\vec{B}$ changes by a boundary term under a gauge transformation.*  Under the change of gauge $\vec{A}\rightarrow\vec{A}+\vec{\nabla}\Lambda$, a Lagrange density
$${\cal L}=-\frac{1}{4}\left(\vec{E}^{2}-\vec{B}^{2}\right)+k\vec{A}\cdot\vec{B}$$
changes by
$${\cal L}\rightarrow{\cal L}+k\left(\vec{\nabla}\Lambda\right)\cdot\vec{B}={\cal L}+\vec{\nabla}\cdot\left(k\Lambda\vec{B}\right)$$
(Here, $k$ is a constant coefficient.)  To derive the transformation properties of ${\cal L}$, we have used the facts that the magnetic field is gauge invariant, $\vec{B}\rightarrow\vec{B}$ under the gauge transformation, and divergenceless, $\vec{\nabla}\cdot\vec{B}=0$.
If the Lagrange density changes by a total derivative, then the action changes by a surface term,
$$S=\int d^{4}x\,{\cal L}\rightarrow S+\int d^{4}x\,\vec{\nabla}\cdot\left(k\Lambda\vec{B}\right)=S+\int d\vec{S}\cdot\left(k\Lambda\vec{B}\right),$$
where the last surface integral is over the boundary of four-dimensional Minkowski space.
*Such terms have been studied as models of CPT violation—for example in "Limits on a Lorentz- and parity-violating modification of electrodynamics," S. M. Carroll, G. B. Field, R. Jackiw, Phys. Rev. D 41, 1231 (1990).
