The first time some kind of gauge fixing appears is during the Gupta-Bleuler procedure, which is used to be able to quantize the photon field:
The basic gauge invariant Lagrangian leads to $\Pi_0=0$ which is incompatible with the canonical commutator relations. Furthermore the Green Function, i.e. the propagator, for the corresponding equation of motion does not exists. Therefore one adds a term to the Lagrangian $\frac{1}{2} (\partial_\mu A^\mu)^2$, which isn't gauge invariant. Nevertheless, now $\Pi_0 \neq 0$ and the propagator can be derived. But in return unphysical degrees of freedom appear (longitudinal/timelike) photons appear, which are eliminated by the weak Lorenz condition, that guarantees we only pick physical states.
Instead of $\frac{1}{2} (\partial_\mu A^\mu)^2$ one can add $\frac{1}{2\zeta } (\partial_\mu A^\mu)^2$, which is called a gauge fixing term to the Lagrangian. The parameter $\zeta$ is the gauge parameter which determines which gauge we are working in. $\zeta =1 $ for the Feynman a.k.a. Lorenz gauge, $\zeta = \infty$ for the unitary gauge etc. The propagator is then $\zeta$ dependent, but all physical observables are of course gauge independent.
A similar problem appears for the gluon fields. Again, a gauge fixing term is introduced, but this time in order to secure unitarity of the S-Matrix ghosts fields are needed.
These problems seem to appear because we try to describe a massless spin-1 field, which has two physical degrees of freedom, in a covariant way, which means a four vector. In the unitary gauge, i.e. without a gauge fixing term, and imposing a gauge condition, for example the Coulomb gauge from the beginning, no timelike/longitudinal photons appear. But the Coulomb gauge isn't Lorentz invariant ($A_0=0$). For a covariant description we need a gauge fixing term.
I'm a little confused about these concepts and their connection:
How exactly does the gauge fixing term work? I understand that it is a term that destroys gauge invariance, but I do not understand how it fixes a gauge. (In this context often the term Lagrange multiplier is used, but can't make the connection. If someone could explain how this concept works in this context, it would help me a lot.)
Are the longitudinal/timelike photons, in some sense, ghosts, too? Nevertheless, for the photon case those unphysical degrees of freedom are eliminated by an extra condition, for the gluon field, unphysical degrees of freedom are introduced additionally (Ghost term in the Lagrangian), in order to secure unitarity. Is there some connection between these concepts? What happens to the longitudinal/timelike gluons? Are ghost fields only needed if we want to work in an arbitrary gauge
Whats the reason ghosts are needed? (Mathematically to make sense of the theory, i.e. make the S matrix unitary again, but) Is it because we want to work in an arbitrary gauge and with a non-covariant description with a fixed gauge from the beginning this problem wouldn't appear? Gluons carry charge themselves and therefore they can form loops. In those Gluon loops we have to add all contributions, including the unphysical ones (longitudinal/timelike) which makes the S-matrix non-unitary?! In contrast to the photon case, the contribution of these loops can't be cancelled by a weak-Lorentz condition (which defined what we understand as physical states), and therefore the ghosts are in some sense the equivalent to the weak-Lorentz condition?!
I'm trying to understand this using the canonical formulation of QFT, but unfortunately most books explain this using the path integral approach. Any idea or reading tip would be much appreciated!