# Relation between the trace anomaly and the energy-momentum tensor being off-shell

Let's say we have a massless QED theory with a Lagrangian

$$$$L=i\bar{\psi}\not{D}\psi-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$$$$

The symmetric energy-momentum tensor is

$$$$\Theta^{\mu\nu}=\frac{1}{2}\bar{\psi}\Big\{\gamma^\mu D^\nu+\gamma^\nu D^\mu\Big\}\psi-\eta^{\mu\nu}i\bar{\psi}\not{D}\psi-F^{\mu\lambda}F^\nu_{\ \lambda}+\frac{1}{4}\eta^{\mu \nu}F^{\sigma\lambda}F_{\sigma\lambda}$$$$

The trace of this operator is

$$$$\Theta^\mu_{\ \mu}=\big(1-d\big)i\bar{\psi}\not{D}\psi+\big(\frac{d}{4}-1\big)F^{\sigma\lambda}F_{\sigma\lambda}$$$$

The fermionic part is zero if we use Dirac's equation, which can be stated as "The energy-momentum tensor is traceless on-shell". On the other hand, if we are working on a $$d=4$$ spacetime, the photon part is inmediately traceless.

The last equation works if $$\Theta^\mu _{\ \mu}$$ is a quantum operator as well, since the equations of motion work for operators too. My question is: How is the path integral insertion $$\langle\Theta^\mu_{\ \mu}\rangle$$ not inmediately zero?

My preliminary answer is that when you actually calculate that using

$$$$\langle\Theta^\mu_{\ \mu}\rangle=\int\mathcal{D}\psi\mathcal{D}A_\mu\Theta^\mu_{\ \mu}e^{-S_E}$$$$

the operator inside the path integral is not on-shell, which means that it is not zero. However, if we were working only with the photon field in $$d=4$$ then there's no way $$\langle\Theta^\mu_{\ \mu}\rangle$$ is not zero.

Is my reasoning correct?

After doing some reading, the answer seems to be this. Although every single book writes the trace anomaly in terms of $$\Theta^\mu_\mu$$ or $$\langle \Theta^\mu_\mu \rangle$$ they mean neither of those. What they mean is
$$$$\langle A_\rho | \Theta^\mu_\mu | A_\sigma \rangle$$$$
which is the expectation value of an insertion of the trace operator $$\Theta^\mu_\mu$$ in the presence of a background field $$A_\rho$$. This basically accounts for using the trace operator as an insertion on the photon propagator. As I said in the question, since the propagator can have loop corretions, the insertion of the trace doesn't need to be on-shell and therefore the fermionic part can contribute. Evenmore, if you have a divergence in the propagator you'll need to regularize that integral. If the regularization schemes mess with the number of dimensions (Dimensional Regularization) or they break the symmetry that made the trace zero in the first place (Cut-Off Regularization) then even the photon term can contribute to the insertion.
I was confused for a long time also. Becuase being scale invariant depends onthe space-time dimension, in dimensional regularization, you can have $$\sum_{\mu=1}^4 \langle \Theta^\mu_\mu\rangle \ne \langle \sum_{\mu=1}^4\Theta^\mu_\mu\rangle.$$ This can happen because $$\sum_{\mu=1}^4\Theta^\mu_\mu$$ can formally be zero as an operator becuase $$\sum_{\mu=1}^4\Theta^\mu_\mu\propto (n-4)(Operator)$$, but the $$n-4$$ factor can cancel against a $$1/(n-4)$$ pole in the vev.