I was wondering wether it would make a difference (in general) if I were to were introduce the gauge covariant derivative $$D_\mu=\partial_\mu+ieA_\mu$$ In the Lagrangian density and then derive the equations of motion. OR if I were to derive the equations of motion and then introduce the gauge covariant derivative.
I checked this for the Klein-Gordon and Dirac equations where it made no difference at all.
My guess is that it would make no difference at all since we introduce this one to make our system (action, equations of motion, ...) gauge-invariant. So it doesn't really matter at which point I'd introduce the gauge covariant derivative.
But I'm unsure if this reasoning is correct ...
To make the question really basic I guess it comes to the question: "Do we always need to introduce the local symmetries in the action, or can we wait with that untill the equations of motion ?"
EDIT: I'm also a big believer of the fact that you just substitute the covariant derivative into the action to introduce your interacitons (this is the way to go since Noether's theorem works with the action and this theorem guarantees the conserved quantities).
Now I'm studying "Quarks & Leptons: An Introductory Course in Modern Particle Physics" by Halzen & Martin, and when they study QED of spin-0 particles (chapter 4 in my edition which is the 1984 edition apperently) they introduce the gauge covariant derivative in the EQUATIONS OF MOTION in stead of the action.
Somewhere this has some logic to me since if your system is invariant under some kind of symmetry, the the equations of motion should be invariant for this kind of transformation as well (otherwise two solutions related by a symmetry-transformation wouldn't yield the same result). I think this is what they're proving here (arxiv.org/abs/0907.2301), but I'm not sure to which extent this goes ?
Of course (as said in a comment to one of the answers), if you want to give your vectorfield $A_\mu$ a general dynamics you need Yang-Mills theory ans some kind of kinetic term for this field, in this case you need a Lagrangian to "unify" both dynamics.
EDIT2: @QMechanic's answer also gives a very nice scematic version of the question (just for reference).