Starting from the Lagrangian density of the electromagnetic field: We demand that the lagrangian is invariant under a gauge transformation ...

Deriving conservation of electric current/charge from gauge symmetry in QED – physics.stackexchange.com
McAlkis
