I assume I am making a mistake here. Can you please help me learn how to fix them? In electrodynamics, the gauge transformations are: [tex]\vec{A} \rightarrow \vec{A} + \vec{\nabla}\lambda[/tex] [tex]V \rightarrow V - \frac{\partial}{\partial t}\lambda[/tex] These leave the electric and magnetic fields unchanged. The electromagnetic energy density is proportional to: [tex] u \propto (E^2 + B^2)[/tex] So the energy density should be gauge invariant. A guage transformation shouldn't even shift it by a constant. However, the energy density can also be written in terms of the potentials and charge distributions as: [tex] u = \frac{1}{2}(\rho V + \vec{j} \cdot \vec{A})[/tex] If I let [itex]\lambda[/itex] = e^(-r^2), then V is unchanged, and A is just changed by a radial field which vanishes at infinity. Here, the energy density IS changed, and not by a constant amount either ... it changes by an amount depending on j. What gives? Even weirder, is some textbooks start with the potentials form to derive the fields form. I don't see any place they fix any gauge in doing such derivation. Please help.
I wanted to talk about the electromagnetic energy density (proportional to [itex](E^2+B^2)[/itex]), but you have instead talked about a relativistic scalar density (proportional to [itex](E^2-B^2)[/itex]). Therefore I am not sure how to relate your response back to the original question. Are you saying [itex]A_{\mu}J^{\mu}[/itex] is gauge invariant but the electromagnetic energy density is NOT? I understand that [tex]\partial_{\mu} J^{\mu}=0[/tex] because it is a statement of conservation of charge. But I don't understand why the following is zero for every possible J or lambda [tex]\int d^{3} x \ \delta (A_{\mu}J^{\mu}) = \int d^{3} x \ J^{\mu} \partial_{\mu} \lambda = 0[/tex]. Let's try just a simple circulating current, and a lambda polynomial in x and y: [tex]\vec{j} = y\hat{x} + x\hat{y}[/tex] [tex]\lambda = xy[/tex] noting that for this choice [tex]\partial_{\mu} \lambda = y\hat{x} + x\hat{y}[/tex] Looking at the result: [tex]\int d^{3} x \ J^{\mu} \partial_{\mu} \lambda = \int d^{3} x \ (y\hat{x} + x\hat{y}) \cdot (y\hat{x} + x\hat{y}) \neq 0 [/tex] So that doesn't seem to be gauge invariant either!?
Ah, okay. That is why my "counter-example" fails. The rest of what you wrote makes sense as well. Thanks for your help.