Gauge invariance of scalar QED Let's consider a complex $\phi$ coupling minimally to $U(1)$ gauge field:
$$
\mathcal{L} = - \frac{1}{4} F_{\mu\nu} F^{\mu\nu} +  (D_\mu\phi)^*(D^\mu\phi) - m^2 \vert\phi\vert^2 + \dots
$$
For now, I want to look at the 1-loop correction to the scalar propagator due to the gauge sector only.  There are two Feynman diagrams:

Before we proceed, we need to fix a gauge, and the gauge field propagator is quite different in different gauges:
$$
-i \left(\frac{g_{\mu\nu} - (1-\xi) k_\mu k_\nu/k^2}{k^2}\right),
$$
where the value of $\xi$ corresponds to a particular gauge choice.
Question 1:
Diagram (1) by right is quadratically divergent.  In either gauge, the loop integral is proportional to
$$
\int \frac{d^dk}{k^2}
$$
but the coefficient is obviously gauge-dependent:
$$
(g_{\mu\nu} - (1-\xi) k_\mu k_\nu/k^2) \, g^{\mu\nu} = (d-1) + \xi
$$
appearing on the numerator.
Now I know the particle physics folks will just define the integral to be zero using dimensional regularization, and tell me there's no problem.  Am I right in saying that, if we believe that the UV theory is still gauge-invariant, then by some unknown black magic it should go away by itself and dropping it is supposedly the right thing to do here?
Question 2:
Now look at diagram (2).  If I write down the loop integrals in Landau gauge ($\xi = 0$) and Feynman gauge ($\xi = 1$), and take the difference, I get something like:
$$
\int d^dk \frac{(k^2 - 2 \, p \cdot k)^2}{k^4[(k-p)^2 - m^2]}.
$$
This is quite ugly and I have not worked through it.  But the point is that the integral

*

*is obviously non-zero

*is quadratically diverging.  Ok let's say that goes away by itself...

*it still contains a logarithmic divergence

*and the finite part has to depend on $p$ and $m$, and cannot be subtracted off cleanly in any renormalization scheme

So what happens to gauge invariance here?
 A: Both Questions 1 and 2 are asking about the compatibility of your result with gauge invariance. But actually the quantity that you are computing is not gauge invariant, the two-point function of the scalar field at two separate points is not left invariant by a gauge transformation. So in particular with your gauge fixing there is no reason to expect $\xi$ independence of the result.
On the other hand, it is true that the quadratic divergence that you mention in Question 1 has a consequence of generating a $\xi$-dependent correction to the mass$^2$ of the scalar field. The mass$^2$ is a gauge-invariant quantity unlike the full propagator, so we seem to face a puzzle. The resolution to this is that actually not all regulators are gauge invariant. A hard cutoff breaks gauge invariance, and forces you to introduce non-gauge-invariant counterterms to regulate the theory. On the other hand, dimensional regularization is a gauge-invariant regulator and this problem does not exist. Another example of a gauge-invariant regulator is Pauli-Villars and the problem should disappear with that regulator too.
